Ask coding questions

← Back to all posts
how i do to not spam the shoot action with kaboom.js
alexortizjr (0)

I am making a space invaders game on atom with the kaboom.js script

My problem came up when I do the shooting action, I can spam it and I don't want that ...
some advice to not be able to spam to the shoot action?

Answered by Coder100 (18876) [earned 5 cycles]
View Answer
Coder100 (18876)

You could set a property in the user called reload, and each time they shoot, the reload is set to like 10, and on action, you can decrease the value until it is 0, and only if reload is 0 can you shoot.

alexortizjr (0)

@Coder100 thanks: D its my first web game and im kinda lost with this things

Coder100 (18876)

mark as correct answer? @alexortizjr