[java] DarkFighter JAVA scrolling paralax shooter source

Started by
6 comments, last by David_Beoulve 23 years, 6 months ago
DarkFighter (JAVA) Okay guys, this is a Sun-Java game I have been working on off and on since late last year. In it, you will find a complete working game including source code. The game has sound effects, though the music is too large to upload (WAV). DarkFighter allows you to control your ship with a mouse (the fighter will follow it). Enter or CTRL fires. Hold down for maximum cheese. The game attempts to judge how well you are doing, and increases or decreases the difficulty level accordingly. Being a shooter, it's ultimate goal is to kill you, but to make sure it's a challenge, rather than a slaughter. So far, it seems to play well. Friends keep trying to get a higher score, for some reason. You can download the game and source here (head to the PLAY section, relatively quick loading)... http://www.shila.com/DarkFighter/index.htm MY PROBLEM IS THIS: Currently DarkFighter (JAVA) only runs with Sun's Java Appletviewer, and will not run in Internet Explorer or Netscape. If I could compile the code in Microsoft J++, that should fix it, however, the game uses graphic code not found in J++ (actually, same concepts, different procedures). Can anyone help me fix this? To run the game, as the website says, you'll need Sun's Java Development Kit (posted as well). Any and all help and comments would be greatly appreciated! Disclaimer: Yep, it's all one source file, and it's not really parralax but a star field full of particles. DarkFighter I was a GWBASIC game, as was DF2. DF3 was QuickBasic and used vectors and blocks. Source and EXE lost. DF4 was also QBASIC, never finished because DF5 was created in C++, which was never finished due to a lack of sound. DFJAVA is the one you see here. It may crash, but JAVA shouldn't blow up your PC. ------------------------ How dull it is to pause, to make an end, To rust unburnished, not to shine in use! Edited by - David_Beoulve on 9/24/00 8:17:50 PM
How dull it is to pause, to make an end,To rust unburnished, not to shine in use!
Advertisement
This is an often asked question (to the FAQ jerry?)
but here goes,

Netscape and Internet Explorer only support java 1.1, so you have probably used some feature only part of of java 1.2 or java 1.3. For instance, you cannot use Swing components in browsers.

The general solution is:
1. To rewrite your application to Java 1.1
or
2. Require your user to download the Java 1.2/1.3 plug-in from SUN and use the free html-converters to turn your web-page into a format that supports the plug-ins. But,.. plug-ins are not portable so if you go for this solution then your program will only work on very few browsers.

If it only is a matter of missing classes you can pack those classes in your jar file on your web site. But be warned some of those classes are very big. The swing package used over 1MB of space. That is a *very* large appliet to download - I know that I would not wait for it.

Jacob Marner
Jacob Marner, M.Sc.Console Programmer, Deadline Games
I shall place it into the FAQ today : )
Of course no browser is going to support it if you just use an applet tag. Run your html throught the applet tag converter. Ya know, some of us might actually have the Java Plugin (shocking, I know).

Also, why is that people feel the need to distribute their java programs in .exe files? It could be just me but i''m going to assume that they aren''t going to work under linux. Is there a general fear of .jar or .zip files in the Java developer community?
Okay, yes, I have been informed about Swing code. Good notes all. It appears I''ll just have to sit down and fix the darn thing somehow.

Jim, they don''t teach us cool things in college. What is an applet tag converter? Or where?

At any rate, can anyone spot what''s going on in the code that is 1.2 specific? Anyone have any suggestions?

How dull it is to pause, to make an end,
To rust unburnished, not to shine in use!
How dull it is to pause, to make an end,To rust unburnished, not to shine in use!
quote:Original post by David_Beoulve

At any rate, can anyone spot what''s going on in the code that is 1.2 specific? Anyone have any suggestions?



Just took a quick look at the applet on your site and it fails to load with a complaint about missing the javax.swing.timer class.

If you are using Swing, then users will need the plug-in.



- Hodglim
Homepage
- HodglimHomepage
The applet-tag converter is the same as the html-converter available from Sun''s site. It converts a html page with a normal applet tag to one that explicitly invokes the java plug-in.

And as said, the important difference between Java 1.1 and java 1.2 is the Swing classes. So if you can get rid of all the Swing references from your code it will most likely run. Also if you are using any standard extensions such as java2D - they are not available in browsers - you have to stick to the core API.

To see if you need to change more after that, just run it in a browser and it will give run-time errors or class-load errors if you use some feature not suppoted in 1.1.

My personal opinion is to avoid the plug-ins if you want most people to use it. Plug-ins only exist on a few platforms and I have had machines (I worked as an IT administrator once) that could not run them (don''t ask me why.)

Java 1.1 is only supported from IE 4 and netscape 4.5. If you want to support even older browser revert to Java 1.0 but I think most people has these browsers so I usually go for Java 1.1 - The AWT model is much better there anyway.

Jacob Marner
Jacob Marner, M.Sc.Console Programmer, Deadline Games
I have java 1.3 but your game doesnt run because it wants 1.2. Wierd problem.

-DeVore (who''s not going to uninstall 1.3 so he can install 1.2)

This topic is closed to new replies.

Advertisement