Page 1 of 1

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

Posted: Tue Oct 29, 2013 4:53 am
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 3936 times
File:
Test - JawBreaker.love
Test - JawBreaker.love
(8.15 KiB) Downloaded 279 times

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

Posted: Tue Oct 29, 2013 6:42 am
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.

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

Posted: Tue Oct 29, 2013 11:51 am
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?

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

Posted: Tue Oct 29, 2013 12:17 pm
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.

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

Posted: Tue Oct 29, 2013 12:40 pm
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?

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

Posted: Tue Oct 29, 2013 12:46 pm
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.

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

Posted: Tue Oct 29, 2013 12:56 pm
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.