JavaGaming.org

July 30, 2010, 09:33:26 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
Advanced search  
Pages: 1 [2]   Go Down
Print
Author Topic: [done!] MEG4kMAN, Mega Man in 4kb  (Read 7311 times)
0 Members and 2 Guests are viewing this topic.
irreversible_kev
Full Member
***
Offline Offline

Posts: 172



View Profile
« Reply #30 on: January 28, 2009, 03:59:05 am »

...then shoot my way through the last screen...

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

Rare crash?
Code:
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)
« Last Edit: January 28, 2009, 04:15:43 am by irreversible_kev » Logged
Abuse
JGO Kernel
*********
Offline Offline

Posts: 1783

falling into the abyss of reality


View Profile
« Reply #31 on: January 28, 2009, 10:20:54 am »

The first time I played through it also broke for me; though it didn't crash, and no exceptions were reported.  Huh
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.
Logged
pjt33
JGO Ninja
*****
Offline Offline

Posts: 599


View Profile
« Reply #32 on: January 28, 2009, 04:30:04 pm »

Are any of those monsters actually vulnerable to being shot?
Logged
Markus_Persson
Global Moderator
JGO Kernel
*****
Offline Offline

Gender: Male
Posts: 2083


Mojang Specifications


View Profile WWW
« Reply #33 on: January 29, 2009, 12:13:05 am »

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:

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

But I do:

Code:
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.
Logged

Play Minecraft!
Markus_Persson
Global Moderator
JGO Kernel
*****
Offline Offline

Gender: Male
Posts: 2083


Mojang Specifications


View Profile WWW
« Reply #34 on: February 15, 2009, 06:58:47 am »

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.
Logged

Play Minecraft!
h3ckboy
JGO Wizard
********
Offline Offline

Posts: 1421


View Profile WWW
« Reply #35 on: February 15, 2009, 07:04:02 am »

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

keep up the good work.
Logged
zeroone
Full Member
***
Offline Offline

Posts: 175



View Profile
« Reply #36 on: March 15, 2009, 09:51:24 am »

There’s an impressively large amount of (Nintendo copyrighted  Grin ) 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.
Logged
Markus_Persson
Global Moderator
JGO Kernel
*****
Offline Offline

Gender: Male
Posts: 2083


Mojang Specifications


View Profile WWW
« Reply #37 on: March 31, 2009, 05:17:37 am »

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. Cheesy
Logged

Play Minecraft!
Pages: 1 [2]   Go Up
Print
 
Jump to: