Java Tower Defense

Hello, fellow Java gamers, here is the URL to my free online game entirely in Java:

http://www.javatd.com

All advices/comments are welcome :slight_smile:

you can trick the units in to walking back and forth, by selling a building making a new path, then building another one at the other end. and repeating till they die.

When I sold the 2nd type tower it gave me this:

java.lang.NullPointerException
at TD.mousePressed(TD.java:1115)



Pretty cool so far what I played.

Corvinex, did it prevent the tower to be sold? Did it stop the game? Maybe it’s just a sound issue?

Bobjob, you’re right this is a crack in my game that needs fixed. I plan on doing a position LinkedList (position is a class with X,Y) that remembers the position of the built/sold towers and prevents that behavior.
Or should I just prevent towers to be sold during a round? (maybe even better)

Thanks for your comments guys :slight_smile:

in my version i fixed this by disabling, building during a wave.

Very fun, sound is annoying and the background eh. I got to wave 17, then i think i pushed s for sell and it crashed or something. Might of been just a fluke on my end. cool game.

Looks unusual.

Yeah pressing S to sell, then clicking in game caused the exception.

Go to lvl30 or so. Took about 50 min.

The game is not bad, but still can be improved in a lot of areas.

The loading was just a white screen for about 10 min for me.
Once it started the game, it froze a few times loading the images.
But once that was done, then I could play ok. The sounds were slightly annoying and 1 type of monster wasn’t that exciting

Should have bosses, different types of monsters that could be immune to a type of tower

Able to see the monsters hp would be nice too.
I found the Ice tower not worth its money.
Right click should be deselect.
But yeah otherwise not bad
 I would play again if those things were fixed.

Some general observations


  • could do with some improvement on the sound, graphics, and presentation
  • antialias those fonts at the very least!
  • seems to run at a low framerate, leaving it feeling somewhat sluggish

BTW am working on a tower defence game myself right now!

Cas :slight_smile:

Got to lvl 28 or so but then I had spent too much money on freeze towers so it didn’t work anymore.

Towers are very spread in price so you don’t have that many options on what to build
Sound is
 less good
Show the stats of a tower and what happens when you upgrade it so you don’t spend money on unneccessary upgrades

[quote]Show the stats of a tower and what happens when you upgrade it so you don’t spend money on unneccessary upgrades
[/quote]
It does show the stat’s, but it doesn’t show what the upgrade does iirc.

Indeed, I meant the current stats next to the upgraded ones so you can compare them.

[quote]Java Plug-in 1.5.0_11
Utilisation de la version JRE 1.5.0_11 Java HotSpotℱ Client VM
RĂ©pertoire d’accueil de l’utilisateur = C:\Documents and Settings\M-L M


c: effacer la fenĂȘtre de la console
f: finaliser les objets de la file d’attente de finalisation
g: libérer la mémoire
h: afficher ce message d’aide
l: vider la liste des chargeurs de classes
m: imprimer le relevĂ© d’utilisation de la mĂ©moire
o: déclencher la consignation
p: recharger la configuration du proxy
q: masquer la console
r: recharger la configuration des politiques
s: vider les propriétés systÚme et déploiement
t: vider la liste des threads
v: vider la pile des threads
x: effacer le cache de chargeurs de classes
0-5: fixer le niveau de traçage à

java.lang.UnsupportedClassVersionError: Bad version number in .class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
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)
[/quote]
oups


Hi!

It works nice here except that I had to restart the game once to make it work and when I left, I got a NullPointerException in TD.mousePressed(). Good luck.

Thank you for all your comments and inputs, I still have a lot of work to do ;D

For now I’m going to focus on the nullPointer exception that apparently appears when a tower is sold.

Also does someone know why people with macs keep having this mistake “bad version number in .class file”?

Also on my to fix list: better backgrounds, different kind of monsters with resistance to certain towers, maybe a new raw of towers (3 new towers to smooth the huge price difference).

Thanks again for helping me!

ME TOO!!! ;D

Bahh


So here is what I did:

  1. You can now see the characteristics of the upgrades
  2. There is a limit in the build/sell per round (4 of them)
  3. You can now enjoy 4 different monsters, detailed in the “monster” section of the “game” explanation page: common, solid, magic and boss!
  4. Also there is a “tip” section in the “game” page

Don’t forget to check the keyboard shortcuts: you can turn down sound with ‘m’ and display the monster’s hitpoints with ‘x’

I stupidly forgot to upload the new monster’s pictures. It’s now done they should stop being invisible :wink:

back at home and can test the game again, the good news is that it work fine here and is pretty cool :), the bad new is that the background image look awefull :wink:

nice game