[done!] MEG4kMAN, Mega Man in 4kb

Cool game, feels a bit wierd to control though. Amazing amount of graphics though!

Had one of these randomly:


Exception in thread "Thread-6" java.lang.StringIndexOutOfBoundsException: String index out of range: -300
	at java.lang.String.charAt(Unknown Source)
	at S.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Kev

Worked fine here. I also beat it in about 30 seconds, but I understand it’s not done yet.

PS - you’re too good at the 4k game thing.

I liked it a lot. one thing i dont get is how the heck did you make it only 3kb I have an asteroid field game that is a lot simpler and it is over 12! only reason I didnt beat it in 30 seconds was cause of the whole jumpingwhen you die thing. and there are a lot of spikes :slight_smile:

And it’s done! =D

25 screens of mega man goodness, and it displays your completion time when you beat it! Woop!

AGGH!!! Spikes!!!

Got to the spiked fall… tomorrow 'll try again.

Too hard for me, it was just making me angry.

However, this is a marked achievement.

Hehe, yeah, it’s freakishly hard.

It’s also designed to be speedrunnable, we’ll see if it ever gets popular enough for someone to post a speed run on youtube.

yeah, I was thinking the same thing. Would be really cool if there was a timer printed in the corner, or after you die.

WIN!
01 03 (That wont be a good time at all, I had many many restarts)

Some screens I just had to brute force it and loose HP just to get to the next screen.
Like on the last screen, I don’t see how you can’t loose at least 3HP.

Really awesome game!

Nice time! My best is about 1:20.

For the last two screens, i usually run through the second last screen, taking about four hits worth of damage, then shoot my way through the last screen.
The other way around might be faster, though…

shoot? OH YEAH. lol I didn’t even know there was a shoot button. I didn’t kill anything in that run.

Rare crash?

Exception in thread "Thread-12" java.lang.NullPointerException
	at sun.java2d.SunGraphics2D.validateColor(Unknown Source)
	at sun.java2d.SunGraphics2D.<init>(Unknown Source)
	at sun.awt.image.SunVolatileImage.createGraphics(Unknown Source)
	at AA.run(AA.java:589)
	at java.lang.Thread.run(Unknown Source)
Exception in thread "Thread-18" java.lang.StringIndexOutOfBoundsException: String index out of range: 108
	at java.lang.String.charAt(Unknown Source)
	at S.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

The first time I played through it also broke for me; though it didn’t crash, and no exceptions were reported. ???
The game continued to run, but only a portion of the Applet area was being updated (bottom right corner), as if all of the rendering operations were being translated down & to the right.
Refreshing the page fixed the problem.
My money is on it being an internal Java2D bug - will screenshot it if it happens again.

This was running on my Acer Netbook.

Are any of those monsters actually vulnerable to being shot?

Oh yes. Shoot them while they’re moving or preparing to shoot. They take three hits.
The fast ground sliders can’t be killed, though. (In the original, you could stop them temporarily by shooting them, but I didn’t include that)

irreversible_kev:
That crash MIGHT be if you manage to shoot while getting hurt by an enemy. I’ll investigate.

Abuse:
It might be a bug caused by me never releasing the Graphics object from the Applet.

Real code should be something like:


while (true) {
    Graphics g = getGraphics();
    render(g);
    g.dispose();
}

But I do:


Graphics g = getGraphics();
while (true) {
    render(g);
}

Putting the getGraphics inside the loop might help if that really is the problem, but iirc, that could use up system resources faster than it could be garbage collected if the loop is tight.

There’s a new version up now, with the following fixes:

  • Fixed the clock. It now works properly instead of resetting when you die.
  • The clock is shown all the time now instead of just on the final screen.
  • Tweaked a few game screens.
  • Added a spike to the last screen. Touching it resets the game.
  • Fixed the crash bug when shooting while getting hurt.

no one has posted here for a while. it is good to see that you still continue the game. :slight_smile:

keep up the good work.

There’s an impressively large amount of (Nintendo copyrighted ;D ) graphics in this game. I like how even the time is displayed using sprites instead of a font. How did you compress the screens? Are you allowed to shoot through walls in the actual Mega Man games? Sprite movement is not that fluid. Is the screen actually made up of 8x8 pixel blocks almost like ASCII graphics? This game is really difficult to play. It’s a very impressive 4K feat (excellent coding), but due to the difficulty, not all that fun.

Cool, there’s now a speedrun of it on youtube!

zeroone: I missed your post earlier, so I’ll reply now.

The screens are just a big String with different letters for each tile type. This compresses really really well, and with increasing gain the more levels I added.
At first I thought I’d only be able to have 10-15 screens, but at the end I got up to 25 with no trouble at all. I could’ve made 30 with some effort.

Movement is in 8 pixel chunks, yes. In retrospect, this was a mistake. It came from me just having played (and beaten!) Duke Nukem 1, the old platformer game. It also restricts movement to 8 pixel chunks. I liked the feel so much, I decided to build a game around it. I started out with DN graphics, but quickly realized it might make an even cooler mega man game.

The game is very difficult, yes. Unforgiving, one could say. I like that. :smiley: