September 2014
Beginner
266 pages
5h 38m
English
In order to keep all the enemies and bullets in the same layer, we will create a new layer named GameplayLayer. This is where the gameplay will add and remove enemies and bullets, update their positions, and check for collisions. So, create a class named GameplayLayer similar to how you created the enemy class earlier.
Now, make sure that the GameplayLayer.h and GameplayLayer.cpp files are in the Classes folder. Once you have checked this, open the GameplayLayer.h file and add the following lines of code to it:
#ifndef __wp8Game__GameplayLayer__ #define __wp8Game__GameplayLayer__ #include "cocos2d.h" using namespace cocos2d; class GameplayLayer: public CCLayer { public: GameplayLayer(); ~GameplayLayer(); void update(); ...Read now
Unlock full access