[Nagging]
Please move the source code Tutorial: http://blog.csdn.net/iamlazybone/article/details/19612941
Thanks to lazy bones for providing so many demo tutorials, it is really helpful for beginners.
Note: This section only records the experiences of bloggers who have learned about horizontal boxing.
[Game]
650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/48/B2/wKiom1QK1knCyfpdAAIvVx2bcvs278.jpg "Title =" 20131217223639500.png" alt = "wkiom1qk1kncyfpdaaivvx2bcvs278.jpg"/>
[Learning experience]
0. encoding steps
(1) Implement sneakyinput
(2) Implement actionsprite
(3) Implement hero, mobility + attack + injury + death
(4) enemy and enemymanager, move, attack, injury, and death
(5) enemy and hero attack each other
(6) Enemy AI, Automatic Walking + automatic attack
(7) Implement game scenario gamescene and tile Map
1. Virtual joystick sneakyinput
Please move: http://shahdza.blog.51cto.com/2410787/1549666
2. mxtiledmap
(1) getmapsize (): number of map tile.
. Width --> width horizontal tile Number of tiles.
. Height --> height: Number of vertical tile tiles.
(2) gettilesize (): the size of each tile, in pixels.
. Width --> width of each tile.
. Height --> height of each tile.
(3) Add a tile map: cctmxtiledmap: Create ("pd_tilemap.tmx ").
3. Move the Background Following the characters
Use ccpclamp.
// Void gamescene: updateviewpointcenter (ccpoint POS) {// only when a person moves to the region where the background is moved, will the background be followed by the person's Pos = ccpclamp (Pos, CCP (mysize. width/2, mysize. height/2), CCP (m_tilemap-> getmapsize (). width * m_tilemap-> gettilesize (). width-mysize. width/2, m_tilemap-> getmapsize (). height * m_tilemap-> gettilesize (). height-mysize. height/2); // set the location of the game scenario, background movement, and the reverse direction of the character movement. This-> setposition (mysize/2-Pos );}//
This article is from the "summer wind" blog, please be sure to keep this source http://shahdza.blog.51cto.com/2410787/1549663
Cocos2dx practice-demo experience in horizontal boxing