Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Worms 4K!!  (Read 4108 times)
0 Members and 1 Guest are viewing this topic.
Offline 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=90

it's a worms clone in 4K! Cheesy it lacks AI but works pretty good as a multiplayer

great job whoever glenn sanson is!

edit: oops there is AI!
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« 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. Smiley

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.

Java Game Console Project
Last Journal Entry: 12/17/04
Offline Markus_Persson

JGO Wizard


Medals: 15
Projects: 19


Mojang Specifications


« Reply #2 - Posted 2006-02-08 15:16:54 »

wow

Play Minecraft!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline f.l.x

Senior Member


Projects: 3


there is no place like 127.0.0.1


« Reply #3 - Posted 2006-02-08 15:41:47 »

 Shocked

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Offline DonaldEKnuth

Junior Member





« Reply #4 - Posted 2006-02-08 17:58:30 »

Wow! Nice game!  Grin

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.

My 4k 2006 Entry: Sokoban4k
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


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

Java Game Console Project
Last Journal Entry: 12/17/04
Offline 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
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #7 - Posted 2006-02-09 00:55:15 »

Nice!

Offline 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 Wink

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 Wink

The version -without sound- should be available next Monday


-- Glenn
Offline darkprophet

Senior Member




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


Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Anon666

Junior Member




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 Wink

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 Wink

The version -without sound- should be available next Monday


-- Glenn

Sound doesn't work properly here anyway Wink (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.
Offline Myself

Senior Newbie




Java games rock!


« Reply #11 - Posted 2006-02-09 21:42:23 »

Sound doesn't work properly here anyway Wink (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 Wink )

Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« 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];

            //Generate some sounds!
           int step;
           
            //Laser
           step = 10;
            for(int i=0; i<2000; i++)
            {
                sounds[1][i] = ((i%step > 0) ? 32 : (byte)0);
               
                if(i%250 == 0) step += 2;
            }
           
            //BOOM
           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++;
                }
            }

            //Sound Support
           AudioFormat format = new AudioFormat(8000.0f, 8 , 1, true, false);
            SourceDataLine line = (SourceDataLine) AudioSystem.getLine(new DataLine.Info(SourceDataLine.class, format));

            //Start the sounds
           line.open(format);
            line.start();

            //Main Loop
           while(true)
            {
                //Set the sound when an event happens by setting the variable
               //"sound" to an index inside the "sounds[][]" array. Each sound
               //is a 1/4 of a second clip. (8000 samples per second.)
               sound = 2;

                //Play the sound
               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! Smiley

Java Game Console Project
Last Journal Entry: 12/17/04
Offline 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! Smiley

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?
Offline Markus_Persson

JGO Wizard


Medals: 15
Projects: 19


Mojang Specifications


« 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. :\

Play Minecraft!
Offline 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 Wink-
Offline 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.
Offline 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 Wink

Edit :
Source is now available
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (45 views)
2014-09-23 14:38:19

radar3301 (27 views)
2014-09-21 23:33:17

BurntPizza (63 views)
2014-09-21 02:42:18

BurntPizza (33 views)
2014-09-21 01:30:30

moogie (41 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!