L, the Game (Java, Open Source)

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 7647 Views - Last Post: 01 July 2006 - 10:24 AM Rate Topic: -----

#1 msg555  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 9
  • View blog
  • Posts: 136
  • Joined: 04-May 06

L, the Game (Java, Open Source)

Posted 23 June 2006 - 02:47 PM

"L" is a java applet that started out as a school project for my computer science class. We were told to do an end-of-the-year project and this is what my friend and I came up with. Now that school is out I've stilled been putting some work into it to make better and better. One thing that makes L unique is the fact that there are no images whatsoever. Everything displayed on the screen is a polygon.

L can be played at
http://msg555.sytes....asses/LGame.htm

The source is located at
http://msg555.sytes.net/L%20Game.zip

and the class structure diagram is located at
http://msg555.sytes....ObjectChart.JPG

Documentation (generated by BlueJ) can be found at
http://msg555.sytes....eDoc/index.html

Edit- Fixed the paths above

If you have any suggestions/questions/comments/critisism let me know. If you are interested in adding some content to L I would be very grateful. L was created using JCreator. (which can be downloaded for free at http://www.jcreator.com/) You will need the Java SDK version 1.4 or greater which can be downloaded here ( http://www.google.co...4O5CKpAKmi9WBBA )

This post has been edited by msg555: 01 July 2006 - 10:26 AM


Is This A Good Question/Topic? 0
  • +

Replies To: L, the Game (Java, Open Source)

#2 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 784
  • View blog
  • Posts: 7,613
  • Joined: 05-May 05

Re: L, the Game (Java, Open Source)

Posted 23 June 2006 - 09:08 PM

Um... It fails to load.

Here is the JAVA Console output:

Java Plug-in 1.5.0_01
Using JRE version 1.5.0_01 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Owner


----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
p:   reload proxy configuration
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------

load: class LGame.class not found.
java.lang.ClassNotFoundException: LGame.class
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
load: class LGame.class not found.
java.lang.ClassNotFoundException: LGame.class
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
load: class LGame.class not found.
java.lang.ClassNotFoundException: LGame.class
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
load: class LGame.class not found.
java.lang.ClassNotFoundException: LGame.class
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more



I've got higher than 1.4 (1.5) in the SDK and player so check the problem and tell me what happened.

This post has been edited by WolfCoder: 23 June 2006 - 09:09 PM

Was This Post Helpful? 0
  • +
  • -

#3 msg555  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 9
  • View blog
  • Posts: 136
  • Joined: 04-May 06

Re: L, the Game (Java, Open Source)

Posted 23 June 2006 - 10:35 PM

Well, I haven't been programming in java long, and I certaintly am not familiar with whatever error you're getting. That said, my server log reports that someone tried to access "http://msg555.sytes.net/L%20Game/classes/LGame.htm" after uri decoding. Normally the '%20' should be converted into a space so that you are actually trying to access "http://msg555.sytes.net/L Game/classes/LGame.htm"

I copied the files to http://msg555.sytes....asses/LGame.htm (the old link still works). Let me know if you have any luck. I probably should have made this change in the folder a while ago.
Was This Post Helpful? 0
  • +
  • -

#4 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: L, the Game (Java, Open Source)

Posted 23 June 2006 - 10:52 PM

Both the link and the source code work just fine for me using JDK 1.5.

Would be nice if the ship could rotate 360 degrees, but other than that very nicely done. :)
Was This Post Helpful? 0
  • +
  • -

#5 msg555  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 9
  • View blog
  • Posts: 136
  • Joined: 04-May 06

Re: L, the Game (Java, Open Source)

Posted 24 June 2006 - 08:29 AM

The Player class has the capacity to rotate right now, and at one point during game developement it could rotate but we decided that's not the direction we wanted our game to go in. You're suppose to be traveling forward through space...
Was This Post Helpful? 0
  • +
  • -

#6 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 784
  • View blog
  • Posts: 7,613
  • Joined: 05-May 05

Re: L, the Game (Java, Open Source)

Posted 24 June 2006 - 09:40 PM

Now, the fire buttons don't work and the whole game runs at a crappy speed. It runs at a normal speed and then suddenly freezes for a few seconds in the middle of the game. Very annoying.

The controls are whacky, both my hands crash into each other on the numpad and on the other control setup. Please have a control setup where move is arrow keys and Z is fire, X is bomb, and A/S is switch. That way is much easier to play.

This post has been edited by WolfCoder: 24 June 2006 - 09:43 PM

Was This Post Helpful? 0
  • +
  • -

#7 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: L, the Game (Java, Open Source)

Posted 24 June 2006 - 09:53 PM

those types of errors can usually be solved through threading. with image intense or rendering intense coding threads allow multiple tasks to be completed user side at a single time.
Was This Post Helpful? 0
  • +
  • -

#8 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: L, the Game (Java, Open Source)

Posted 24 June 2006 - 11:14 PM

Played it for a little while, getting good FPS at around 100. Little bit of flickering going on but still very nice.

I like the different types of bullets you get double, triple and of course force field is pretty awesome.

I agree with Wolfcoder, keys should be Z and X for fire controls.

Here is a screen shot running from source files.

Attached image(s)

  • Attached Image

This post has been edited by jayman9: 24 June 2006 - 11:18 PM

Was This Post Helpful? 0
  • +
  • -

#9 msg555  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 9
  • View blog
  • Posts: 136
  • Joined: 04-May 06

Re: L, the Game (Java, Open Source)

Posted 24 June 2006 - 11:32 PM

The freezing is because the classes are downloaded from my server as you need them. So everytime you encounter a new object it has to be downloaded. If anyone knows how I can fix this let me know. I could always make it load them at the beggining...

