help, how to make a game "JawBreaker" in love2d

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
luislasonbra
Citizen
Posts: 60
Joined: Sun Jun 24, 2012 1:57 pm

help, how to make a game "JawBreaker" in love2d

Post by luislasonbra »

hello, I'm making a game of "JawBreaker" in love2d.
I have done only the rows and columns of the balls.

Now, I can not remove the balls close to the selected ball.

as I can do this in love2d.

here I leave the code that I have, so far
Screenshot
Screenshot
Help.png (143.37 KiB) Viewed 3935 times
File:
Test - JawBreaker.love
Test - JawBreaker.love
(8.15 KiB) Downloaded 279 times
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: help, how to make a game "JawBreaker" in love2d

Post by micha »

The removing-mechanic consists of three steps: 1. find all balls of the same color, that touch a certain ball, and mark them for removal, 2. remove all marked balls, 3. move all other balls downwards.
At which part do you have problems?

For the first step you will need a flood fill algorithm.
User avatar
luislasonbra
Citizen
Posts: 60
Joined: Sun Jun 24, 2012 1:57 pm

Re: help, how to make a game "JawBreaker" in love2d

Post by luislasonbra »

micha wrote:The removing-mechanic consists of three steps: 1. find all balls of the same color, that touch a certain ball, and mark them for removal, 2. remove all marked balls, 3. move all other balls downwards.
At which part do you have problems?

For the first step you will need a flood fill algorithm.
hello.
the problem is in the first method.
Would not know how to find the balls of the same color who are around?
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: help, how to make a game "JawBreaker" in love2d

Post by micha »

As I said, the algorithm you need, is a flood-fill algorithm. Try to read the wikipedia-article, that I posted (and see the language version in your language).

I also found the Roland did a Floodfill project. I don't know if this is appropriate for your case, though.
User avatar
luislasonbra
Citizen
Posts: 60
Joined: Sun Jun 24, 2012 1:57 pm

Re: help, how to make a game "JawBreaker" in love2d

Post by luislasonbra »

micha wrote:As I said, the algorithm you need, is a flood-fill algorithm. Try to read the wikipedia-article, that I posted (and see the language version in your language).

I also found the Roland did a Floodfill project. I don't know if this is appropriate for your case, though.
hi thanks for the help, but I think I decided to start with a difficult game?
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: help, how to make a game "JawBreaker" in love2d

Post by micha »

I don't know your background, but I'd say this algorithm is of medium difficulty. If you are willing to try something a bit more difficult, then I suggest you try it. In the worst case you still learn a lot. But if you only want to finish a game, then you might be faster with a different idea.
User avatar
luislasonbra
Citizen
Posts: 60
Joined: Sun Jun 24, 2012 1:57 pm

Re: help, how to make a game "JawBreaker" in love2d

Post by luislasonbra »

micha wrote:I don't know your background, but I'd say this algorithm is of medium difficulty. If you are willing to try something a bit more difficult, then I suggest you try it. In the worst case you still learn a lot. But if you only want to finish a game, then you might be faster with a different idea.
thanks anyway, I think I will make a breakout game.
Post Reply

Who is online

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