Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Chapter 05] KamaKazi Base code
#1
So, I'm trying to work through the KamaKazi Base InvaderStart code and ran into a few issues.

The first thing is that there was a switch from using Objects to GameObject.  The book mentions that Game Objects Classes from the previous example, but there was only an Objects class.  

The describes adding the code for Star.h and Star.cpp, however part of that code includes using Rand but this is not defined anywhere in the project so the IDE/Compiler complains.  I added this to GameObjects.h since it was in Objects previously.  I hope this is okay.

Also, in GameObject.cpp OBJID is assigned the value of NumberOfObjectsCreated++ however with Eclipse and the GNU Linker  with c++11 I am getting an undefined reference for 'GameObjects::NumberOfObjectsCreated.   After some Googling, I found I had to add the following initialization code at the top of GameObject.cpp.

   int GameObject::NumberOfObjectsCreated = 0;

This eliminated the Linker error.

After this and adding the code for Star, I am still not getting stars to show when the code is run as is mentioned on page 126.
Reply


Messages In This Thread
[Chapter 05] KamaKazi Base code - by jomoengineer - 11-13-2018, 07:57 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)