...

/

Implement Functions to Create and Update the Game

Implement Functions to Create and Update the Game

Implement the functions to create, initialize, and update the game.

Introduction

In the previous lesson, we initialized all the different game states required for the game. Now, we need to implement the createGame() and updateGame() functions, which are called from the GameState state created earlier.

Implement the function to create the game

Let's start with the implementation of the createGame() function. We'll be implementing the following steps in this function:

  1. Set the game world coordinates using the setBounds() function and specify the (x, y) coordinates we want the game world to start from and the width of the game world. These can be thought of as the dimensions in which our game is going to be rendered.

  2. Start the physics system for our game to apply velocities, gravities, and so on to the game objects.

  3. Generate the jumps array for 29 islands (the 30th30^{th} ...

Access this course and 1400+ top-rated courses and projects.