Goomba4K

thanks for feedback everyone! I hope to implement some of these ideas.

oNyx, yes, it’s straight up Thread.sleep(10). I’d like to have it cap to maybe 40 updates per second but Im not sure how with currentTimeMillis()

I posted something here:
http://www.java-gaming.org/forums/index.php?topic=11640.msg93602#msg93602

Even works fine with win9x’s really bad resolution (50-55msec). For 40fps you would simply use 25f instead of 16f.

thanks oNyx. cool code, doesnt work as expected though :wink: I tried using 100f just for kicks and the updates per sec were nothing close to 10 :slight_smile:

easy to implement tho, Goomba4K now uses it and the game now weighs in at 4083 bytes!

oh yeah, and oNyx, I’m sure you know this, but if you set lastFrame to System.currentTimeMillis() right before the game loop rather than 0, the throttler adjusts much faster.

edit: nevermind that first part, I see there’s two places to change the 16f :slight_smile:

I suggest you increase the FPS a bit. Much slower now, so slow that I get annoyed waiting for mario to fall down rather than trying to make him stay in the air :wink:
Was better at somewhat higher speed. :slight_smile:

adjusted to 60 updates per second. should be fast enough now :slight_smile:

The speed is way better now :slight_smile:

Before it was a bit underwater-ish.

edit: Btw most games like this (with gravity/acceleration… jump’n’runs in particular) cheat a bit. They a) use a higher acceleration value and they b) cap the terminal velocity at a rather low value. Doing so gives the player more control, because direction changes are quicker. I did that over in jm4k and it really improved things a lot.

This game doesnt really need it, because the extremes arent that extreme. I just thought I should mention it anyways :wink:

ooh, don’t give me ideas :wink:

Haha. :smiley:
Agreed, speed’s better now. Thanks :slight_smile:

Ahhh.

Btw, in the first post you state that the goomba count will go as low as 5, but it accually is 4. Which is wrong, the game or the info?

edit: I hope it is the info, because 4 is good. 3 on the ground and one falling down. :slight_smile:

actually in the game, I use an array of sprites to move all characters around. well, it happens to be that sprite[0] is mario instead of a goomba. but in the code since I limited the array to 5 items, it added up to 1 mario + 4 goombas :slight_smile: also in this case you only start with 14 goombas! =o!

this has been fixed, thanks! :slight_smile:

edit: oh so you LIKED 4?

4 goombas are enough. Easily :smiley:

what would REALLY be a challenge is when they get that low, maybe have all but one goomba suddenly have a spiked helmet on :wink:

(kidding, of course)

edit: I’ve actually been trying to come up with another obstacle besides the bullets because so many people just assume you can jump on the bullets. maybe lakitu throwing spikey balls?! :smiley:

[quote]edit: I’ve actually been trying to come up with another obstacle besides the bullets because so many people just assume you can jump on the bullets. maybe lakitu throwing spikey balls?! Cheesy
[/quote]
I miss Luigi! He is an evil obstacle you know! :wink:

This would also be cool: A Goomba turns red (flashes) for 1 second and then jumps up trying to hit Mario (who dies if he succeeds). He turns back into a normal Goomba as soon as he lands again after his attack leap. :slight_smile:

yeah I know I’d love to get luigi in there, but I havent gathered enough bytes to add another sprite to the list, unless I can some how change the hue values of the mario sprite at runtime … =o!

if u do find a way to change the hue values why not just add a purple and yellow one too ;D (wario and walugi)

lol

Have you looked into the bug when you “fall through” some goombas (2-3 on the same place, quite rare)?

havent encountered the error. it’s real basic collision detection (rectangle.intersects(marioRectangle). my only guess that maybe the gravity is pulling so fast that the difference between mario’s last point on the screen is larger than the goomba’s height (so it never collides). will investigate further :stuck_out_tongue:

That could be right… anyway, the “falling through” bug seems to occur when falling from high above and onto at least two goombas, I’ve never encountered it with only one goomba near mario. The other bug seems (but may not be) to be an entirely different and separate one (that is, the one where one goomba intersects you from the side exactly when you land on another goomba).

Oh, by the way, this game gave me inspiration for another game (very similar, only multiplayer and with some slight differences, that I won’t bother you with right now). I might try out making it, and then I’ll show it to you. Unless you think them too similar I might even submit it to the contest, but of that I am not sure :slight_smile:

[quote=“Morre,post:39,topic:26031”]
Are you going to do the original Mario Bros? (You know, the one before Super Mario Bros, that was later included as the challenge stage in SMB:3?)