Ask coding questions

← Back to all posts
CullenDAvello (18)

i have a function on lines 93 through 97 that i want to only run every second i have it so when the player touches the enemy he loses 1 health but its doing it wayyy to fast as soon as i touch the enemy i lose all my health
here's my game

malvoliothegood (496)

I have had this problem when making games using JavaScript. I have solved it by instantly moving the player away from the collision - it need not be by much.

Pythonier (314)

I'm pretty sure


would work. So you could write something like:

// delays 1/100 of a second
CullenDAvello (18)

@CullenDAvello hey i tried that but i don't think i had my declaration set up right could you fork it for me