Extra challenge help Phaser.js

The extra challenge says to make the sprite move faster the longer he moves. How can I make it do this? i tried let xSpeed = 1; gameState.codey.x = xSpeed + 1; if the right arrow is pressed down but it does not work.

Hello @blog3861138260 :slightly_smiling_face:!

Code that is posted without the indentations, whitespace and special characters preserved, is very difficult to read, and cannot easily be tested by those trying to help you.

The Codecademy forum provides a quick and easy way to post properly-formatted code. All you need to do is look for the </> icon in the menu bar which appears at the top of the text box while you type.

capture

Press Enter to go to a blank line, click that icon, and you will see this:

capture_r

Just copy and paste your code directly from the editor into that highlighted portion, and all of the nicely-readable formatting will be preserved! Moreover, it will be in a format that can be directly copied and pasted into an IDE for testing.

The same icon can be used for highlighting small code snippets in-line for clarity.

I can then help more :slightly_smiling_face:.

3 Likes

On top of what @trevorhodges said, please send us the link to the exercise as well!

4 Likes