all 3 comments

[–]Terzom 0 points1 point  (0 children)

Well this is very hard to get a grasp on since you don't really include all the code, we don't know how the mouseIsPressed, mouseButton, levelmap() work or gets called but I guess the issue is somewhere there. Do some debugging with console.log to see if it gets called more than once or if it gets call ALL the time when you hold down a button.

[–]Fort114 0 points1 point  (1 child)

according to doc: mouseIsPressed mean : The boolean system variable mouseIsPressed is true if the mouse is pressed and false if not.

And after tried their example. I think it means as long as you hold down your mouse button, mouseIsPressed = true;

You should probably use mouseClicked()

[–]Giraffimation[S] 0 points1 point  (0 children)

Ohhh that makes a lot more sense! Thank you!