Cocos2dx tower anti-game logic, cocos2dx tower Logic
Cocos2dx tower anti-game logic 1. Welcome to the page
2. Create a game map using tield. Set the cantouch attribute to 1 for empty blocks.
3. Set the map anchor, add the anchor to an anchor container, and pass the anchor's walking function to the anchor container parameters to let the monster walk by the anchor.
4. create a turret (touch coordinates to map, convert turret array coordinates) first check whether a turret can be created at the touch start position, and then create the turret selection interface, the position is the entire part. Then, based on the touch, select the part on which the turret is to be created.
5. Collision Detection: add the dead enemy to the dead enemy container, traverse and remove the conflicted bullets, and traverse and remove the bullets.
6.
Turret base class (Turret divided into three categories, rotation shooting, shooting, multi-direction shooting) base class sets the turret line of sight range, lethal detection nearlyenemy, the nearest enemy
Enemy base (3 types of enemies): Set enemy attributes, walking speed, blood volume, current blood volume, set basic enemy movements, turn left, and turn right animation, explosion animation, set enemy direction judgment function, set enemy anchor container
Enemy class thief1. initialize the right turn animation, add the left turn animation to the animation cache, and initialize the monster Animation 2. create a function. 3. create an enemy function (input the anchor container, hp) 4. enemy direction changing judgment function (called per frame) 5. explosion Animation
Tower attacktower1. initialize sight, tag, lethal effect, Image 2. Add turret Bullet 3. Add shooting function 4. Remove bullet function
Q: How difficult is java cocos2dx game development and learning curve?
There must be some risks ~ Another two problems were solved. One was that no game was ever done ~ The entire game logic may be faulty ~ The other is that c ++ is unfamiliar. If the project is a little bigger, the memory may be leaked ~ Cocos2d-x must be used to do mobile games ~ In case of leaks, the entire program may crash ~ I am afraid of this
Cocos2dx is a suitable game type for development
Software.intel.com/..os2d-x
2d game development, online games, or standalone