woogley
|
 |
«
Posted
2006-02-08 13:53:13 » |
|
I don't know who wrote this, but I don't think it was someone from JGO. anyway check this out: http://javaunlimited.net/games/view.php?id=90it's a worms clone in 4K!  it lacks AI but works pretty good as a multiplayer great job whoever glenn sanson is! edit: oops there is AI!
|
|
|
|
jbanes
|
 |
«
Reply #1 - Posted
2006-02-08 14:42:58 » |
|
Yeash, give the guy a chace to post next time. I waited a couple of days on Doom Buggy, and the author eventually showed up. Edit: I believe he's registered on this site as the user Myself. He's responsible for the Frozen Bubble for Java conversion. Also, how do you turn on the AI? Edit 2: Never mind on the AI. Either the page got edited or I'm not paying enough attention.
|
|
|
|
|
Games published by our own members! Check 'em out!
|
|
f.l.x
|
 |
«
Reply #3 - Posted
2006-02-08 15:41:47 » |
|
|
|
|
|
DonaldEKnuth
|
 |
«
Reply #4 - Posted
2006-02-08 17:58:30 » |
|
Wow! Nice game!  I checked out the guys homepage and he is quite famous actually! He is the author of "Frozen Bubble" which is very well known in the Linux freeware gaming scene.
|
|
|
|
jbanes
|
 |
«
Reply #5 - Posted
2006-02-08 18:15:21 » |
|
I checked out the guys homepage and he is quite famous actually! He is the author of "Frozen Bubble" which is very well known in the Linux freeware gaming scene. You're confused. He's the guy who did the Java port, not the original game.
|
|
|
|
x30ice
Senior Newbie 
|
 |
«
Reply #6 - Posted
2006-02-08 19:00:30 » |
|
change sound/AI only works on alternate games. the bullet sometimes goes through walls and doesn't explode if hits a worm. soemtimes is difficult to see the aiming cross, is it possible to make it red for example ?
test machine: athlon xp @3200+, xp pro and jre 1.5
|
|
|
|
swpalmer
|
 |
«
Reply #7 - Posted
2006-02-09 00:55:15 » |
|
Nice!
|
|
|
|
Myself
Senior Newbie 
Java games rock!
|
 |
