function love.collide ()
if x < 0 then
x = 0
end
if x < love.graphics.getWidth () - Dolphin:getWidth () then
x = love.graphics.getWidth () - Dolphin:getWidth ()
end
end
I'm trying to make an x coordinate collision and I have already defined x previously. There is no error but the collision fails to work.
I think you mean x > love.graphic.getWidth() - Dolphin:getWidth()
. Because otherwise your Dolphin
should always be stuck at the right-hand boundary.