Ask coding questions

← Back to all posts
kaboom.js
mrslep (30)

I took inspiration from @slmjkdbtl flappy mark project but I can not figure out how a sprite from falling out of the world and make it stay in place on top of a floor
like in the picture below :

Answered by Coder100 (17122) [earned 5 cycles]
View Answer
Comments
hotnewtop
Coder100 (17122)

make sure both the sprite and the player are on the same layer
got that?

then add these things. For your block/ground:

add([
  ...
  solid()
]);

and for your player:

add([
  ...
  body()
]);

so easy

Bookie0 (6028)

Can you link the code/repl?