Bug Bomb

Bug Bomb is my interpretation of Scramble. It makes up a retro trilogy of sorts with Squaroids and Starbugs.

I’ve noticed that the scrolling causes ‘tearing’ of the game display on some machines. This seems to depend on the operating system and/or the JRE version (it doesn’t happen on Vista with Java 1.6, for instance). Sorry if this is an annoyance.

Comments are appreciated! (But don’t bother suggesting weapon upgrades – it’s a strictly one-weapon game! ;D)

Cheers,
Simon

That’s pretty cool! I like both the visual style and the sounds. Good work :slight_smile:

Played it a couple of minutes. It worked fine. Nice game!

Wow this totally exploded. I didn’t even get an Exception through JWS, my OS told me it died (because it killed JWS altogether).

Mac OS X 10.5.3
Java 1.5
2 ghz Intel Core Duo
2gb RAM

Here is the output from my console:


Process:         java [775]
Path:            /usr/bin/java
Identifier:      com.apple.javajdk15.Bug Bomb
Version:         12.0.0 (12.0.0)
Code Type:       X86 (Native)
Parent Process:  launchd [1]

Date/Time:       2008-09-23 18:42:01.143 -0700
OS Version:      Mac OS X 10.5.4 (9E17)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000b237a000
Crashed Thread:  18

Application Specific Information:

Java information:
 Version: Java HotSpot(TM) Client VM (1.5.0_13-119 mixed mode, sharing)
 Virtual Machine version: Java HotSpot(TM) Client VM (1.5.0_13-119) for macosx-x86, built on Sep 28 2007 23:59:21 by root with gcc 4.0.1 (Apple Inc. build 5465)
 Exception type: Bus Error (0xa) at pc=0x062dc4d4

Current thread (0x0101fd50):  JavaThread "Thread-10" [_thread_in_native, id=8653824]
Stack: [0xb0f9c000,0xb101c000)
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.java2d.loops.Blit.Blit(Lsun/java2d/SurfaceData;Lsun/java2d/SurfaceData;Ljava/awt/Composite;Lsun/java2d/pipe/Region;IIIIII)V+0
j  sun.java2d.pipe.DrawImage.blitSurfaceData(Lsun/java2d/SunGraphics2D;Lsun/java2d/pipe/Region;Lsun/java2d/SurfaceData;Lsun/java2d/SurfaceData;Lsun/java2d/loops/SurfaceType;Lsun/java2d/loops/SurfaceType;IIIIIILjava/awt/Color;)V+97
j  sun.java2d.pipe.DrawImage.renderImageCopy(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;Ljava/awt/Color;IIIIII)Z+75
j  sun.java2d.pipe.DrawImage.copyImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IILjava/awt/Color;)Z+45
j  sun.java2d.pipe.DrawImage.copyImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IILjava/awt/Color;Ljava/awt/image/ImageObserver;)Z+15
j  sun.java2d.pipe.ValidatePipe.copyImage(Lsun/java2d/SunGraphics2D;Ljava/awt/Image;IILjava/awt/Color;Ljava/awt/image/ImageObserver;)Z+21
j  sun.java2d.SunGraphics2D.drawImage(Ljava/awt/Image;IILjava/awt/Color;Ljava/awt/image/ImageObserver;)Z+18
j  sun.java2d.SunGraphics2D.drawImage(Ljava/awt/Image;IILjava/awt/image/ImageObserver;)Z+7
j  java.awt.Component$BltBufferStrategy.show()V+65
j  BugBomb.MainWindow.drawGameScreen()V+79
j  BugBomb.MainWindow.run()V+68
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub
Java Threads: ( => current thread )
  0x01021620 JavaThread "Java Sound Event Dispatcher" daemon [_thread_blocked, id=9440768]
=>0x0101fd50 JavaThread "Thread-10" [_thread_in_native, id=8653824]
  0x0101a740 JavaThread "Image Fetcher 0" daemon [_thread_blocked, id=9163264]
  0x01018e00 JavaThread "Keep-Alive-Timer" daemon [_thread_blocked, id=9040384]
  0x01011730 JavaThread "TimerQueue" daemon [_thread_blocked, id=9267712]
  0x0100fe90 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=9175552]
  0x0100f670 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=9182720]
  0x0100f250 JavaThread "AWT-Shutdown" [_thread_blocked, id=9179136]
  0x01001580 JavaThread "DestroyJavaVM" [_thread_blocked, id=-1333784576]
  0x0100d1a0 JavaThread "traceMsgQueueThread" daemon [_thread_blocked, id=9036800]
  0x0100b880 JavaThread "AWT-AppKit" daemon [_thread_in_native, id=-1607565408]
  0x01009330 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=8426496]
  0x01008900 JavaThread "CompilerThread0" daemon [_thread_blocked, id=8422912]
  0x01008400 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=8419328]
  0x01007c30 JavaThread "Finalizer" daemon [_thread_blocked, id=8499200]
  0x01007850 JavaThread "Reference Handler" daemon [_thread_blocked, id=8493056]
