Hi there! I'm trying to make a kind of "avoider" game where you
are getting followed by red dots and stuff, but I'm still stuck at the
hitboxes, 'cause I'm trying to make a menu with a start-button and
a help-button, but the hitboxes doesn't work! Please help me!
Problems with the hitboxes!
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Problems with the hitboxes!
- Attachments
-
- followers_0.1.0.love.zip
- (12.23 KiB) Downloaded 125 times
Re: Problems with the hitboxes!
Hey,
when you require "hitboxes", the code inside the file is executed once. You have to put this code inside a function, e.g.
Than you have to call this function on every love.update(dt).
when you require "hitboxes", the code inside the file is executed once. You have to put this code inside a function, e.g.
Code: Select all
function checkStartbutton()
mouseX = love.mouse.getX()
mouseY = love.mouse.getY()
if mouseX > hitboxButtonStartLX and mouseX < hitboxButtonStartRX then
if mouseY > hitboxButtonStartTY and mouseY < hitboxButtonStartBY then
if love.mouse.isDown "l" then screen = "play" end
end
end
end
Code: Select all
function love.update(dt)
if screen == "menu" then checkStartbutton() end
...
end
Re: Problems with the hitboxes!
I't didn't work? Help please!
Re: Problems with the hitboxes!
... have a look
- Attachments
-
- followers_0.1.1.love.zip
- (13.14 KiB) Downloaded 112 times
Who is online
Users browsing this forum: No registered users and 1 guest