When you keep tapping jump he just flies around. Is there a fix that he can only jump when he's on a platform? Someone commented to add this command to prevent from holding the jump key. Just need to fix when tapping the jump key.if (event.repeat) { return }
I'm still pretty new at this but I think I'm getting close?
This did solve my issue for the time being. Probably some sort of collision detection would be better. Still new at this but this does get the job done for the time being.
EDIT: let allowJump = true;
put that above addEventListener I'm sure there's a much better way to do this but it worked.
Want to participate?
Create a free Chris Courses account to begin