Resolved some Java generics crap (not the way I wanted, but the way I could) with Eclipse 3.2 and JDK1.5.0_09 (wasn't ecpecting this becuase it worked fine on Eclipse 3.1.1 with JDK 1.5.0_07)
Changed the damage to act as a damage rating (from 0 healthy to >= maxDamage == dead)
Renamed Alive.java and the class to Health.java
Changed lifeTime like variables to reference duration instead so it make more sense to the average person (and me)
Change the Hp to damage and MaxDamage
Improved the setX and setY members in Move to remove loops
Added Javadoc to all classes, methods, members, and enums
Removed static media references from Sprite, since they are now correctly initialized statically in Media.java
Replaced System.exit(0), to close the frame, with frame.dispose(); and frame = null;
Removed all synchronized modifiers from methods since they seemed to cause freezes at some point or other
Synchronized on keymap since it was the only location that I could find that was ever regularly causing synchronization problems
synchronized just enough methods to remove last easily found ConcurrentModificationExceptions
Split security checking and perform once for each item at the beginning
Updated html files
Updated to XHTML1.1 STRICT
Combined the Applet.html and ReadMe.html files. (Leaving Readme.html for online instructions in webstart.)
Using css for formatting
Corrected the problem while checking security for the user.home property during keymap loading
Corrected freezing of Javoids when a synchronized method asked for input (removed synchronized from start())
Finished altering code to use generics better (all to make collision detection easier to read/maintain)
Altered formatting of block comments to hepefully preserve formatting using /*-
Explicitly use valueOf methods to avoid unnecessary object creation
Used String.format and System.out.printf to perform formatting of externalized strings
Externalized strings as much as possible. restored some that were only one character (Left some in KeyMap because they are related to kays that can be pressed and I want to know that)
Turned on almost all error settings and using @SuppressWarning("unused") to mark unused paramaters. Only passed because they are required for the Action Listeners etc
Added more javadoc to source code for better documentation and more code review
modifyLives in Health.java was returning the number of hp not the number of lives (corrected)
Version 1.043 :
Converted most html files into XHTML strict or XHTML strict frameset.
Simplified centering of progress frame when initially loading (displays before main frame opens).
Corrected odd bug when using SAX.
Pass a URI to parse method instead of getting my own stream (problem went away -- issue with buffering).
Corrected image problems with Item.xml after its initial creation.
Changed from using toolkit to read images to ImageIO.read.
Changed back because ImageIO.read returns a buffered image that does not animate (animated gifs).
Simplified build and made the build.xml file more useful (not compiling every time now).
Version 1.042 :
Corrected bug that prevented any weapon from being selected if one of the weapon selection keys was pressed when the corresponding weapon was not present.
Cleaned up KeyMap types a bit (shorter but equally descriptive name) and removed some unnecessary code.
Version 1.041 :
Resolved problem with MulTIGUN4 and up when user clicks on image in ammo panel.
Simplified KeyMap code to reduce memory use and complexity (big time).
Fixed display a bit more to better display the ammunition panel.
Version 1.040 :
Removed Mnemonics and accelerators for Help Menu items (other than main menu item's values) to deal with duplicates.
Cleaned up code and made more generic for setting values in dialogs (JOptionPane).
Added a Volume Control. Setting the master gain (per clip rather than by mixer) seems to work now that the other sound bug is fixed.
Replaced text 100/300 for instance for shields, bonus and health (Hp)
Version 1.039 :
Sounds no longer screwed up as of JDK 1.5.0_01 (Sun error).
Corrected a new "ship not centered on startup bug.
Corrected new (and all) shields taking damage while area checking is enabled and when the shield does not cover all of the ShieldedSprite.
Corrected some code to create colors for Javoids (occassionally failed).
Made new shield types (lines around ship in different shapes).
Collision area checking now works even if one oject uses an image for display.
Corrected drawing to use correct scale.
Corrected bonus so that it resets correctly when a new game is started rather than using the last value.
Corrected rotation of shield so that it remained constant even if the owning sprite is turning.
Changes to earlier code corrected occasional bug that let default weapon fire more than 5 times.
Correcting getMultiplier and other drawing functions due to code corrections and simplifications.
Update code to take into account more compiler options in Eclipse and JDK5.0_02.
Clicking on the toolPanels works again (and better). Mouse Move is also improved and working again after a few minor changes to KeyMap to restore one container only used by the mouse.
Sun seems to have changed the behaviour of "ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);". The tool tips now display properly again.
Corrected minor bugs related to Weapon/Item separation.
Resolved exceptions for PowerUps and when adding items now that the class change is mostly complete. The new HashMap() constructor is a shallow copy so I made a deep copy method to resolve this and other bugs.
Corrected a bug in the redisplay of the application after either the width or height is changed (but not both). This was discovered near end of item rewrite. Excellent.
Immortal items are no longer dependent upon having MAX_INT number of items.
Deleted Tool.java (redundant and messy).
Renamed JavoidsMedia to Media.
Renamed JavoidsShapes to Shapes.
Created ItemLoader.java to load item.xml and store Items in a HashMap.
Created items.xml to store weapon information.
Made item class to replace the tool class. Made weapon class that extends tool to have common functionality in Item class.
Corrected code to compile with -Xlint with no warnings or erros.
Cleaned up some more constants.
Corrected a loading problem for KeyMaps (it was not loading the file from the user's home directory but the directory where the jar file was).
KeyDialog now loads user values correctly without having to use the file menu to find a saved map.
Corrected deep copy of KeyMap that stopped working in Javoids!1.038 (or maybe earlier).
KeyMap was being loaded with initial default values and not the user's key map. This was corrected.
Using threads to save and load KeyMaps.
Corrected an issue with double loading of keymap.
Using more typesafe enums for KeyMaps.
Cleared up code greatly for KeyMap (it's a lot easier to follow now).
Shields, Mines, and PowerUps occassionally rotate now.
Corrected a bug introduced that occassionally led to a NullPointerException.
Now using some generics and more enhanced for loops.
Used type safe enums (replaced int constants). Used enhanced for loop when possible after replacements.
Used import static to get rid of "Debug." now that Eclipse supports it correctly. (code easier to read).
Confirmed that Sun's bug ID# 5085008 is the cause of any problems with sound while running JDK1.5/1.6 or JRE 5/6.
Made pacman game work with static variable rather than an instance variable to save on memory (make constructor simpler too).
User Keymap was not working/loading correctly after some tables were split in KeyMap.
Version 1.038 :
Added Level to high score table
Corrected bug for colors vector (JDK issue?)
Corrected missing afterburner for up action (don't know when this went missing)
Version 1.037 :
Added duration of game to high score (requires deleting or editing old JavoidsHighScores.properties file and adding |00\:00\:00\:00 to every entry)
Corrected bug with maximum number of lives (finally found it)
Add duration to high score table
Added play duration to game
Got rid of unnecessary constants and replaced with funtions (immortal,ageless)
Updated Applet.html to use j2se1.4.2_05 only and to work with all browsers and platforms.
Version 1.036a :
Updated the Javoidssnapshot.jpg
Updated the readme file
Corrected a mistake in the version file for 1.036
Version 1.036 :
Added code to always display the mnemonics on Windows 2000, XP when the ALT key is pressed
Added more checks for insufficient security levels for reading/writing the high score in an applet
Reduced the repulsion force of gravity sources
Added a check for reading/writing the high score file when Javoids is loaded from an applet
If parameters in html are not set correctly, set all of them to the defaults
Corrected a bug that made sprites with shields 10x more effective at attracting/repelling objects if they were gravity sinks/sources or homing
Reduced speed of gravity/homing
Reduced the number of afterburner charges so that they will need to be conserved and the regular thruster will have to be used occasionally.
Potential problem with the sounds turned out to not be a problem (the sounds crackled because the subwoofer was off). There are only problems when many sounds playing at once - otherwise everything is fine.
Version 1.034 :
Corrected a display problem when activating the easter egg
Only make/activate certain timers when they are needed
Implemented a high score table (if missing it will create a default table) that is stored in the user's home directory
Implemented a bonus timer
Adjusted spacing for score information so that the first character is easier to read
Removed the ability of enemy ships to easily fly around black holes
Version 1.033 :
Reduced the maximum number of Javoids to 250 to free up memory. I can't seem to survive more that 100 or so at a time so 250 should allow room to grow.
Fixed the javoids everywhere effect:
Corrected the explosion code to make the Javoids at most 80% as large as the creating javoid.
Reduced the number of Javoids created when they explode.
Corrected problem with ultra-tiny javoids appearing.
Backed out change to allow afterburners by enenmy ship. It was too noisy and it doesn't work correctly yet.
Version 1.032 :
Released Javoids under the GPL license
Updated the html files to use CSS and added License.html
Added copyright notice to each file
Other ships (not the player) can use afterburner 20% of the time
Corrected position of Paused and Game Over text
Added an error message popup when initially loading before window created. (jar file missing files)
gravity point sink not destroying each other or white hole (white hole pushed black hole away) - fixed
Version 1.031 :
Made gravityPlane points visible, but partially transparent. It was just way to difficult to play with them invisible.
Altered gravityPlanes to disappear when a level is completed (they were staying too long making game unplayable).
Made the height of the keyboard editor just big enough to house all of the key buttons.
Altered the keyboard editor size for the numberpad’s plus and enter keys to make them more like a real keyboard.
Version 1.030 :
Changed the string table for keyboard editor to many buttons so each one could be sized nicely (like the sapace bar spanning several columns). It looks much better now. I have learned that Layout managers have their use, but sometimes you just need to position things by an (x,y) location and they don’t let you do it.
Corrected a bug in keyboard editor that tried to allow actions being assigned to blank keys.
Created a keyboard editor (basic 104 key layout), save/load keyboard property files to store and load the setup.
Finally resolved the larger than normal drawn sprites bug. Don’t set a sprite’s size above the MAX_SIZE.
Added TextLoader as a generic class to load readme and version files (can be reused elsewhere).
Added ImageMap and SoundMap classes to use threads to load the files and store a static copy
Made changes to the code to recompile in JBuilder.
Dropped the idea of using Java 3D until I can find a good book!
Version 1.029 :
Created gravityPlane that forms an arbitrary line on screen
Created gravityPlane (x or y axis, circle, random points - not really a plane eh!)
Changed super class of Singularity from Sprite to GravityPoint.
Created GravtiyPoint class to make a sseries of points that can attract/repel the objects. Gravity points are immobile.
Drawing animations for explosions etc? Too slow right now. Need to research this when time permits.
Made media files load in four separate threads (nice experience).
Changed the number of AfterBurner units assigned since it was way more than needed and often lead to games of afterburner only movement.
Version 1.028 :
Made Javoids take on the shapes/colors of their parents when they explode (like breeds like).
Added clip to drawing code. I think it speeds it up a bit - nothing terribly noticeable on my computer.
Limited the shape of shields for ships to exclude Javoid shapes and any newly added shapes.
Made Javoids of irregular shape along with the brown circles; each only occurs a fraction of the time.
Added a menu option to enable/disable Area based collision detection. It works fine as is until many of the sprites have areas such as shields.
Added code to do collisions when one spreite overlaps the edge of screen.
Made possible to have collisions between areas rather than circular areas. Much nicer but CPU and memory intensive. Disabled for now.
In version 1.027 I removed the item listener for the menu. When the menu was mouse activated it didn’t pause the game. Code from a previous version was added/modified slightly for addItemListener - problem resolved.
Version 1.027 :
Cleaned up menu creation greatly thanks to using actions and a loops to go through all of the JMenu and JMenuItem components and setting their preferred size etc. Removed all Menu creation helper functions - all unncessary now.
Removed Halo class for singularity since it can now be drawn as a multi-part area! This is a much nicer solution.
Created a lunar lander type shape that is used sometimes for ships.
Created sprites with true multi-part areas. As a result I was able to compile shape drawing in one class, create it once at the beginning and scale it when making a new sprite. This is some what faster.
Fixed the problem with having to press excape twice to get out of the menu. In windows if you hit alt and a menu key like ALT-F it brings up the file menu. After pressing escape the file menu closes but the file menu option stays highlighted. By using fileMenu.addMenuKeyListener(this); and doing the unpause code there it only has to be called once. Oh, Sun was great again because setting the menu key listener for one JMenu sets it for them all - brilliant! (not)
Finally fixed problem with menu not displaying. Made requestFocus go to gameCanvas instaed of applet. Poof probelm solved.
Due to use of action objects removed helper functions to create menu items and checked menu items. Much nicer.
Cleaned up when timers should start. Timers should not be restarted once stopped/paused if the game is over or the first game has not been started.
Made popup menu that uses action objects (easier to code in the long run than multiple menu items).
Added shields that take on a random shape for each instance (filled circle, empty circle, triangle, square, pentagon, hexagon and star ).
Fix super big ship showing up outside confines of shield. This was a scaling and drawing problem - wrong coordinates for sheild and triangle.
Some enemy ships show up as red triangles now (until multipart shapes are completed).
Combined methods for drawing shapes and images!!! finally!!!
Figured out what was wrong with my drawing code by starting from scratch drawing, rotating and scaling two squares. This has been driving me nuts!!!!! But it’s done!!!
Combined DrawnSprite into Sprite. This way I could have any Sprite have an Image or Drawn representation.
Created ShieldedSprite - sprite with shield. Had to be uncoupled from Sprite so that DrawnSprite and Sprite could be merged. Now a Shield is a Sprite too.
Drawn sprites and drawing animations for explosions? I’ll give it a shot.
Problem with shield being in sprite as default. massive problems. (tried and failed once)
Version 1.026 :
Since finished testing more, reset default chance to have a singularity move.
htmlConverter no longer required!!!!! Sun finally listened!!!!!
Things to remember about converting with htmlConverter.jar:
htmlConverter has a bad habit of mixing and matching width and height parameters, check them after converting (width=500,height=628)
Prevent massive javoid creation when singularities are on screen (unable to discover problem for months)
This is caused by Javoids being close together when exploding and being hit by bullet still alive. Bullet then destorys those javoids and poof you have way more than 4.
This problem was resolved by making the exploded Javoids move apart after they were created.
Altered gravity code to remove some fluff that made black holes not as nasty (they should be) - hint play full screen mode.
Added all main class creation code into a protected box to help detect errors.
Sun finally fixed the virtual machine for IE and Netscape so only the APPLET tag is needed no stupid javascript
Start Button now gets initial focus
Corrected SpriteVector class that prevented massive number of explosions from being removed when needed.
Made game display Javoids, version number and press start button message rather than just beginning the game.
Added option to turn sound off
Played around with the sound API, but found JApplet play(sound) was easier to use and worked better.
Version 1.025 :
Removed media tracker because it was useless and images[n] = applet.getToolkit().getImage(url); worked better with less coding.
Picure loading interruption still happening, but not as bad. This turns out to be a long running (3+ year) problem for sun in that they can’t seem to consistently load small animated GIF files. Animated GIF file removed and replaced with a static gif file. It works. Go figure.
Corrected problem of not changing focus to game after new game button pressed.
Fix problem with interruption when loading image using appletviewer. Now, the game will keep trying until an image is successfully loaded. Don’t worry about the try number.
Version 1.024 :
Fixed a problem with the automatic firing code -- it wasn’t firing!
Fixed problem of no sound for afterburner or thrust after first time used with mouse move or from took bar.
Changed buffersize in JavoidsMedia to 32767 and increased load speed further (time to allocate memory??)
Reduced load time of Version file by 97% by changing buffering method to 65535 byte chunks rather than a line at a time.
Reduced load time of Readme file by 77% by changing buffering method to 65535 byte chunks rather than a line at a time.
Due to memory allocation problems that are only associated with the applet viewer and IE, I am no longer supporting or dealing with these problems. I will only continue to develop this as an application.
Version 1.023 :
Described all of the elements in the game as done in the html in the readme by combining both files.
Updated the readme file and html with more instructions about the available keys like up for afterburner.
Added ability to load the readme file and Version file as html and allow hyperlinks.
Change due to JDK 1.4
changed MakeJavoids.bat to compile *.java and reduced compile and jar times by 86%!!!!!!!
Jar creation reduced by 2 seconds by removing verbose switch
Corrected some uses of Ship ship = (Ship)ships.get(0); to use the initial shipPlayer that’s assigned when newGame
This removed some unnecessary calls and cleaned up some code nicely
Changed main drawing surfaces to VolatileImages to use hardware acceleration.
Added Space key to start a new game (works in both default and my user key map)
Altered the focus so it starts on the applet not the start button to "unfix" the code after Sun fixed some focus issues
Version 1.022 :
Corrected display of score etc when game over.
Added menu options to view readme file and version file
Again setCaretPosition... so obvious the people at sun should look at Borland’s help, components and methods...
Added function to Tool to get Shielded Image, Homing image, shielded homing Image
Made icons for the shielded and homing versions of weapons
Made number of Javoids increase based on the difficulty
Version 1.021 :
Reconverted html for JRE 1.3.1
Added difficulty levels. Player’s shield runs out faster, enemy ships fire more frequently and things spawn faster.
I never changed this comment "automatic move sprites, not just ships"
They were set up like this for a few versions now
Changed size of some weapon images to make them easier to see
Corrected random shield move when jumping; darn cut and paste methodology. ;)
Catch NullPointerException in Paint since it’s only fired now when closing applet/application
Version 1.020 :
html does not work for Netscape again... html not modified so I think the locking bug was nailing it every time it was loaded in Netscape 6.0
Prevented Explosions from remain after your ship blows up the last time.
This was caused by code to keep adding explosions for player even though game over in detect collisions
Added a check to make sure sprite is not player before creating explosion.
Changed isRemovable() to isPlayer() since it made more sense
Made afterburner and thrust sounds only play when the afterburner/thrustkeys are pressed, released and pressed again
Made weapons selectable by clicking on them!
Added homing/shielded text to tooltips for weapons
Fixed the display of the tooltips. Again it pained me to find out how to get the tooltips to display. It was incredibly obvious that I had to call ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); To have them not interfere with the Canvas and it’s great how the name changed from setDefaultLightWeightPopupEnabled in JPoputMenu to setLightWeightPopupEnabled in ToolTipManager
Rearranged functions in Javoids.java to match contructor/main/init/start/stop/events/get/set/use order
Must have all components visible to size correctly. Labels set to visible for resizing.
Removed Destroy method since it wasn’t being called.
Changed default to use my default keyboard layout
Prevented lockups by making most functions in Javoids synchronized and moving some code to update the information and ammunition when painted. Paint messages can be compressed so it is not necessary to update it every few milliseconds. Don’t make run synchronized! This bug would prevent proper starting of application.
Corrected images to have transparent backgrounds
Removed some unneeded setSize calls
Corrected initial x,y position etc in applet, conflict with BasicFrame
Reworked resize code by making frame and applet static
Could then access frame and resize it when applet resized
Nolonger need interface for min/max sizes since it’s only in the applet and html
Corrected initial y position etc in applet, must be insets issue for fram in application
Weapon and bullet can now use two different images
Selected weapon no longer says selected, but the weapon image and the amount are surrounded in a border to highlight the weapon being used!
Made some new icons for the tools not just weapons
Infinite ammo shows up as infinity symbol
Converted Ammo Label into a panel and add labels (1/weapon) with images for the weapon
Selected weapon now says selected
Corrected shield movement to match ship’s after a flip. Had written setDirection(int n) instead of double
Created screen object in constructor to prevent null pointer exception in paint when run as applet
Explosions from ship where not being consumerd by black holes.
Made html work with JRE 1.3.1?
When using incorrect version of JRE, dialog opens to allow you to install the correct version
Corrected link in html to JRE 1.3
Version 1.019 :
White holes produce Javoids some times.
Fixed html to work with all browsers and platforms (JDK1.3.1RC2)
Version 1.018 :
Replaced Default/User keymap menu item with a checked menu item and a keyboard bitmap!
Added stack trace to everywhere I currently catch exceptions
Changed Fire class into Bullet class
Changed for-loops into iterators in detectCollision
Simplified code (bullets not belonging to ship so they could be done once per javoid etc rather than for every ship)
Created function restoreShips to perform ressurections at end, rather than when the ships die
Created function createExplosions to create all of the explosions for the sprites in a SpriteVector using an iterator
Overall effect easier to read code, simpler, faster (need to look at it more though)
Added way to limit fired bullets now that fires have been removed (decoupled from) ship objects
Add Fires to fires (a SpriteVector) then no calls to ship.getFires() etc.
Changed size of Omnipotante bullets to be smaller and changed the image to a missle (loooks cute)
Bullets not attracted to parent object anymore fires don’t home in on firing ship
Homing code working for bullet less than 1/2 screen away and top right of sprite finally
Actually fixed in 1.017 but that was the most unstable version I ever put out. sigh.
Added gravity info to PowerUp and Ship toString functions
Halo and shield now being affected by gravity again (since change to a new Move object for them
Made a setMove using a new move to alter the move of the halo and shield easily
Shielded bullets were travelling too fast, the shiled shared a move object and thanks to a recent change the shield was also accelerated (using same move) making it go much faster than it should have.
Added repulsor shield (anti-gravity) and attraction (cursed) shield to power up
Incorporated actions into ship to avoid using ship.everything
Added comment to html about jumping out of blackholes
Made mouse functions add to KeyMap to use actions for multiple mouse actions per cycle (instead of fire or thrust)
Add toString method to all classes
Added as much of addFires to Fire.spawn(directions...) and changed addFires to spawnFires
Last change to DrawnSprite cause oops in Ship.applyPowerUp, didn’t reset shield’s move to ships.
Version 1.017 :
Mouse move - right click does thrust, left does fire
Home on mines if they are available, else home on javoids
Accidentally broke homing code by homing in on ships after javoids. This always made the homing bullets follow your ship since it was the closest ship.
Fixed shield thickness finally.
Fixed drawn sprite to work correctly. It would only work when positioned statically. When the drawnSprite was moved or resized, it would not draw in the correct location.
Improved gravity code for gravity sinks and sources (looks much more realistic)
Prevented ship from making thrust sound when accelerating due to gravity
Made BlackHole class into Singularity class to add white holes, only black holes grow
Gravity fixed for black holes (hope it didn’t break homing) Change made to getQuadrantM for first two main cases when Mobius effects in play.
Combined keys with keymap since they fit together so well, added some nice helper functions
Added ship to MouseMove menu item, replace with a mouse?
Made MouseMove capable of being turned off
Added code to move and shoot with mouse (it’s not perfect, but it works)
Added code to enforce capacity of SpriteVector is obeyed (can’t easily prevent initial addAll over the capacity, but trimToSize clips off the extra objects
Blackholes can destroy other black holes and increase in size by 1
Made moving black holes and added a chance that they are stationary.
Changed homing and gravity functions to operate on "this" sprite vector and another, name change too
Added UP key as an afterburner
Removed target code from SpriteVector and put it into Common which is now dependent upon Move
target code now also usable in mouse code in Javoids with less duplication
Stopped sound when pausing
Noticed when pressing alt or selecting menu item it was not pausing with the pause function, it was just using isRunning = false
This is bad since if need a timer stopped it wouldn’t be stopped, this explains large quantities of powerUps while pausing a game and then continueing (explains why it didn’t happen every time)
Created JavoidsMedia class for loading the media (might change this later to pass an array of files to load)
This makes Javoids look better and groups similar code in JavoidsMedia
Made a function in Ship class to select the best weapon
Changed code in useAutomaticGun to use this function
Added a call to this function for when the player does the select best weapon action
Version 1.016 :
Replaced isGamePlaying (not needed since isRunning works just like it) It was an added bit of complexity that at one time I thought it was needed, but in actuality only the order of some things had to change. Removed more useless code related to this.
Made helper functions for creating the damn menus createMenu, createMenuItem, createMenuBar
BlackHole objects grow when other objects enter them
Changed Cursor to crooshairs (planning for mouse control of ship)
Pausing while game over by pressing the alt key does not let them press p to unpause Arg, I wasn’t adding this as the mouse listener to the labels and menu items so it would only unpause under certain circumstances (same for key listener);
Changed location of getKeyBindings to KeyMap class since it fits much better there, just pass it a URL now
Version 1.015 :
Escape key will correctly (again?) start the game after being paused when the alt key was pressed
Used to have to press the alt key twice for the game to unpause.
Fixed problem of game over and paused messages overwriting each other when the game is over and paused to display the menu.
Removed some screen flicker when switching back and forth between menu items
Minimize/Restore window code (only useful when application)
Must add applet as the KeyListener for the frame, otherwise only the frame is getting the keystrokes
Added Icon Image for when program is run as an application.
Version 1.014 :
Added ability to change the color of ghosts and allow the pacman to eat them after eating a powerpill
This lasts for 20 seconds or until the next level
Added ability to eat the fruit (mines)
Since speed has improved somewhat, I have reinstated the 36 * 5 shot Omnipotanté
Added setPacmanGame to sprite and it’s subclasses to make changing to/from pacmanGame easier
Added isPacmanGame to BasicSprite constructor, and cascaded down all implementing subclasses
Corrected Bomb bode so that you wouldn’t get free bombs just by pressing the B or M keys
Added free lives!!!! Including new sounds and pacman sounds!
Added pacman sounds for certain sprite events
Added help menu and an about dialog.
Made shields into a ring around the Sprite
Added halo to BlackHoles so they were easier to see (simulates light disk sort of anyway)
Version 1.013 :
Fixed error with explode code that caused an invalid class exception (added explosions to Javoids)
Created ghost, powerpill, dot, and fruit images
Added PACMAN to configuration file just for fun.
Made several methods synchronized to avoid ConcurrentUpdateException
This resulted in smoother animation.
Played with configuration file again, modified code to load properties
This allows multiple keys to perform the same function as originally desired
Updated html to reflect new defaults
Version 1.012 :
More user friendly configuration file completed
Keypresses are mapped to actions
using a switch statment for actions not key presses
A few minor coding changes (nicely cleaned up the application start up code).
Removed version number from Javoids.html since I can never remember to update it
Version 1.011 :
Updated html to reflect these changes
The Omnipotanté (16-way shooter) had to be reduced from 360 because it was too slow!
Created Multi-gun4 (5-way front shooter)
Bombs destroy mines and ships now
DrawnSprite uses a shape object now, passed in constructor
Since it’s created with main DrawnSprite it isn’t recreated every time it’s drawn (less objects)
had to redo a bit of the drawing code since I could no longer just create a new Ellipse2D.Double when required
Shield and BlackHole could now use a rectangle or anything else that implements the Shape interface!
Added ability to flip ship (turn 180 degrees)
Version 1.010 :
Created mines that home on your position and some times create gravity wells to draw you to them
Removed homing code and treated homing just like a gravity well (different acceleration though)
Created BlackHoles
Created class DrawnSprite to increase code re-use (by Shield and BalckHole for now)
Weapons storing every "bullet" was dropped since it would take way too much memory
Removed debugging code from newGame(...);
Changed some function names in preparation of weapons as objects
Version 1.009 :
Added code to enforce minimum size of 508x611
Everything now has the potential to be a "homing" object. It’s funny watching Javoids chase a ship.
Removed more coupling between xxxSpriteVector. Was able to remove JavoidsSpriteVector, FireSpriteVector and ShipSpriteVector making SpriteVector as generic as possible. This opened the way for guided everything.
Moved createLevelRoids back into Javoids and removed JavoidSpriteVector since there was nothing left in the class except the basic SpriteVector.
Arg. I’ve had another painful breakthrough. I found an answer after 2 working days of searching. My method of loading files from Jars was based on a regular file model. Now, I’ve discovered the getResource(file_name) method in MyClass.class (Javoids.class.getResource("stuff.dat")) in this case.
URL keyMapURL = new URL("jar:" + url.toString() + "Javoids.jar!/JavoidsKeyboard.properties");
Configuration File problem with permissions when read from jar -- corected by using URL instead of File object
Version 1.008 :
Configuration file created and usable - html PARMs removed for configuration (too much duplication)
Added two menu options to allow reloads of User defined or default key bindings
Explosions share movement/momentum of exploding Javoid -- looks neat!
Removed some coupling between ship and JavoidSpriteVector by taking the breakAllJavoids and putting it into the part of ship since it was far more appropriate there
Added "Game Over" message and corrected some code related to isGamePlaying when ships died
using isGameOver now for when the player is dead and has no lives
using isGamePlaying for pausing only
Added explosion for blowing up a ship (including ship/ship collisions
Removed some coupling between JavoidSpriteVector, Javoids and Javoid. createSmallerRoids in JavoidSpriteVector was replaced with javoid.explode(). It returns a vector of Javoids that is added to a JavoidSpriteVector.
Version 1.007 :
Added same range checking to lives and made magic numbers into meaningful constants
Added another error check for html delay to limit delay from none to 1000 milliseconds
Delay in IE not being picked up. (Parameter set to 12 not 80, corrected in html.)
Introduced bug - After Dialog closes, game remains paused. Fixed by isGameRunning = true;
Resolved issue of allowing game to procede while menu options were toggled (it would allow movement and animation when switching between the file and option menus. Ships and PowerUps would also spawn and shouldn’t have.
Version 1.006 :
Made version into a constant string for simpler updating.
Updated html for JDK 1.3.1 beta much smaller for IE and Netscape.
Javoids.html with Javoids.jar does not work in Netscape6 browser - this problem was caused by JDK 1.3.0.
Added code and made html change to set the delay for the animation making the game faster or slower.
Version 1.005 :
Moved keyboard handling and non-drawing code to run method (out of paint) to increase speed dramatically.
Added a pause feature, displayes "PAUSED" when game is paused
Corrected display of menu so that the menu would not be drawn over by the canvas using JPopupMenu.setDefaultLightWeightPopupEnabled(false); //that’s the first thing I would have thought of... <grumble>
Separated painting from moving and keystrokes to logically break up code based on function. Makes code look neater so only drawing is done while waiting for input.
changed paint method to use component(n).repaint() to speed drawing and remove unnecessary calls/processing time Incredible difference in speed!!!
Removed setDoubleBuffered and setOpaque since they didn’t seem to make a difference to performance or effect.
Menu keeps focus now when opened by setEnable(false) when menu selected and rest when un-selected
When live input dialog was cancelled, the game would not restart -- fixed (there was a numberformatexception)
Added menubar with a File menu, New - start new game, Exit - exit game if application (disabled if applet), an Option menu, Lives - change the number of lives per game,
Tool change too difficult right now -- postponed.
Start to make tools into objects that have self contained homing, shielded info rather than usiung arrays. Store them in sorted vectors to sort on guided/shielded, guided, shieled then normal. Make backup now before modifying
Tried Forte from sun, but it was way too annoying/difficult to use. The only good thing it did do was to point out that I needed to type cast my adds to Vectors.
Tried VisualCafe, it had good components, but nothing to change gridBagConstraints or DEFAulT_CLOSE_ACTION
Version 1.001 :
Prevented ships and powerups from forming after game was over. It could get noisy if unattended!
Added additional debugging constants to Debug.java to make debugging weapons and homing easier.
Ok, it looks like the homeing code is completely fixed and only required a complete rewrite of Common code
getQuadrantM(...) was rewritten to provide correct quadrant even over screen edges
This was mostly simplified to one call to getQuadrantXY, but special cases needed indepth work
getAngleM(...) was rewritten to handle correct getQuadrantM(...) much simpler.
Set focus to start button when game over (it’s handy some times)
Allow clicking on canvas to accept keystrokes so if focus is lost you can still play game
Message about each file being downloaded. Kept it for debugging, turned off in Debug.java
Fixed up html to include instructions to right of applet in multi-table format
To speed up URL download package everything in a jar. Code corrected to get images and sound from jar file.
Minor code cleanup, removal of getImage and getAudioClip
Version 1.000 :
Nothing. release as Javoids 1.0 (Turn off debug -- done)
squashed several position bugs that sneaked in due to insets removal and veiwable area changes
Version 0.910 :
Dropped topic : GridbagLayout no longer dropped, used to layout infoPanel, gameCanvas and startButton
Version 0.901 :
Fixed array out of index (0) exception by wrapping getPlayer before call to function and during call using null if size = 0
Bug - forgot to account for space for frame size, so it’s reduced for button instead of being square. This bug was intorduced when insets were no longer necessary for screen size. Bug fixed.
Jave.exe is not "making" background image display initially like appletviewer.exe (BasicFrame need override paint?) Yes, I overrode the BasicFrame paint and update mehtods to correct this
New directory structure
Javoids -main directory for source files, html and jars
Image - image files for ship, bullets, javoids etc.
Sounds - sound files for specail effects
com
APConsulting
Javoids - Class files for package com.APConsulting.Javoids
Use setMinimumSize(...) and setPreferredSize(...) where possible
To speed up URL download, use HTTP session and download everthing in a jar file! (No mediaTracker then.?) Everything was added into a jar file including images and sounds, but they don’t load from the jar :(
Corrected error in Template and BasicFrame that would override all settings for applet/frame size
Using Jar in html and also for stand alone application
Compiling into directory for package and making jar
Separtated all classes into individual files
Recreating more component based Javoids
Created Template for basic Hybrid application/applet
Version 0.900 :
html
Add code to set lives etc to html in parameters
Corrected homing code for weapons. Shortest distance and correct angle is determined. Arg this was hard.
Corrected bug with restoring enemy ship even when no lives were left
Version 0.800 :
Added multiple enemy ships if not destroyed they disappear, until then they shoot and move like the wind!
They always use their most powerful weapon
Problem when resizing window initially. Ship starts off center. Problem resolved!
Not! Java.exe version only // corrected
Shield not displaying overlap correctly. // corrected
When an image is near a border, only show part of it and show the other part on the other side. Have to add new collision code or it looks like there are hits, but nothing happens
If roid is in a corner it must show in all four corners!!! // now it does
Can load with appletviewer.exe, IE5+, java.exe (taken out of dropped topics due to recent insight
Slight problem with animated gifs when useing java.exe instead of applet viewer etc.
required to use getToolkit() and newAudioClip(url); etc.
Load with java.exe (can’t get GetAudioClip and CreateImage to work correctly due to stub or AppletContext = null for application
Created Pac.gif and added PACMAN to JavoidsImage interface as joke since missiles swarm like pirahnas
Change to get applet to handle keystrokes now causing problems w/ IE5 Applet must requestFocus() as final task in init(); // works for appletviewer.exe and IE 5.5 (and maybe earlier)
Left and right cycle through weapons like URT
Version 0.700 :
Copied code from shielded weapon counts etc and made homing weapons work from powerUps
Changed a few constants to have a similar naming convention class.MAX_NUMBER
Set initial focus without pressing start button in JDK1.3 (problem does not exist in JDK 1.2.2) Applet must be the thing getting initial keystrokes! (My mistake; moved code.)
Created FireSpriteVector to handle adding one or more Fires at a time
Shielded bullets work, I just need to setup weapons that use them!
Power ups!
bullets
Guided weapons (best for missiles because they are slow enough to target better)
shielded (armor piercing)
Had to make shield a BasicSprite or recursion would result from collisionDetected and from Sprite constructor because I wanted every Sprite to have a shield. Changed collision detected again to somplify some code. Argh that was painful.
Changed collision to be for each Sprite so they can handle their shield code!
Renamed to Javoids! Thanks to Donald Gadbois for the name (Asteroids, JRoids, JavaRocks and JavaRoids were already taken)
Fixed Explosion.gif animation look a bit better
Made weapon data into several static tables
Power ups!
bullets
multi-way firing (2 or 3 stream cone, 4 corners, compass of doom)
Megabomb to destroy all roids
Added code to display the Ammo better when a tool is IMMORTAL (no longer shows maimum integer)
Created new animated GIF for Fire and new images for MachineGuns and Rockets
Corrected PowerUp behavior (not diing when caught, only when blown up.
Added basic instructions to the web page
The final changes in Version 0.6 seems to have removed a longstanding bug where the Javoids and Bullets would not display.
Crash.wav renamed to PowerUpDie.wav and changed JavoidsSound
This version was started due to all of the changes in the previous release. Many major flaws/bugs were removed!
Version 0.600 :
Removed notifyAll from paintComponent as it was causing excessive flicker (appearantly not needed)
Removed update because JComponents don’t call it.
Changed paint to paintComponent after reading additional docs. Used for custom JComponents to ensure repaint
Solved JLabels and JButtons not repainting; needed getContentPane().repaint(); since this calls the repaint for all children of ContentPane.
Made Image and sound constants use an interface that every class can use/implement
Made Image, Sound, Game use one copy of info for Sprites, much less space required, faster too.
Corrected problem with scaling. Can use Graphics2D now, was using getScaledImage.
Start button is always selected and ready to be pressed when loaded. (Not quite what I wanted yet.)
Power ups!
heal damage to ship
heal damage to shield and duration of shield
additional lives
bonus points
bullets
number of bullets
mass +/- (more/less damaging)
size of bullets (this is gross!)
lose points for shooting a powerup
image.flush() removed from code when gif loop indefinately switch was discovered in a painting program!
Encapsulated movement and life stats and functions in classes Move and Alive
Added a label at top to display ammunition, number of special items
Added some toString and print functions to simplify debugging
Version 0.500 :
Added ammunition/amount for shields, guns (bullets), afterburners
Added afterburner for faster acceleratio and higher maximum speed
Added Shields! (User Activated this time!) (Level changing recharge to protect player for a short time)
Added Hyperspace Jump! (Until Powerups, get one per life)
Added Bomb! (Until Powerups, get one per life)
Javoids enter from the sides
Added shield (changes color with damage/time remaining)
Added generic SpriteVector class to group common code
Added takeDamage method to Spite, Javoid and Ship classes to clean up code
Changed acceleterate procedure to allow a stop if passed 0
Added getMass function to make collisions more dangerous for large objects
Changed damage to be function of "mass" and relative velocity
Added collisionDetected function to replace common code
This version is much easier to maintain - far fewer exceptions happening!
Added more sounds in preparation of powerups (more guns)
Version 0.400 :
Restart button at bottom
Generic Javoid creation - constructor
Upgrade images and sound to media tracker for loading off of URL (sound not supported for media tracker yet - jdk1.3?)
Version 0.300 :
Score label at top
Smooth animation
Load without the appletviewer in IE4+
Version 0.200 :
Added sounds! (upgrade to media tracker for loading off of URL)
Version 0.100 :
First stable version.
Applet finally closes!
Ship now only moves on viewable portion of the window.
Playable area resizes when window is resized.
Many minor improvements.
Topics on hold :
Minor update problem when waiting for lives input... < save background and redisplay along with components > This looks like the component (game) waits for repaint message when display is too dirty etc. ok as is.
Add code to handle lost focus etc to prevent wasted CPU time!
Made the Explosion.gif animation look a bit redder/more colorful // GIF format too limited (256 colors)
speed of bullets, ship, roids +/- (sort of did this already)
Dropped Topics :
Change the minor Images to VolatileImages to use hardware acceleration; if feasable.
Saw no benefit to this: "Make KeyMap use an InputMap for (KeyStroke,Object) storing"
Tools store objects not numbers and homing, shielded etc are properties of bullets. // too much memory used
Break up getMedia to use getImage and getSound that will be moved to Common.java
Functions removed, as not easily used when loading from jar
Put getURL back in Common.java
Explosion animation - change animated gif into a series of gifs since animated GIF files do not scale! <Wrong> with the scale command working well, they do scale!
shield
mass +/- (more/less damaging) //can make a shield useless except as a one hit wonder, or as an impenitrible shield
additional maxHp, too easy to make game less fun
additional maxHP and maxLifeTime for shield, too easy to make game less fun by making it too easy I might reduce Shield duration, but damage capacity is good.
Flushing every image // this.image.flush(); // this was causing the bullets and explosions to spead everything up! (forces a paint even though thread not back??) Resolved by increasing frame rate (wait/delay) and adding NotifyAll???? // Yes and no respectively.