Created
November 28, 2016 16:03
-
-
Save raduGaspar/8363f39a6984c0c4fa6e70344d9752b1 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
import { Scene, DisplayObject, AssetsLoader, KeyboardEvents } from '../../engine'; | |
import Bullet from './Bullet'; | |
export default class Player extends DisplayObject { | |
constructor(model) { /* ... */ } | |
update() { | |
/* ... */ | |
if(this.SPACE) { | |
this.model.fire = true; | |
this.assets.laserThum.play(); | |
this.scene.add(new Bullet(this.model)); | |
} | |
// wrap the square to the scene bounds | |
Scene.wrap(this.model); | |
} | |
render() { /* ... */ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment