2018 ソフトウェア設計及び演習用の班Wiki
18::gr11::moriyama::map_scene
enchant();
const MAP_HND = "./images/map/HND.png";
const MAP_BG = "./images/map/nakaniwa-hiru.jpg";
function kanokoreMapScene(story_number) {
let gamecore = enchant.Core.instance;
Others.Background.create(MAP_BG);
let HND_IMG = new Sprite(67, 93);
gamecore.assets[MAP_SCENE_BGM].play();
HND_IMG.image = gamecore.assets[MAP_HND];
HND_IMG.x = 200;
HND_IMG.y = 180;
gamecore.currentScene.addChild(HND_IMG);
//let HND = Others.Image.create(HND, 100, 80, 67, 93);
switch (story_number) {
case 1:
HND_IMG.x = 200;
HND_IMG.addEventListener('enterframe', function() {
if (HND_IMG.x < 600) {
HND_IMG.x += 5;
}
});
break;
case 2:
HND_IMG.x = 600;
HND_IMG.addEventListener('enterframe', function() {
if (HND_IMG.x < 1050) {
HND_IMG.x += 5;
}
});
break;
case 3:
HND_IMG.x = 1050;
HND_IMG.addEventListener('enterframe', function() {
if (HND_IMG.y < 550) {
HND_IMG.y += 5;
}
});
break;
case 4:
HND_IMG.x = 1050;
HND_IMG.y = 550;
HND_IMG.addEventListener('enterframe', function() {
if (HND_IMG.x > 610) {
HND_IMG.x -= 5;
}
});
break;
case 5:
HND_IMG.x = 610;
HND_IMG.y = 550;
HND_IMG.addEventListener('enterframe', function() {
if (HND_IMG.x > 200) {
HND_IMG.x -= 5;
}
});
break;
}
Others.Button.create("NEXT", "60px", 0, 0, function() {
let main_scene = new Scene();
gamecore.replaceScene(main_scene);
kanokoremainScene();
});
};
最終更新日:2018/08/02 23:03:09