Page 1 of 2

Ninwa's Love Puzzle - (my latest game!)

Posted: Tue Oct 19, 2010 7:05 am
by ninwa
Note: This has been written for and tested with Love .70 beta only. It probably works with .6.x, however.

Hello again!

I'm back again with my second Love game ever! It's not another space shooter, but this time, a physics based puzzle game. How cliche, I know, but I needed an excuse to play with love.physics :o)

Screenshot:
Image

How it works:
You will begin the game with a count-down timer. You can click anywhere on the screen to create a node. Each node will connect to it's nearest neighboring node. These lines that are created are your platforms, your tools to guide your ball. Oh yeah, there's a ball. Isn't there always a ball in these puzzle games? It will fall from the center-top of the screen and you must guide it into the green rectangle of success. The catch? Well, first, it takes some getting used to how the nodes work. The other catch? Your previous nodes remain into the next stage! You can return to a previous stage to reconfigure the nodes, don't worry, once you beat it again the next levels rectangle of success wont move. You will have to return to previous levels, it's okay, that's part of the fun (I hope.)

I can't explain it much better than that. Just go try it!

Controls:
  • Left mouse click: Draw a node.
  • 'r': Reset level
  • left arrow: return to a previous level (only active after you've hit 'r' or lost the current level.)
Current bugs:
  • If you draw a node too close to another node Box2d throws an exception. This is a limitation in Box2d's rectangles. They must be over a certain size. I am looking to fix this in the future as using their rectangles isn't the most elegant solution.
Downloads:
  • v01 (updated 10/19 for minor bug fixes) - http://www.josephbleau.com/ninwaLovePuzzlev01fix.love
    • Fixed finishing rectangle being drawn outside of screen.
    • You can no longer press left to visit the previous level at any point, only after having lost.
    • You can no longer lose after already having won (the lose timer now stops poperly, and all physics are frozen after winning)
Let me know what you think. Feel free to navigate the code, but I warn you now, it's not pretty.

Regards,
Ninwa

Re: Ninwa's Love Puzzle - (my latest game!)

Posted: Tue Oct 19, 2010 8:11 am
by ninwa
There seems to be some sort of bug (at least on Windows) where the randomly generated spot for the finishing boxes isn't all too random. I'm going to look into this in the morning.

-nin

Re: Ninwa's Love Puzzle - (my latest game!)

Posted: Tue Oct 19, 2010 8:54 am
by arquivista
the ideia seems nice but needs yet a lot of work.
some problems detected:
- after we won if ball gets away countdown restarts.
- in level changes should'n reset the old nodes?
- random box shows sometimes too low

Re: Ninwa's Love Puzzle - (my latest game!)

Posted: Tue Oct 19, 2010 8:57 am
by ninwa
arquivista wrote:the ideia seems nice but needs yet a lot of work.
some problems detected:
- after we won if ball gets away countdown restarts.
- in level changes should'n reset the old nodes?
- random box shows sometimes too low
The first and third point should be pretty easy to fix. The second point is what makes the game difficult. If it weren't for that the solution would be a V every level. I possibly didn't communicate the idea well enough (my fault) but the reason you can revisit old levels is so that you can make your solution more helpful in later puzzles. I think I need to work on making this more obvious to the player.

Nin

Re: Ninwa's Love Puzzle - (my latest game!)

Posted: Tue Oct 19, 2010 9:33 am
by Thursdaybloom
I understand what you're trying to achieve with the world revists. How about, as an alternative to level repetition, you have the location of where the next square is going to be visualised on the current level that you're on? This way we try and create our platforms to get the ball in the square at hand yet we have the foresight of knowing where the next square will be. This means we not only have to try make the ball stop in the square, we have to craft it in such a way that will help with the next level. I think node deletion needs to be implemented in some way (imagine level 12 without any node deleting...) but this is another issue.

Re: Ninwa's Love Puzzle - (my latest game!)

Posted: Tue Oct 19, 2010 11:04 am
by nevon
Thursdaybloom wrote:I think node deletion needs to be implemented in some way (imagine level 12 without any node deleting...) but this is another issue.
Maybe, to make it a little more difficult, without being an annoyance, you could have a maximum of 10 nodes - and when you add an eleventh, the first one is automatically removed?

Re: Ninwa's Love Puzzle - (my latest game!)

Posted: Tue Oct 19, 2010 11:33 am
by zac352
Why does that make me think "Armadillo Run"?

Re: Ninwa's Love Puzzle - (my latest game!)

Posted: Tue Oct 19, 2010 6:38 pm
by thelinx
To solve the randomness issue, add this to your love.load:

Code: Select all

math.randomseed(os.time())
math.random() -- the first random number is usually the same even across different seeds
math.random() -- for good measure
Also, I noticed a bug where if you try to spawn a node on top of another node, box2d makes LÖVE die. Not nice.

Re: Ninwa's Love Puzzle - (my latest game!)

Posted: Tue Oct 19, 2010 7:24 pm
by vrld
thelinx wrote:the first random number is usually the same even across different seeds
Time to test that statement:

Code: Select all

> tbl, c = {}, 0
> for i=1,10000000 do math.randomseed(i) local r = math.random() if tbl[r] then c = c + 1 end tbl[r] = true end
> print("colissions:",c, "rate:", c/10000000)
colissions:	23416	rate:	0.0023416
Taking every third random yields:

Code: Select all

colissions:	24082	rate:	0.0024082
So I guess it does not really matter.

Setting the seed is still a must though.

Re: Ninwa's Love Puzzle - (my latest game!)

Posted: Tue Oct 19, 2010 7:48 pm
by Robin
I think it depends on the platform or C standard library implementation of random.