aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Texture.cpp4
-rw-r--r--src/entities.cpp16
-rw-r--r--src/gameplay.cpp4
3 files changed, 22 insertions, 2 deletions
diff --git a/src/Texture.cpp b/src/Texture.cpp
index 0d67701..99d6ae7 100644
--- a/src/Texture.cpp
+++ b/src/Texture.cpp
@@ -46,4 +46,8 @@ void Texturec::bindNext(){
void Texturec::bindPrev(){
bind(--texState);
+}
+
+void Texturec::walk(){
+
} \ No newline at end of file
diff --git a/src/entities.cpp b/src/entities.cpp
index 8100a4c..da096bc 100644
--- a/src/entities.cpp
+++ b/src/entities.cpp
@@ -51,6 +51,8 @@ NPC::NPC(){ //sets all of the NPC specific traits on object creation
type = NPCT; //sets type to npc
subtype = 0;
+
+ health = maxHealth = 100;
maxHealth = health = 100;
@@ -68,17 +70,20 @@ Structures::Structures(){ //sets the structure type
}
Mob::Mob(int sub){
- width = HLINE * 10;
- height = HLINE * 8;
type = MOBT;
maxHealth = health = 50;
switch((subtype = sub)){
case MS_RABBIT:
+ width = HLINE * 10;
+ height = HLINE * 8;
tex = new Texturec(2, "assets/rabbit.png", "assets/rabbit1.png");
break;
case MS_BIRD:
+ width = HLINE * 8;
+ height = HLINE * 8;
+ tex = new Texturec(1, "assets/robin.png");
break;
}
@@ -147,6 +152,13 @@ void Entity::draw(void){ //draws the entities
tex->bind(0);
}
break;
+ case 2: //RABBIT
+ if(ground == 0){
+ tex->bind(0);
+ }else if(ground == 1){
+ tex->bind(0);
+ }
+ break;
default:
break;
}
diff --git a/src/gameplay.cpp b/src/gameplay.cpp
index 77d0021..1de542d 100644
--- a/src/gameplay.cpp
+++ b/src/gameplay.cpp
@@ -83,6 +83,10 @@ void initEverything(void){
mob.push_back(new Mob(MS_RABBIT));
entity.push_back(mob.back());
mob.back()->spawn(200,100);
+
+ mob.push_back(new Mob(2));
+ entity.push_back(mob.back());
+ mob.back()->spawn(200,100);
/*
* Link all the entities that were just created to the initial world, and setup a test AI function.