diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-30 19:46:44 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-09-30 19:46:44 -0400 |
commit | 67b62dde3dfd4fddba82940894f5b3416eee4c06 (patch) | |
tree | 8ba3646df76230750900ca2bc0c31f907bde6a87 /src/entities.cpp | |
parent | 7fbac4fc005baed6bc94d342cf7df2c8ad7a359a (diff) |
more fonts, entity name displays
Diffstat (limited to 'src/entities.cpp')
-rw-r--r-- | src/entities.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/entities.cpp b/src/entities.cpp index 85505ce..8ccd5e1 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -11,6 +11,7 @@ void Entity::spawn(float x, float y){ //spawns the entity you pass to it based o vel.y = 0; right = false; left = false; + near = false; ticksToUse = 0; canMove = false; ground = false; @@ -62,8 +63,9 @@ void Entity::getName(){ if((fgets(bufs,16,(FILE*)names)) != NULL){ std::puts(bufs); bufs[strlen(bufs)-1] = 0; - name = bufs; + strcpy(name,bufs); } + free(bufs); //delete(bufs); } @@ -89,6 +91,7 @@ NPC::NPC(){ //sets all of the NPC specific traits on object creation subtype = 0; alive = true; canMove = true; + near = false; } void NPC::addAIFunc(int (*func)(NPC *)){ @@ -110,6 +113,7 @@ Structures::Structures(){ //sets the structure type type = STRUCTURET; speed = 0; alive = true; + near = false; } unsigned int Structures::spawn(_TYPE t, float x, float y){ //spawns a structure based off of type and coords |