Ya the controls need help. Luckily, a quick edit to the LocalPlayer class can change the controls easily (in fact their dynamic if i ever got around to making a custom control dialog). Hand clashing isn't the only problem. On my keyboard, I get all kinds of ghosting problems. For example, I can't move down and left while shooting. The biggest problem with changing the controls is accomadating the 2nd player (ideas?). I'll look into this tommorow. (it's 2:30 am here)

I'm not really sure how to solve the flickering problem or what is really wrong. For me it looks fine, but I guess I should mention that I'm running at 400 FPS (assuming not a whole lot going on).

The one thing I still really want is sound. I think it could make the game much better.

-Edit-
I added an option called "Left Trigger" that puts the shot, bomb, and weapons switches in the places WolfCoder suggested. This is a little akward for me to play but it does effectively eliminate ghosting (at least on my keyboard). Only if I am bombing and cycling backwards through weapons can I no longer cycle forward through weapons or shoot.

btw, if you are interested in keyboard ghosting this article explains it quite well
http://www.dribin.or...rd/keyboard.pdf

This post has been edited by msg555: 25 June 2006 - 10:51 AM

Was This Post Helpful? 0
  • +
  • -

#10 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 784
  • View blog
  • Posts: 7,613
  • Joined: 05-May 05

Re: L, the Game (Java, Open Source)

Post icon  Posted 25 June 2006 - 11:04 PM

That's better for the controls.

For loading all the classes at one time, try having a method in each class that simply accesses something from it. Doesn't matter what but call all those methods at game start. I would name them bind() but it doesn't matter.

Here is some pseudo code:
player.bind();
bullet.bind();
bomb_blast.bind();
enemy.bind();



(Probably not the object names you used)

For an array of enemies, you call bind() for all of them. bind() simply sets a variable from the class to itself but you may have to do more.

Try that and see if it works.

Next, the game starts out WAY TO HARD!!! Make it easy with 5 maximum visible enemies at one time and then work your way up to the whole swarm of enemies. It may be easy for the one who made the game because they've played it millions of times, but not for first-timers who have never seen the game.

Nice coding job otherwise, reminds me of Area Flat. (Area Flat looks almost exactly like your game).
Was This Post Helpful? 0
  • +
  • -

#11 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: L, the Game (Java, Open Source)

Posted 26 June 2006 - 02:45 AM

You could jar all your classes, so they are downloaded together - and needs less bandwidth, too.
Was This Post Helpful? 0
  • +
  • -

#12 msg555  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 9
  • View blog
  • Posts: 136
  • Joined: 04-May 06

Re: L, the Game (Java, Open Source)

Posted 26 June 2006 - 04:24 AM

I added a loadClasses() method to LGame that simply calls the size method on every sprite's "all" set. Every class that derives from Sprite has a static "all" Set that keeps track of every instance of that object. It seemed to make me download all the classes but since I'm playing locally I can't see if it fixed the pausing.

Quote

You could jar all your classes, so they are downloaded together - and needs less bandwidth, too.

I'm not really sure how to use or make jars :/

Quote

Next, the game starts out WAY TO HARD!!!

Sorry about that

Quote

It may be easy for the one who made the game because they've played it millions of times

It sure is... I can actually play forever. The way the Level ojbect works right now makes it so the waves actually get easier after wave 12 or so. You have to use the FlakCannon during the hardest waves to kill the pentagons and the Splitter generally works well against the Boss stage. When you get up to the higher waves you get more powerups (assuming you are killing more enemies). I've actually made it through the hardest wave invincible.

One thing is clear, the Level object has to change. It needs to be easier at the beggining, and (since this is suppose to be a high score game) grow to become impossibly hard.

Also, I think I fixed the flickering problem by lowering the thread priority and removing the call to Sleep. Let me know if you guys are still having problems with flickering.

This post has been edited by msg555: 26 June 2006 - 07:27 PM

Was This Post Helpful? 0
  • +
  • -

#13 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 784
  • View blog
  • Posts: 7,613
  • Joined: 05-May 05

Re: L, the Game (Java, Open Source)

Post icon  Posted 26 June 2006 - 09:03 PM

You've fixed the freezing part and the game is much easier too.

But it's so easy, if I hold down the fire button and move randomly, I turn into this blazing red tornado and become invincible MWHAAHAHAHAHAHAHAHAAAAAAAA!!!

Make those red tornado things 1000 times less frequent. Then the player has to actually dodge the enemy.
Was This Post Helpful? 0
  • +
  • -

#14 msg555  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 9
  • View blog
  • Posts: 136
  • Joined: 04-May 06

Re: L, the Game (Java, Open Source)

Posted 26 June 2006 - 09:34 PM

The "Red Tornado" is actually the shield. I was messing around with it earlier today and I forgot to change it back. The Shield power up appeared with 100% frequency. I changed it back to the original 3% probability. Btw I made the radius of the shield random (30 pixels to 200 pixels with a scew towards 30 pixels) and the degrees of protection it covers random (PI halves to 2 PI with a scew towards Pi halves)

This post has been edited by msg555: 26 June 2006 - 09:35 PM

Was This Post Helpful? 0
  • +
  • -

#15 WolfCoder  Icon User is offline

  • Isn't a volcano just an angry hill?
  • member icon


Reputation: 784
  • View blog
  • Posts: 7,613
  • Joined: 05-May 05

Re: L, the Game (Java, Open Source)

Post icon  Posted 26 June 2006 - 10:11 PM

The first applet was too hard.. The second applet was too easy.. But the third applet was just right!
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2