Skip to content
Sign upLog in
← Back to Community

Kaboom.js

Profile icon
mrslep

How do you make something like this:
if (gamecharacter) collides with (enemy) it dies?

Answered by Coder100 [earned 5 cycles]
View Answer
Voters
Profile icon
ComfortKwinda
Profile icon
mrslep
Comments
hotnewtop
Profile icon
Coder100

use collide

collides("player", "enemy", () => { // your code });

this is assuming that when you create them, you have:

add(["player", ....]); add(["enemy", ....])