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
var level1Time = 0; | |
function level1TotalTimeUpdate(){ | |
level1Time = level1Time + deltaTime; | |
} | |
function level1Spawning() { | |
} |
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
//In the enemy class: | |
var totalTime = 0; | |
NormEnemy.prototype.update = function(deltaTime) | |
{ | |
totalTime = totalTime + deltaTime; | |
var mathsSin = (100*(Math.sin(totalTime*3))); | |
if (this.ZigZagMovement == true) | |
{ | |
this.position.x = this.zigZagMean + mathsSin; |