3 ms·
Agreed, this is a very cool concept but it's too hard for the player. As a workaround, run this in the console to double the player's speed and allow you to re-
by shawnz 8y ago
Agreed, this is a very cool concept but it's too hard for the player. As a workaround, run this in the console to double the player's speed and allow you to re-shoot the bullet while it's in motion.
Player.prototype.shoot = function shoot() { this.bullet = {x: this.x+this.s/2, y: this.y, s: 3}; this.isShooting = true }; Player.prototype.update = function update() { if (this.x > 0 && this.isMovingLeft) { this.x -= 0.02 * dt; }; if (this.x < w/4-this.s && this.isMovingRight) { this.x += 0.02 * dt; }; if (this.isShooting) { this.bullet.y -= 0.1 * dt; if (this.bullet.y < 0) { this.isShooting = false; this.bullet = {}; } } }
- atum47 8y agoNice, haha.