Created
June 5, 2016 09:55
-
-
Save teramotodaiki/398c95340d441aa960dcdd1d462e569e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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