Discord
Login
Community
DARK THEME

how do you make obstacles like spikes in quick engine

please

If you mean an object that kills the player, then you need to check the collision between the player and the spikes:

init = function()
  map = Quick.addMap("map", 0, 0, 200, 200)

  spikes = map.extractSprites("spike")

  player = Quick.addSprite("player", 0, 0, 30, 30)
end

update = function()
  for s in spikes
    if Quick.spriteCollision(s, player) then
      // handle game over or health loss here
    end
  end
end

thanks

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community