«
Reply #8 - Posted
2006-02-09 08:25:25 » |
|
I finally found back my password (Last post in 2003?)... Seems that W4K needs still need some work... I made a stupid mistake (used jdk5.0 to compile with a -source/target 1.4), and I used a function that does not exist in JDK1.4 -AudioSystem.getClip()-. The reflective method needed to get a Clip in JDK1.4 is way too costy (+200 bytes) and I don't want to use sun.audio package as it's not a standard package, so I'll probably have to remove explosion sound That will give me some bytes for further gameplay improvment  Short answers : - Frozen Bubble is not my game, I just made the J2SE port and the J2ME port (microFB) - Red cross is harder to see than a white one... I'll try to make it blink (As I said, I now have some spare bytes  The version -without sound- should be available next Monday -- Glenn
|
|
|
|
darkprophet
Senior Devvie   
Go Go Gadget Arms
|
 |
«
Reply #9 - Posted
2006-02-09 09:28:07 » |
|
I found it hard to shoot actually. I couldnt hit the actual worms if I had a direct hit...which im abit niffed about. DP
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Anon666
Junior Devvie  
aka Abuse/AbU5e/TehJumpingJawa
|
 |
«
Reply #10 - Posted
2006-02-09 18:45:14 » |
|
I finally found back my password (Last post in 2003?)... Seems that W4K needs still need some work... I made a stupid mistake (used jdk5.0 to compile with a -source/target 1.4), and I used a function that does not exist in JDK1.4 -AudioSystem.getClip()-. The reflective method needed to get a Clip in JDK1.4 is way too costy (+200 bytes) and I don't want to use sun.audio package as it's not a standard package, so I'll probably have to remove explosion sound That will give me some bytes for further gameplay improvment  Short answers : - Frozen Bubble is not my game, I just made the J2SE port and the J2ME port (microFB) - Red cross is harder to see than a white one... I'll try to make it blink (As I said, I now have some spare bytes  The version -without sound- should be available next Monday -- Glenn Sound doesn't work properly here anyway  (Java1.5_04, Win2K) The first time it plays, it sounds fine. 2nd time there is a little static, but no audible sfx, Every time after that you just get silence.
|
|
|
|
Myself
Senior Newbie 
Java games rock!
|
 |
«
Reply #11 - Posted
2006-02-09 21:42:23 » |
|
Sound doesn't work properly here anyway  (Java1.5_04, Win2K) The first time it plays, it sounds fine. 2nd time there is a little static, but no audible sfx, Every time after that you just get silence. Arghhh... I tried it on several computers, and it worked fine each time (except that there is a little static after each explosion), I personally use 1.5.0_06-b05 under XP... I'll try to add some notes about sound in the javaunlimited.net wiki as soon as I'll be able to find how to reduce its size (Silence gave me 500 more bytes  )
|
|
|
|
jbanes
|
 |
«
Reply #12 - Posted
2006-02-09 22:07:55 » |
|
The quintessential example of sampled sound in a 4K game is Defender 4000. The key parts of the source code are as follows: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| byte[][] sounds = new byte[3][2000];
int step; step = 10; for(int i=0; i<2000; i++) { sounds[1][i] = ((i%step > 0) ? 32 : (byte)0); if(i%250 == 0) step += 2; } step = 25; for(int i=0; i<2000; i++) { if(i < 500) { sounds[2][i] = ((i%step > 0) ? 32 : (byte)0); if(i%25 == 0) step--; } else { sounds[2][i] = ((i%step > 0) ? 16 : (byte)0); if(i%50 == 0) step++; } }
AudioFormat format = new AudioFormat(8000.0f, 8 , 1, true, false); SourceDataLine line = (SourceDataLine) AudioSystem.getLine(new DataLine.Info(SourceDataLine.class, format));
line.open(format); line.start();
while(true) { sound = 2;
if(System.currentTimeMillis() >= time+255) { line.flush(); line.write(sounds[sound], 0, 2000); sound = 0; time += 255; } } |
The code above will produce very "electronic" sounds, but it's SMALL. You can make the sounds more natural by computing them in a sine wave (I assume you're probably doing this already), but it does cost something in code size. The other limitation is that only one sound can be played at a given time. Any new sounds wait up to a quarter of a second to play and may be supplanted by other sounds. Hope this helps! 
|
|
|
|
Myself
Senior Newbie 
Java games rock!
|
 |
«
Reply #13 - Posted
2006-02-11 22:01:52 » |
|
The quintessential example of sampled sound in a 4K game is Defender 4000. The key parts of the source code are as follows: The code above will produce very "electronic" sounds, but it's SMALL. You can make the sounds more natural by computing them in a sine wave (I assume you're probably doing this already), but it does cost something in code size. The other limitation is that only one sound can be played at a given time. Any new sounds wait up to a quarter of a second to play and may be supplanted by other sounds. Hope this helps!  Here is what I've done : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| byte[] audioData = new byte[10000]; boolean silence = true; for (int i=0 ; i<8000 ; i++) { while(rand.nextInt() % 10 != 0) { audioData[i] = silence ? 0 : (byte)Math.abs(rand.nextInt() % (int)(1. + 63. * (1. + Math.cos(((double)i) * Math.PI / 8000.)))); i++; } silence = !silence; }
AudioFormat audioFormat = new AudioFormat(8000f, 8, 1, false, false); Clip clip = (Clip)AudioSystem.getLine(new DataLine.Info(Clip.class, audioFormat)); clip.open(new AudioInputStream(new ByteArrayInputStream(audioData), audioFormat, 10000)); clip.start(); |
And the result (with JoGa + 7zip) Without sound : 3697 bytes With sound : 4260 bytes I won't use it in the final version, but it should be useful for someone else... By the way, I encountered a strange problem with proGuard... My 'proguarded' code seems to use a lot more CPU than the normal version (5/10% >> 100%)... Is it a common problem?
|
|
|
|
Markus_Persson
|
 |
«
Reply #14 - Posted
2006-02-11 22:04:39 » |
|
I had the same problem with Dachon 4k, so I had to skip the proguard step of the packing.
Of course, that meant I had to manually cut down another 300 bytes. :\
|
|
|
|
Myself
Senior Newbie 
Java games rock!
|
 |
«
Reply #15 - Posted
2006-02-12 22:38:16 » |
|
Updated... No sound, but improved gameplay -see x30ice & darkprophet remarks  -
|
|
|
|
x30ice
Senior Newbie 
|
 |
«
Reply #16 - Posted
2006-02-13 19:18:13 » |
|
Bullet works perfect now. If you could make some space a little improvement on cpu's IA would make it more challenging so on large distances they keep shooting at the same place, missing every shot.
|
|
|
|
Myself
Senior Newbie 
Java games rock!
|
 |
«
Reply #17 - Posted
2006-02-19 09:27:53 » |
|
If you could make some space a little improvement on cpu's IA would make it more challenging so on large distances they keep shooting at the same place, missing every shot.
Updated AI + screenshots (javaunlimited and jws) + web site Source code should be released soon (GPL licence) Have fun  Edit : Source is now available
|
|
|
|
|