Detecting collisions between the hero and platform or the hero and obstacles is similar—you can create that code as a generic collision-detection method.
- [Voiceover] Hi there. Welcome back to the video.…We have made the avatar falls…with gravity in the last video.…In this video we make the hero runs.…We have laid down most of the foundation work,…we only need to change a few lines of code…to make the hero run by applying velocity…and testing the game.…In the hero class, we want to add the ability to run.…We can do that by creating a new method called run.…Inside the method we change the x velocity…of the object to two.…
There is a running animation,…which is the default animation.…If we check the timeline in Adobe Animate,…the running is the first and default animation,…but the running animation is not necessary the default one.…For example, in some animation setting,…we may have an idle animation at the first place.…In such case, we can ensure to play the running animation…by calling the go to and play on the graphics.…The run label is defined in the timeline.…
There are two labels marked in the graphic timeline,…run and jump.…We can control which segment…of the timeline to play by using the go to and play method.…
Note: This course was created by Packt Publishing. We are pleased to host this training in our library.
- Planning your first game
- Setting up your file structure
- Setting up HTML and JS
- Drawing basic shapes with EaselJS
- Implementing your first game object
- Creating the core game logic
- Adding graphics to your game
- Planning your second game
- Handling obstacle and hero collisions
- Making the hero run and jump
- Adding graphics and animations
- Polishing your final game
Skill Level Beginner
Q: Should the exercise files be run from a server or locally?
A: Please run the exercise files from a server as directed. The files will not work properly if run locally.
iOS Game Development with Swift 3 and SpriteKitwith Todd Perkins2h 52m Intermediate
1. Planning Your First Game
2. Creating the Core Game Logic
3. Adding Graphics to Your Game
4. Planning Your Second Game
Planning the rush game4m 7s
5. Game Objects and Collisions
6. Character Movement and Input Handling
7. Adding Graphics and Animations
8. Polishing Your Final Game
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.