I’d be happy to take a look at it if you are able to fill in the information requested below and send us the “share” link from one or both students.
thanks!
Mike
[Posts in the debugging category need to have the following pieces of information included in order to help other teachers or our moderator team best help you. Feel free to delete everything in brackets before posting your request for debugging help.] Link to the project or level: [replace with link to the curriculum or get the “Share” link to a project] What I expect to happen: [replace with a detailed description of the behavior you’re trying to create] What actually happens: [replace with a detailed description of what actually happens when the code runs including any errors or unexpected behavior] What I’ve tried: [replace with a detailed description of what you’ve already tried to do to solve the problem]
Ok… Below is the message I get. If you can get the “share” link from the student computer, I’m sure we can help you figure out why up and left aren’t working.
So, what is happening is that you have 4 independent conditional clauses. Two of them control the left and right movement and the other two control the up and down movement.
However, they conflict with each other. Your first conditional (up, I believe) says “if w is pressed, move up, otherwise, don’t move.” Then, immediately after, you have one that says “if x is pressed, move down, otherwise don’t move.” The computer executes those two commands in order and the final command when you press w (since x isn’t pressed) is to not move. So, it basically ignores the command to move up.
You can fix this by using “nested conditionals”. Try a condition like “IF w pressed, move up, ELSE if x pressed, move down, ELSE don’t move.”
When I did that (and also fixed the left and right conditionals the same way), I got a character that could move in all 4 directions.
Good luck and check back in if you need any further assistance.