aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities.cpp
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2016-01-21 09:24:53 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2016-01-21 09:24:53 -0500
commit482e007d33699ff8afbc6017f6a73fedc889311b (patch)
treefc430057637ad7a1fe085cb193684968e178405c /src/entities.cpp
parent1ab18d0a0e80b1f7dff8ad90e41cc520198f7fcf (diff)
parent44804d69ea1af2490fedf54ea2cb273e3f5ab219 (diff)
Finished basic player sprite
Diffstat (limited to 'src/entities.cpp')
-rw-r--r--src/entities.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/entities.cpp b/src/entities.cpp
index fb5aca3..7f7d798 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -149,6 +149,7 @@ Structures::~Structures(){
Mob::Mob(int sub){
type = MOBT;
+ aggressive = false;
maxHealth = health = 50;
@@ -533,6 +534,23 @@ unsigned int Structures::spawn(BUILD_SUB sub, float x, float y){
void Mob::wander(int timeRun){
static int direction; //variable to decide what direction the entity moves
static unsigned int heya=0,hi=0;
+ static bool YAYA = false;
+
+ if(aggressive && !YAYA &&
+ player->loc.x + (width / 2) > loc.x && player->loc.x + (width / 2) < loc.x + width &&
+ player->loc.y + (height / 3) > loc.y && player->loc.y + (height / 3) < loc.y + height ){
+ Arena *a = new Arena(currentWorld,player,this);
+ a->setBackground(BG_FOREST);
+ a->setBGM("assets/music/embark.wav");
+ ui::toggleWhiteFast();
+ YAYA = true;
+ ui::waitForCover();
+ YAYA = false;
+ currentWorld = a;
+ ui::toggleWhiteFast();
+ //player->health-=5;
+ }
+
switch(subtype){
case MS_RABBIT:
if(!ticksToUse){