So I just finished the Platformer Game. I have received the “congratulations”, 100% etc. The game doesn’t work. Assuming the link works, the player just goes to the side of the screen and is able to jump up and down. Is this my browser or something? I was looking forward to see the final product but it is the same product it has been for last 20 or so steps. Is this a bug?
if you go to step 1 can you play the game in the preview?
Right. But why does my final code not work?
I am asking if you can play the project on the step 1 as a debugging step. Woudl you mind answering if you are able to or not?
Oh yes! I am able to do it on the very first step
Ok, great.
Can you share the code you have for the last step please?
if (index === checkpoints.length - 1) {
isCheckpointCollisionDetectionActive = false;
showCheckpointScreen("You reached the final checkpoint!");
movePlayer("ArrowRight", 0, false);
} else if (player.position.x >= checkpoint.position.x && player.position.x <= checkpoint.position.x + 40) {
showCheckpointScreen("You reached a checkpoint!");
}
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').
that code doesn’t create an issue
when you move the player to the right, doesn’t the background move and allow you to go more to the right?
are there errors in the console?
That is correct. When I move it to the right the background (or canvas) does not move with it. There are no errors in the console
does the player reach the right limit of the canvas? and then? does it disappear out of screen? or does it stop there?
It stops at the right end of the canvas from what I can tell.
did you made other changes to the code? can you reset the step and try again?
I maybe could have bumped the keyboard or computer? However, I have reset the step and did a few times now. Do you think I could have messed with a previous step?
previous steps don’t matter, the starting code of a step doesn’t track what you did in previous steps
I have no idea what could go wrong here, it should work
I have you tried using my full code in your program?
What I was asking is could I have messed up a previous step later in the exercise?
No, I can’t, as you haven’t shared it.
no, because the starting code in step 117 is standard, it’s not influenced by what you have written in previous steps
Do you want to try to use my code? If not, no worries
You have shared this before, isn’t this what you add to the code? have you done other changes?
you can share your full code, but if you have not done other changes it will be the same I am testing
I just copied and pasted that in my code. Same issue