Version of Robotron arcade game using LPC1768, a Gameduino shield, a serial EEPROM (for high scores), two microswitch joysticks and two buttons plus a box to put it in. 20 levels of mayhem.
Dependencies: 25LCxxx_SPI CommonTypes Gameduino mbed
Diff: GameObject.cpp
- Revision:
- 10:bfa1c307c99d
- Parent:
- 6:8bbdb70bc11c
diff -r fa7e7b37b632 -r bfa1c307c99d GameObject.cpp --- a/GameObject.cpp Sun Jun 09 14:28:53 2013 +0000 +++ b/GameObject.cpp Sun Jun 09 19:34:56 2013 +0000 @@ -9,6 +9,7 @@ #include "GameObjectLocator.h" #include "ArenaConst.h" #include "GDExtra.h" +#include "EnemyFactory.h" /**********************************/ /* INITIALISE AN ARRAY OF OBJECTS */ @@ -77,7 +78,11 @@ // If not then it wants killing off and a NULL // should be written to the array of pointers // and the sprite should be hidden. + // If it is an enemy then it must be deleted using EnemyFactory. if( ! object->Visible ) { + if( object->GetType() == EnemyObjectType ) { + EnemyFactory::Instance.DeleteEnemy( (EnemyObject*)object ); + } objects[ i ] = (GameObject*)NULL; GDExtra::HideSprite( gd, object->SpriteNumber ); }