Fizzy Bricks

Fizzy bricks is a 99 bricks remake (with 50 bricks) which involves stacking tetris style pieces into the tallest tower possible. It was made as a test piece for an API wrapper I’m putting together called “Fizzy” which itself wraps round JBox2D and tries to make it easier to use.

It’s available as an applet here: http://www.cokeandcode.com/fizzy/demo/

http://dl.dropbox.com/u/1668516/bricks.png

The source is available: https://bob.newdawnsoftware.com/repos/slick/fizzy-bricks/src/org/newdawn/fizzybricks/BricksGame.java

And fizzy source is here: https://bob.newdawnsoftware.com/repos/slick/trunk/fizzy/

Kev

Very well done, Kev. As always.
Thanks for sharing it.

Two evenings? Unbelievable!

Thanks Preston! To be fair, most of the heavy work is handled by JBox2D :slight_smile:

Kev

Very nice, simple and highly polished.

You’re welcome.
Kapta expressed it precisely: “Very nice, simple and highly polished.”

So JBox2D does the heavy work? However, who made this “heavy work” accessible in a “light and happy” way? I think a certain “Kev” with his “Fizzy”… :slight_smile:

Whoa nice :smiley: You sir, seem to be very productive!

cool !

Updated:

  • Fixed a little bug where you could get an NPE on game restart.
  • Fixed a bug where the blocks going off the screen would prevent you getting a new piece

Kev

Interesting little game! Pretty amazed you did it in 2 nights.

I ran into a couple of problems running it on my mac:

The number of remaining blocks did not show up on my screen at all.

If I scroll up the window I get graphical tearing at the bottom of the screen.

If you build a tall tower and then drop a block down the side of the tower it disappears once it hits the bottom edge. The screen should follow the block on its way down until you see the base.

It’s impossible to play it like normal tetris (although maybe that’s by design). I cannot fit a block into a narrow hole even though it should fit because of off-by-one pixel limits.

Would be nice to see a next block feature.

Overall nice job!

http://sshot.png

Impressive. Nice game and in 2 nights, well done.

Not sure about the missing block count, shows up here, could be the browser window wasn’t big enough to show the whole display?

Not being able to play like tetris, this is true, I’m really not sure how to improve that side of things. Seems to be tiny inaccuracies occuring in the physics model that causes pieces that should slide by each other (and do in a lot of cases) not to. Even added some code to refix position of things as they fall but no luck there either.

Kev

You might try very slightly reducing the size of the physics objects, but leaving the graphics the same. Box2d’s solver doesn’t handle flush sliding very well, so when you first get a corner-corner contact it’s a crapshoot as to which way it will decide the normal should point, but if things are a tiny bit smaller they should fit better. If you still want to mark them as having touched, consider making a sensor shape that’s the size of the full object and checking for that contact event.