Other Threads:
  0x01006fa0 VMThread [id=8489472]
  0x0100aae0 WatcherThread [id=8503808]

VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 832K, used 43K [0x25580000, 0x25660000, 0x25a60000)
  eden space 768K,   5% used [0x25580000, 0x2558ad68, 0x25640000)
  from space 64K,   0% used [0x25640000, 0x25640000, 0x25650000)
  to   space 64K,   0% used [0x25650000, 0x25650000, 0x25660000)
 tenured generation   total 10368K, used 10000K [0x25a60000, 0x26480000, 0x29580000)
   the space 10368K,  96% used [0x25a60000, 0x26424148, 0x26424200, 0x26480000)
 compacting perm gen  total 8192K, used 3297K [0x29580000, 0x29d80000, 0x2d580000)
   the space 8192K,  40% used [0x29580000, 0x298b8708, 0x298b8800, 0x29d80000)
    ro space 8192K,  63% used [0x2d580000, 0x2da96c48, 0x2da96e00, 0x2dd80000)
    rw space 12288K,  43% used [0x2dd80000, 0x2e2af088, 0x2e2af200, 0x2e980000)

Virtual Machine arguments:
 JVM args: -Xbootclasspath/a:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/javaws.jar:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/deploy.jar -Djnlpx.home=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin -Djnlpx.splashport=50152 -Djnlpx.jvm=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java -Djnlpx.remove=true -Djava.security.policy=file:/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/security/javaws.policy -DtrustProxy=true -Xverify:remote -Djnlpx.heapsize=NULL,NULL -Dapple.laf.useScreenMenuBar=true
 Java command: com.sun.javaws.Main /var/tmp/javaws4L5rO0
 launcher type: SUN_STANDARD


Thread 0:
0   libSystem.B.dylib             	0x9280568e __semwait_signal + 10
1   libSystem.B.dylib             	0x9283036d pthread_cond_wait$UNIX2003 + 73
2   com.apple.CoreGraphics        	0x91dd2d01 CGSRMWLockLockExclusive + 54
3   com.apple.CoreGraphics        	0x91d73e43 CGSShapeWindow + 1090
4   com.apple.AppKit              	0x96b17528 _NSShapeRoundedWindowWithWeighting + 283
5   com.apple.AppKit              	0x96ac71f4 -[NSThemeFrame shapeWindow] + 496
6   com.apple.AppKit              	0x96ac6811 -[NSThemeFrame setFrameSize:] + 523
7   com.apple.AppKit              	0x96ac5fa4 -[NSWindow _setFrame:updateBorderViewSize:] + 649
8   com.apple.AppKit              	0x96ac58bc -[NSWindow _oldPlaceWindow:] + 1146
9   com.apple.AppKit              	0x96ac5179 -[NSWindow _setFrameCommon:display:stashSize:] + 1569
10  com.apple.AppKit              	0x96ac4b52 -[NSWindow setFrame:display:] + 78
11  libawt.jnilib                 	0x06184e27 -[CocoaAppWindow setFrame:display:] + 263
12  libawt.jnilib                 	0x06188681 -[CWindow _setNativeFrame:] + 1029
13  libawt.jnilib                 	0x0618037f -[CPerformer perform] + 281
14  com.apple.Foundation          	0x93983acc __NSThreadPerformPerform + 476
15  com.apple.CoreFoundation      	0x91a5d65f CFRunLoopRunSpecific + 3215
16  com.apple.CoreFoundation      	0x91a5dcf8 CFRunLoopRunInMode + 88
17  com.apple.HIToolbox           	0x934feda4 RunCurrentEventLoopInMode + 283
18  com.apple.HIToolbox           	0x934feaf6 ReceiveNextEventCommon + 175
19  com.apple.HIToolbox           	0x934fea31 BlockUntilNextEventMatchingListInMode + 106
20  com.apple.AppKit              	0x96a10505 _DPSNextEvent + 657
21  com.apple.AppKit              	0x96a0fdb8 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
22  com.apple.AppKit              	0x96a08df3 -[NSApplication run] + 795
23  libawt.jnilib                 	0x06180b62 +[AWTStarter startAWT:] + 1941
24  libawt.jnilib                 	0x0618037f -[CPerformer perform] + 281
25  com.apple.Foundation          	0x93983acc __NSThreadPerformPerform + 476
26  com.apple.CoreFoundation      	0x91a5d615 CFRunLoopRunSpecific + 3141
27  com.apple.CoreFoundation      	0x91a5dcf8 CFRunLoopRunInMode + 88
28  java                          	0x0000513e 0x1000 + 16702
29  java                          	0x0000258a 0x1000 + 5514

Thread 1:
0   libSystem.B.dylib             	0x927fe4a6 mach_msg_trap + 10
1   libSystem.B.dylib             	0x92805c9c mach_msg + 72
2   libclient.dylib               	0x004d161a 0x3b9000 + 1148442
3   libclient.dylib               	0x004d12b9 0x3b9000 + 1147577
4   libclient.dylib               	0x004915fa 0x3b9000 + 886266
5   libclient.dylib               	0x005af8f1 JNI_CreateJavaVM_Impl + 689
6   java                          	0x000044b3 0x1000 + 13491
7   java                          	0x00004d3b 0x1000 + 15675
8   libSystem.B.dylib             	0x9282f6f5 _pthread_start + 321
9   libSystem.B.dylib             	0x9282f5b2 thread_start + 34

