Home > other >  The elves of cocos2dx mobile how to get to monitor events
The elves of cocos2dx mobile how to get to monitor events

Time:09-22

Help you a great god

So I want to design a similar to don't step on white piece of extreme version of the game
Map is made of tileMap squares kept moving to the left I would like to ask you how to get under each tile to monitor events, like don't step on white piece inside
Black piece kept falling, per click to have corresponding to a black piece of incident response may I ask you about how to design the

CodePudding user response:

First turn to please glad [bowing]

CodePudding user response:

TileMap tiles have ID,

You use two kinds of color tiles, for example, a kind of used to represent the black piece of ID is 1, that you first get this ID

And then use the if (id==1) to add the black piece of resource map

Then use the if in onTouchBegan (id==1) to design the touch events,

Can go to the next lianliankan source code,
  • Related