Skip to content

Commit

Permalink
blue slows enemies
Browse files Browse the repository at this point in the history
  • Loading branch information
TehBucket committed Aug 20, 2014
1 parent c3f8b6d commit 4e4690e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions stuff.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Colorblind players??
Difficulty: progress bar
new enemy: doesn't move much, shoots projectiles at player
IMPROVE new level generation system
Boss levels
BUGS:
*/

Expand Down Expand Up @@ -208,7 +209,9 @@ var background = function(){
console.log('hit enemy with green');
}
else if(c.b>=255 && c.g <255 && c.r <255 && en[i3].tim==0){//if BLUE
if(en[i3].acc>0){en[i3].acc -=.05;} //slows enemy (acceleration)
// if(en[i3].acc>0){en[i3].acc -=.05;} //slows enemy (acceleration)
en[i3].xv /=3 //slows enemy (current velocity)
en[i3].yv /=3 //slows enemy (current velocity)
console.log('hit enemy with blue');
}

Expand Down Expand Up @@ -277,7 +280,7 @@ var explode = function(a){with(a){ //creates particles from given object
var enMove = function(){
for(var i=0;i<en.length;i++){with(en[i]){
if(hp == 0){c = co.b} //necessary? (red)
tim >= 100 ? tim = 0 : tim+=1;
c == co.en || tim >= 100 ? tim = 0 : tim+=1;
if(tim<50 && c!=co.en && hp>0){c=co.en} //flashes back to white except when dead
var a = fromAngle(r) //x,y coords of direction enemy is facing
//turn towards player
Expand Down

0 comments on commit 4e4690e

Please sign in to comment.