What's wrong with this puzzle game?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Kasperelo
Party member
Posts: 343
Joined: Fri Apr 13, 2012 1:47 pm
Location: The Milky Way

What's wrong with this puzzle game?

Post by Kasperelo »

I tried my hand at making a very simple puzzle game I saw on mobile. The point is, the correct answer is the green square, and you are supposed to click to squares that, when added together, become the same as the answer. I'm sure you'll understand if you look at the code. For some reason it's not behaving correctly. Sometimes, even if I only press one square once it creates new squares and a different answer, which is supposed to happen when you have pressed two. I just don't understand what's wrong?
Attachments
main.lua
(4.1 KiB) Downloaded 83 times
User avatar
pgimeno
Party member
Posts: 3567
Joined: Sun Oct 18, 2015 2:58 pm

Re: What's wrong with this puzzle game?

Post by pgimeno »

Your collision function has a typo. > h2 should be > y2
User avatar
Kasperelo
Party member
Posts: 343
Joined: Fri Apr 13, 2012 1:47 pm
Location: The Milky Way

Re: What's wrong with this puzzle game?

Post by Kasperelo »

God dammit, thanks! I was pulling my hair out over this bug!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 2 guests