Cocos2d-x C++ Schedule update Level 1 http://gamesculpt.blogspot.com/2016/01/cocos2d-x-c-schedule-update.html
From Schedule update level 1 tutorial was to show how to implement schedule update into your game. For this tutorial level 2 will show you how to add game logic into your games using schedule update method.
Lets make simple game logic. We're going to make the sprite jump when button pressed.
Source Code https://github.com/GameSculpt/Cocos2d-x-Tutorial-schedule-update-Level-2.git
From Schedule update level 1 tutorial was to show how to implement schedule update into your game. For this tutorial level 2 will show you how to add game logic into your games using schedule update method.
Lets make simple game logic. We're going to make the sprite jump when button pressed.
The flow chart above show how game logic implement into your game where when button is press, the variable touch will turn into TRUE, thus variable goUp will frame by frame add 3 pixels. Therefore when the button is release, the variable touch will turn into FALSE. if FALSE and goUp variable is over 0, the goUp variable will frame by frame subtract 3 pixels. The video below will show how it done.
0 comments:
Post a Comment