Also available in fr.
Moving forward…
Congratulations! You completed the workshop and have a playable game you can share with other people.
However, you might have noticed that the finished version of the game is a bit more polished:
- It features a loading state (useful for when you publish your game in the Web)
- It has a music track playing in the background.
- The main character can jump higher or lower depending on how much time the up arrow key was pressed.
- The main character features a dying animation.
- The main character has a "enter the door" animation for when a level it's finished.
- Camera fade out and fade in.
The source code of this version has been provided for you to peek around and learn from it. It doesn't contain significantly new things, so you should be able to follow it along with the help of Phaser's documentation.
A good way of learning would be to try to replicate those features without seeing the code beforehand. Check out Phaser's examples, look for tutorials online, answers in online forums, etc.
If you get stuck, or are curious about how a feature was implemented in this case (there's usually more than just one way of doing things!), you have the full source code at your disposal.
Some tips to take into account
You can keep an sprite in the world but remove it from all the physics calculations by disabling its body. For example:
this.body.enable = false;
Phaser.Camera
has methods for fadign in and out.You can subscribe to an
onComplete
event of an animation or tween to do something once the animation or tween has finished.Songs are handled with the same class than sound effects,
Phaser.Sound
.
Game development resources
If you are itching to make more games, you may want to check out the resources page, which lists tools, articles, etc. to develop HTML5 games!