aboutsummaryrefslogtreecommitdiffstats
path: root/src/entities.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-01-21 09:25:47 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-01-21 09:25:47 -0500
commit44804d69ea1af2490fedf54ea2cb273e3f5ab219 (patch)
treea0c11e20f9cfd4c2185ef889ad9868b4046a718a /src/entities.cpp
parent77f6086bedaa0cbd945fb727a9e82a4c93e6255c (diff)
changelog
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 0507376..7e6b4e0 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){