Thread 2:
0   libSystem.B.dylib             	0x927fe4a6 mach_msg_trap + 10
1   libSystem.B.dylib             	0x92805c9c mach_msg + 72
2   libSystem.B.dylib             	0x92873f67 mach_msg_server + 491
3   libclient.dylib               	0x003c7ed5 0x3b9000 + 61141
4   libclient.dylib               	0x003c7c95 0x3b9000 + 60565
5   libclient.dylib               	0x0067dcc5 JVM_RaiseSignal + 441189
6   libSystem.B.dylib             	0x9287afef _pthread_body + 27

etc. etc. etc.

Cool game, the way the instructions are introduced is very good. I hate not being able to just play something straight away because the controls are weird, but yours are fine. the way those birds accelerate just kept on getting the better of me unfortunately. The way the screen keeps moving even when you die makes the game feel fast-paced which is great.

I reckon the background colour scheme is a bit off though. A nice sky texture with faded layers of mountains and parallax scrolling would be cool I think.

Nice job

Very cool game! A few gameplay tweaks like for example small variety of weapons, different kinds of enemies, levels that can be completed to move on to the next one could make this very addictive.

Ouch! That’s not good. Seems to be something going wrong with BufferStrategy? I’ll have a proper look at the output later.
Simon

Cool little random game.

nice job

The background made me want to claw my own eyes out, but it was actually somewhat addictive.

The fire rate feels slightly too slow. Ideally, I’d like to be able to hold fire and have the game automatically fire at the rate it’s possible to fire now, but if I manually tap fire, it’d shoot up to 50% faster.

Nice boss fight. =)

That’s likely, because the window was rapidly changing in size and appearance as the game started up, just before it died. It may have been attempting to switch resolution or something and just couldn’t.

My monitor is 1680 x 1050.

I have two theories as to what’s going wrong:

  1. There’s some problem with BufferStrategy that comes from having used JDK1.6 to compile code for Java1.5. I don’t know if that’s plausible, but it may be something to try.
  2. There’s some code in the game that allows the 512x384 window to be resized to 1024x768 and back. (Don’t ask why, it’s a long story, and it’s a very old bit of code.) Since you mention the window rapidly changing size, it’s possible that that code’s going crazy for some reason. (It’s possible that it’s never been tested on a Mac before.)

Could I ask you to try running the two other games I linked to at the top of the thread? (And then try launching Bug Bomb again, just to make sure it’s still broken!) The two old games both use the same resizing code that I used in the new game, so if they work okay then that rules out Theory 2. Also, they were built with JDK1.5 so if they do crash then that rules out Theory 1.

Thanks for the testing!
Simon

That’s a decent suggestion, but for me one of the most fun bits of the game is being able to drop a bomb precisely in the middle of a big cluster of baddies. I think that would be lost if I upped the firing rate.

I meant to ask whether the game difficulty is too high for people to make it to the boss level. I guess it’s not. (Either that, or you’re a hard-as-nails shoot’em-up ninja! 8))

Cheers,
Simon

I’ve tried out the other two games and they work fine.

I tried Bug Bomb and it exploded again. A more descriptive description:

  1. Splash screen opens.
  2. Window opens and spazzes out.
  3. Program dies.

I just tried it on a Mac with Java 1.6, and the game ran successfully.

Okay, that’s pretty clear then. I’ll download an older JDK and rebuild the game.
Thanks for your help with this.
Simon

Okay, I’ve rebuilt with Java 1.5. Fingers crossed there won’t be any more crashes.
Simon

Sad news! The same thing just happened again on this computer. Well at least I was able to play it another one. Maybe you should just say 1.6 only. :stuck_out_tongue:

That’s a pity. Since I can’t reproduce the bug myself, I can’t do anything to fix it. So, as you suggest, I’m going to assume that it’s a problem with Java 1.5, and restrict the game to 1.6 only.

Cheers,
Simon

P.S. I’ve uploaded the source code, in case anyone’s interested.

You’re probably right about the fire rate.

The game WAS kinda hard, but not too hard. The thing that killed me the most were the ones dropping from the ceiling until I figured out how to time them.
The boss fight ate me alive the first time, but I quickly figured out that the trick was to not hesitate.

Love the incoming shots before facing the boss. Very Super Mario Bros. =)

Woohoo! I managed to compile it with Netbeans 6.1. I made a new project and added the sources. The compiler then complained about JOrbis missing.

I downloaded JOrbis here: http://www.jcraft.com/jorbis/
Unzipped and put it the /src folder of BugBomb.

Then it complained about JNLP missing. I found the jnlp.jar file on my system in
/java\jdk1.6.0_10\sample\jnlp\servlet
Then I added it to “Libraries” in Netbeans.

Then Bugbomb quickly compiled and ran! Thanks for the source! :smiley: