A. Hello Phaser
In this first tutorial, you'll code a "Hello World" game that displays the Phaser logo and changes the game's background color when the spacebar is pressed.
This won't be a true game (because it will lack an objective, rules, challenge, etc.). However, it will introduce you to coding with the Phaser CE game framework.
The goals of this tutorial are to help you:
- Understand the basic code structure of a Phaser CE game
- Code a "Hello World" game with a simple player interaction
When learning a new programming language, the first step that many people take is to create what is called a "Hello World" program. Traditionally, this program simply displays the text "Hello World" on the screen and only requires a few lines of code. The purpose is to demonstrate that you can create a simple yet functional program in the new coding language. It's a first step before creating more complex programs with the new language.
A Phaser game can display text, so you could create a traditional "Hello World" message on the game screen. However, since video games typically use lots of images, you'll instead display an image on the screen. In addition, since video games require player interaction, you'll add the ability to detect input from the keyboard.