A student is trying to get an alien to rise to the top-left corner of the grid, to stop, and then to move right to the top-right corner…then down to bottom-right…and to bottom-left, stopping at each corner. She can get the alien to stop at top-left, but can’t get it to move to the top-right corner. When she tries, the alien goes diagonally from bottom-left to top-right. I’ve attached her code so far.
Any ideas?
Can you have the student click on the share button in the top left corner of the page and get the share link? It’s easier to diagnose if we can actually watch it and have access to the debugging tools rather than just looking at the code.
These kinds of actions are definitely doable, but can be a little tricky!
When I tried your code that you sent, the alien is moving around the screen in the way you described the student wanted (from top-left to top-right to bottom-right to bottom-left). Did you maybe change something in the code to get it working?
I took a look at yesterday’s code and I believe the error was in the else statements. If I am understanding what was happening with the earlier code, when the sprite was in the bottom left, both else statements trigger causing the sprite to move to the top right. Glad she got it to work!