game.js
// State where the player collects raindrops.
State where the player collects raindrops.
State where the player collects raindrops .
function PlayState() {
	GameState.call();
	this.collectibles = [];
	this.collectibles.push(new Collectible(Collectible.RAINDROP, 'raindrop'));
	this.collectibles[0].setPosition(canvas.width / 2, 0);
	this.player = new Player();
	this.collectibleTime = 0;
	this.generationTime = 1000;
}
function PlayState ( ) { GameState . call ( ) ; this . collectibles = [ ] ; this . collectibles . push ( new Collectible ( Collectible . RAINDROP , 'raindrop' ) ) ; this . collectibles [ 0 ] . setPosition ( canvas . width / 2 , 0 ) ; this . player = new Player ( ) ; this . collectibleTime = 0 ; this . generationTime = 1000 ; }
State where the player collects raindrops.
State where the player collects raindrops .
// time elapsed between collectible generations // generate collectible every 500 milliseconds