018 : Finish stage 1

You:

I notice that the player can still go off the left/right side of the screen.

Balthazar:

Hmm... you can put a temporary fix in update_player() to keep the player on the screen, but there's a proper fix that you'll be doing later.

You:

What's the temporary fix?

script.js: Add temporary fix to keep the player on the screen
function update_player() { ... // Move the player to the new location. _player.x += _player.velocity_x; _player.y += _player.velocity_y; if (_player.x < 0) { _player.x = 0; } else if (_player.x > _game.width) { _player.x = _game.width; } }
You:

After doing that, I can't move the player completely offscreen, but I can still move it partway offscreen.

Balthazar:

That's because we're constraining the origin of the player, and the player's origin is the center (horizontally). Don't worry about this for now, we'll be fixing this up properly later.

Congratulations! You've have finished Stage 1 and your character has gained a level.

GOTO 020 to proceed to stage 2.