aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-10-27 08:48:01 -0400
committerClyne Sullivan <tullivan99@gmail.com>2015-10-27 08:48:01 -0400
commit135d46497cae4fbfcc500b3bd22b6c8d97d53084 (patch)
tree77d779c602069946f8dd07f66842f0652c2b8122 /src/entities.cpp
parent69ce4512cae1b286a9807be03dfc295b6a4570f6 (diff)
bird AI + xcfs
Diffstat (limited to 'src/entities.cpp')
-rw-r--r--src/entities.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/entities.cpp b/src/entities.cpp
index da096bc..0479d5e 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -332,6 +332,7 @@ unsigned int Structures::spawn(_TYPE t, float x, float y){ //spawns a structure
void Mob::wander(int timeRun){
static int direction; //variable to decide what direction the entity moves
+ static unsigned int hey=0,hi=0;
switch(subtype){
case MS_RABBIT:
if(!ticksToUse){
@@ -350,7 +351,10 @@ void Mob::wander(int timeRun){
ticksToUse--; //removes one off of the entities timer
break;
case MS_BIRD:
- if(loc.y<=init_y-.2)vel.y+=.005*deltaTime; // TODO handle direction
+ if(loc.y<=init_y-.2)vel.y=.02*deltaTime; // TODO handle direction
+ vel.x=.02*deltaTime;
+ if(++hey==200){hey=0;hi^=1;}
+ if(hi)vel.x*=-1;
break;
default:
break;