Skip to content

Instantly share code, notes, and snippets.

@raduGaspar
Created November 28, 2016 16:03
Show Gist options
  • Save raduGaspar/8363f39a6984c0c4fa6e70344d9752b1 to your computer and use it in GitHub Desktop.
Save raduGaspar/8363f39a6984c0c4fa6e70344d9752b1 to your computer and use it in GitHub Desktop.
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