010 : Horizontal only

You:

Alright, let's make the player move left and right.

Balthazar:

Good. And how do you think you should go about doing that?

You:

Umm.. by turning off the up and down keys?

Balthazar:

Right. And do you know what code you need to remove to turn off those keys?

You:

Well, the check_input() function handles the keyboard input. So I can just remove the parts that deal with the up arrow and down arrow.

Balthazar:

Excellent, try that and verify that it works.

script.js: Delete the code that moves the player up and down.
function check_input() { ... // Right arrow or 'd' to move right. if (_game.keymap[39] || _game.keymap[68]) { _player.velocity_x = 1; } // Up arrow or 'w' to move up. if (_game.keymap[38] || _game.keymap[87]) { _player.velocity_y = -1; } // Down arrow or 's' to move up. if (_game.keymap[40] || _game.keymap[83]) { _player.velocity_y = 1; } }

Congratulations! You've earned the Movement I - Horizontal badge!

GOTO 015 if you already have the Sprite I - Origin badge.

GOTO 005