The game is not challenging enough with only platforms. You can put some obstacles on the platforms to force the hero to jump over them.
- [Narrator] Hi there, welcome back to the video.…In the last video, we implemented logic…to check if the Hero is standing on any platform.…In this video, we extend the GameObject…to define moving logic.…We will begin by extending the GameObject with moving logic.…Then, we'll make the Hero to use the MovableGameObject.…We will also focus the Hero at the center…of the game screen whilst it is moving.…Let's begin at the game+es6.js file in the project.…
We create a new class named MovableGameObject.…It extends GameObject class.…In the constructor, we take two parameters.…The first one is graphic,…which follows the GameObject's constructor.…The second one is a World reference,…which we will need to access…the other GameObjects in the World.…That's because the moving GameObject…will interact with other GameObject.…We call this super with the graphic reference.…Then, we use this.world to store the World reference.…
We also define a velocity object,…which contains both x and y velocity.…For testing purpose, we give them value one.…
Author
Released
6/9/2017Note: 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
Duration
Views
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.
Related Courses
-
C# for Unity Game Development
with Jesse Freeman1h 37m Beginner -
iOS Game Development with Swift 3 and SpriteKit
with Todd Perkins2h 52m Intermediate
-
1. Planning the Count Game
-
Course overview3m 51s
-
Preparing the graphics5m 59s
-
-
2. Creating the Core Game Logic
-
Adding tap input events2m 35s
-
Adding the game logic2m 42s
-
3. Polishing the Count Game
-
Animating the game over scene10m 29s
-
Restarting the game2m 1s
-
Adding custom web font4m 22s
-
Adding audio effect4m 46s
-
-
4. Planning the Rush Game
-
Planning the rush game4m 7s
-
Creating a platform class1m 50s
-
-
5. Moving the Character
-
Making the avatar run2m 39s
-
Making the avatar jump4m 7s
-
6. Collision Detection
-
7. Building Levels
-
8. Polishing the Rush Game
-
Creating a main menu scene7m 48s
-
Creating a game over scene4m 20s
-
Displaying scores3m 30s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake 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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Creating movable game objects