Moonblockで作成したゲームは作ったパソコン、作ったブラウザ内でしか保存されません。
別のパソコンから見るには、Moonblockの「セーブ」という機能を使って、ブロックを組み合わせた時に自動的に作られるソースコードと呼ばれる命令文をテキストで保存しておく必要があります。
まず、画面左下にあるセーブボタンをクリックします。すると、下の図のように画面にQRコードとソースコードが表示されます。
スマホやタブレットで作ったゲームをプレイする際にはQRコードを読み込ませるだけで可能です。
パソコンでも、http://goo.gl/・・・のアドレスをブラウザで入力すると作ったゲームが復活するのですが、裏でソースコードが作られてるということを知ってもらう意味も込めて、今回はソースコードの保存、読み込み方法をご紹介します。
QRコードの下にあるテキストを全文コピーしておきます。
コピーしたテキストはメモ帳などのテキストエディタにコピーしておきましょう。
これでゲームデータの保存は完了です。
保存したソースコードを別のパソコンで見るには、セーブボタンを押し、QRコードの下に表示されたテキスト入力フィールドに全文コピーしたテキストを貼り付けます。(最初に表示されている[]の文字は消してOKです)
テキストを貼り付け終えたら左下にある「×とじる」ボタンを押しましょう。(少し見えづらいですが・・・)
すると、作ったゲームが無事復活します!
今回作成したゲームのソースコードを公開します。是非ご利用下さい!
[{
"x": 91,
"y": 35,
"constructorName": "PuppetBlock",
"variables": {
"name": "くま",
"fold": "-",
"image": "chara1.png",
"behavior": {
"x": 0,
"y": 0,
"constructorName": "DisplayBlock",
"variables": {
"appeartype": "standAlone",
"interval": "30",
"initial": "10"
},
"next": {
"x": 0,
"y": 0,
"constructorName": "MoveBlock",
"variables": {
"type": "tapChase",
"zigzagdirection": "X",
"tapdirection": "",
"movedirection": "Left",
"dx": "0",
"dy": "0"
},
"next": null
}
}
}
}, {
"x": 87,
"y": 237,
"constructorName": "PuppetBlock",
"variables": {
"name": "アイコン",
"fold": "-",
"image": "icon0.png",
"behavior": {
"x": 0,
"y": 0,
"constructorName": "FrameSequenceBlock",
"variables": {
"sequence": [15],
"times": "2"
},
"next": {
"x": 0,
"y": 0,
"constructorName": "DisplayBlock",
"variables": {
"appeartype": "randomSetup",
"interval": "30",
"initial": "10"
},
"next": {
"x": 0,
"y": 0,
"constructorName": "TargetHitBlock",
"variables": {
"className": "くま",
"fold": "-",
"handler": {
"x": 0,
"y": 0,
"constructorName": "ScoreBlock",
"variables": {
"value": "10"
},
"next": {
"x": 0,
"y": 0,
"constructorName": "DieBlock",
"variables": {},
"next": null
}
}
},
"next": {
"x": 0,
"y": 0,
"constructorName": "ListenerBlock",
"variables": {
"eventType": "actordieall",
"fold": "-",
"handler": {
"x": 0,
"y": 0,
"constructorName": "GameClearBlock",
"variables": {},
"next": null
}
},
"next": null
}
}
}
}
}
}, {
"x": 583,
"y": 373,
"constructorName": "ScoreBoardBlock",
"variables": {
"fold": "-",
"behavior": null
}
}, {
"x": 474,
"y": 511,
"constructorName": "TimerBoardBlock",
"variables": {
"countdir": "countdown",
"fold": "-",
"seconds": "10",
"behavior": {
"x": 0,
"y": 0,
"constructorName": "ListenerBlock",
"variables": {
"eventType": "timeup",
"fold": "-",
"handler": {
"x": 0,
"y": 0,
"constructorName": "GameOverBlock",
"variables": {},
"next": null
}
},
"next": null
}
}
}]




