There are some properties that are shared between moving objects, but this is not applicable to static objects such as platforms. You need a definition for moving objects that extends the GameObject class.
- [Narrator] Hi there.…Welcome back to the video.…In the previous video, we created the…foundation GameObject class,…and put a hero on the stage.…In this video, we will work on the Platform.…We will define a Platform class…which extends the GameObject class.…Then, we will use it by creating an instance of…the platform, and put it onstage directly.…Let's open the project in Code Editor.…In the game-es6.js file, we define a new class,…Platform, which extends the GameObject.…
In the constructor method, we initialize the…GameObject by calling super,…which we can also pass a graphics reference into.…We use the graphic that we exported from Adobe Animate.…It is exported into the lib space name.…So we put a new lib.PlatformGraphic…as the parameter of super.…That's all.…It's that simple!…Because we have put all of the common logic into…GameObject class, now we get the benefit of…re-using it for any new GameObjects…with different visual graphics.…
But, we still need to see the Platform on our stage.…In the restart game method, we create…
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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.