The game was working fine…however student tried to add some improvements to the code and now the guy won’t move to the left.
Any suggestions?
The game was working fine…however student tried to add some improvements to the code and now the guy won’t move to the left.
Any suggestions?
Hi Sarah,
I would try switching the board. When I play it, I can move the “guy” in both directions. There are some efficiencies in the code that could be improved:
“var guy_game” is declared more than once but only needs to be declared at the top of the code (refer to minute 1:30 in this videohttps://www.youtube.com/watch?v=G41G_PEWFjE)
Consider if/else statement vs multiple ifs because the booleans are true for more than one conditional. Ex: if guy_game is 20 then lines 43, 46 and 49 are true.
Let me know if switching boards doesn’t work. I’ve played the game several times now and the guy moves both ways.
Michelle