Skip to content

Instantly share code, notes, and snippets.

@teramotodaiki
Created June 5, 2016 09:55
Show Gist options
  • Save teramotodaiki/398c95340d441aa960dcdd1d462e569e to your computer and use it in GitHub Desktop.
Save teramotodaiki/398c95340d441aa960dcdd1d462e569e to your computer and use it in GitHub Desktop.
game.on('abuttondown', function () {
var speed = 2; // 投げるスピード
var time = 3.0; // ボムが爆発するまでのタイム
// ボム
var item1 = new MapObject('bomb');
item1.setTimeout(function () {
// ばくえん
var effect1 = new Effect(0, -1, 40);
effect1.locate(this.mapX, this.mapY);
effect1.collisionFlag = false;
effect1.scale(2, 2);
effect1.ontriggerenter = function (event) {
Hack.Attack.call(this, event.mapX, event.mapY, 99);
};
this.destroy();
}, time * game.fps);
Hack.player.shoot(item1, Hack.player.forward, speed);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment