// Path: GenericZombieShooter/src/genericzombieshooter/misc/Globals.java
// public class Globals {
//     // Game Information
//     public static final String VERSION = "1.0";
//     public static final int W_WIDTH = 800; // The width of the game window.
//     public static final int W_HEIGHT = 640; // The height of the game window.
//     public static final long SLEEP_TIME = 20; // The sleep time of the animation thread.
//     public static final long WAVE_BREAK_TIME = 30 * 1000;
//     public static final Random r = new Random();
//     public static List<Message> GAME_MESSAGES = new ArrayList<Message>();
//     
//     // Zombie Information
//     public static final int ZOMBIE_REGULAR_TYPE = 1;
//     public static final long ZOMBIE_REGULAR_SPAWN = 1000;
//     public static final int ZOMBIE_DOG_TYPE = 2;
//     public static final long ZOMBIE_DOG_SPAWN = 10000;
//     public static final int ZOMBIE_ACID_TYPE = 3;
//     public static final long ZOMBIE_ACID_SPAWN = 30000;
//     public static final int ZOMBIE_POISONFOG_TYPE = 4;
//     public static final long ZOMBIE_POISONFOG_SPAWN = 20000;
//     public static final int ZOMBIE_MATRON_TYPE = 5;
//     public static final long ZOMBIE_MATRON_SPAWN = 50000;
//     public static final int ZOMBIE_TINY_TYPE = 6;
//     
//     // Boss Information
//     public static final int ZOMBIE_BOSS_ABERRATION_TYPE = 7;
//     public static final int ZOMBIE_BOSS_ZOMBAT_TYPE = 8;
//     public static final int ZOMBIE_BOSS_STITCHES_TYPE = 9;
//     
//     // Game-State Related
//     public static Runnable animation; // The primary animation thread.
//     public static GameTime gameTime; // Used to keep track of the time.
//     
//     public static boolean running; // Whether or not the game is currently running.
//     public static boolean started;
//     public static boolean crashed; // Tells the game whether or not there was a crash.
//     public static boolean paused;
//     public static boolean storeOpen;
//     public static boolean levelScreenOpen;
//     public static boolean deathScreen;
//     public static boolean waveInProgress; // Whether the player is fighting or waiting for another wave.
//     public static long nextWave;
//     
//     // Input Related
//     public static boolean [] keys; // The state of the game key controls.
//     public static boolean [] buttons; // The state of the game mouse button controls.
//     public static Point mousePos; // The current position of the mouse on the screen.
//     
//     // Static Weapons
//     public static Handgun HANDGUN = new Handgun();
//     public static AssaultRifle ASSAULT_RIFLE = new AssaultRifle();
//     public static Shotgun SHOTGUN = new Shotgun();
//     public static Flamethrower FLAMETHROWER = new Flamethrower();
//     public static Grenade GRENADE = new Grenade();
//     public static Landmine LANDMINE = new Landmine();
//     public static Flare FLARE = new Flare();
//     public static LaserWire LASERWIRE = new LaserWire();
//     public static TurretWeapon TURRETWEAPON = new TurretWeapon();
//     public static Teleporter TELEPORTER = new Teleporter();
//     
//     public static Weapon getWeaponByName(String name) {
//         if(name.equals(Globals.HANDGUN.getName())) return Globals.HANDGUN;
//         else if(name.equals(Globals.ASSAULT_RIFLE.getName())) return Globals.ASSAULT_RIFLE;
//         else if(name.equals(Globals.SHOTGUN.getName())) return Globals.SHOTGUN;
//         else if(name.equals(Globals.FLAMETHROWER.getName())) return Globals.FLAMETHROWER;
//         else if(name.equals(Globals.GRENADE.getName())) return Globals.GRENADE;
//         else if(name.equals(Globals.LANDMINE.getName())) return Globals.LANDMINE;
//         else if(name.equals(Globals.FLARE.getName())) return Globals.FLARE;
//         else if(name.equals(Globals.LASERWIRE.getName())) return Globals.LASERWIRE;
//         else if(name.equals(Globals.TURRETWEAPON.getName())) return Globals.TURRETWEAPON;
//         else if(name.equals(Globals.TELEPORTER.getName())) return Globals.TELEPORTER;
//         else return null;
//     }
//     
//     public static void resetWeapons() {
//         Globals.HANDGUN.resetAmmo();
//         Globals.ASSAULT_RIFLE.resetAmmo();
//         Globals.SHOTGUN.resetAmmo();
//         Globals.FLAMETHROWER.resetAmmo();
//         Globals.GRENADE.resetAmmo();
//         Globals.LANDMINE.resetAmmo();
//         Globals.FLARE.resetAmmo();
//         Globals.LASERWIRE.resetAmmo();
//         Globals.TURRETWEAPON.resetAmmo();
//         Globals.TELEPORTER.resetAmmo();
//     }
// }


import genericzombieshooter.misc.Globals;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;

                g2d.drawImage(this.image, (int)x, (int)y, null);
            }
            g2d.setTransform(saved);
        } catch(NoninvertibleTransformException nte) {}
    }
    
    /**
     * Updates the state of the particle.
     **/
    public void update() {
        if(this.isAlive()) {
            // Age the particle.
            this.life--;
            // Update the position.
            this.pos.x += this.speed * Math.cos(-this.theta + (Math.PI / 2));
            this.pos.y += this.speed * Math.sin(-this.theta + (Math.PI / 2));
        }
    }
    
    public boolean checkCollision(Rectangle2D.Double rect) {
        if(rect.contains(pos)) {
            this.life = 0;
            return true;
        } else return false;
    }
    
    public boolean outOfBounds() {
        boolean top = this.pos.y < 0;
        boolean right = this.pos.x > Globals.W_WIDTH;
        boolean bottom = this.pos.y > Globals.W_HEIGHT;

// Path: GenericZombieShooter/src/genericzombieshooter/misc/Globals.java
// public class Globals {
//     // Game Information
//     public static final String VERSION = "1.0";
//     public static final int W_WIDTH = 800; // The width of the game window.
//     public static final int W_HEIGHT = 640; // The height of the game window.
//     public static final long SLEEP_TIME = 20; // The sleep time of the animation thread.
//     public static final long WAVE_BREAK_TIME = 30 * 1000;
//     public static final Random r = new Random();
//     public static List<Message> GAME_MESSAGES = new ArrayList<Message>();
//     
//     // Zombie Information
//     public static final int ZOMBIE_REGULAR_TYPE = 1;
//     public static final long ZOMBIE_REGULAR_SPAWN = 1000;
//     public static final int ZOMBIE_DOG_TYPE = 2;
//     public static final long ZOMBIE_DOG_SPAWN = 10000;
//     public static final int ZOMBIE_ACID_TYPE = 3;
//     public static final long ZOMBIE_ACID_SPAWN = 30000;
//     public static final int ZOMBIE_POISONFOG_TYPE = 4;
//     public static final long ZOMBIE_POISONFOG_SPAWN = 20000;
//     public static final int ZOMBIE_MATRON_TYPE = 5;
//     public static final long ZOMBIE_MATRON_SPAWN = 50000;
//     public static final int ZOMBIE_TINY_TYPE = 6;
//     
//     // Boss Information
//     public static final int ZOMBIE_BOSS_ABERRATION_TYPE = 7;
//     public static final int ZOMBIE_BOSS_ZOMBAT_TYPE = 8;
//     public static final int ZOMBIE_BOSS_STITCHES_TYPE = 9;
//     
//     // Game-State Related
//     public static Runnable animation; // The primary animation thread.
//     public static GameTime gameTime; // Used to keep track of the time.
//     
//     public static boolean running; // Whether or not the game is currently running.
//     public static boolean started;
//     public static boolean crashed; // Tells the game whether or not there was a crash.
//     public static boolean paused;
//     public static boolean storeOpen;
//     public static boolean levelScreenOpen;
//     public static boolean deathScreen;
//     public static boolean waveInProgress; // Whether the player is fighting or waiting for another wave.
//     public static long nextWave;
//     
//     // Input Related
//     public static boolean [] keys; // The state of the game key controls.
//     public static boolean [] buttons; // The state of the game mouse button controls.
//     public static Point mousePos; // The current position of the mouse on the screen.
//     
//     // Static Weapons
//     public static Handgun HANDGUN = new Handgun();
//     public static AssaultRifle ASSAULT_RIFLE = new AssaultRifle();
//     public static Shotgun SHOTGUN = new Shotgun();
//     public static Flamethrower FLAMETHROWER = new Flamethrower();
//     public static Grenade GRENADE = new Grenade();
//     public static Landmine LANDMINE = new Landmine();
//     public static Flare FLARE = new Flare();
//     public static LaserWire LASERWIRE = new LaserWire();
//     public static TurretWeapon TURRETWEAPON = new TurretWeapon();
//     public static Teleporter TELEPORTER = new Teleporter();
//     
//     public static Weapon getWeaponByName(String name) {
//         if(name.equals(Globals.HANDGUN.getName())) return Globals.HANDGUN;
//         else if(name.equals(Globals.ASSAULT_RIFLE.getName())) return Globals.ASSAULT_RIFLE;
//         else if(name.equals(Globals.SHOTGUN.getName())) return Globals.SHOTGUN;
//         else if(name.equals(Globals.FLAMETHROWER.getName())) return Globals.FLAMETHROWER;
//         else if(name.equals(Globals.GRENADE.getName())) return Globals.GRENADE;
//         else if(name.equals(Globals.LANDMINE.getName())) return Globals.LANDMINE;
//         else if(name.equals(Globals.FLARE.getName())) return Globals.FLARE;
//         else if(name.equals(Globals.LASERWIRE.getName())) return Globals.LASERWIRE;
//         else if(name.equals(Globals.TURRETWEAPON.getName())) return Globals.TURRETWEAPON;
//         else if(name.equals(Globals.TELEPORTER.getName())) return Globals.TELEPORTER;
//         else return null;
//     }
//     
//     public static void resetWeapons() {
//         Globals.HANDGUN.resetAmmo();
//         Globals.ASSAULT_RIFLE.resetAmmo();
//         Globals.SHOTGUN.resetAmmo();
//         Globals.FLAMETHROWER.resetAmmo();
//         Globals.GRENADE.resetAmmo();
//         Globals.LANDMINE.resetAmmo();
//         Globals.FLARE.resetAmmo();
//         Globals.LASERWIRE.resetAmmo();
//         Globals.TURRETWEAPON.resetAmmo();
//         Globals.TELEPORTER.resetAmmo();
//     }
// }


// Path: GenericZombieShooter/src/genericzombieshooter/structures/Particle.java
import genericzombieshooter.misc.Globals;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;

                g2d.drawImage(this.image, (int)x, (int)y, null);
            }
            g2d.setTransform(saved);
        } catch(NoninvertibleTransformException nte) {}
    }
    
    /**
     * Updates the state of the particle.
     **/
    public void update() {
        if(this.isAlive()) {
            // Age the particle.
            this.life--;
            // Update the position.
            this.pos.x += this.speed * Math.cos(-this.theta + (Math.PI / 2));
            this.pos.y += this.speed * Math.sin(-this.theta + (Math.PI / 2));
        }
    }
    
    public boolean checkCollision(Rectangle2D.Double rect) {
        if(rect.contains(pos)) {
            this.life = 0;
            return true;
        } else return false;
    }
    
    public boolean outOfBounds() {
        boolean top = this.pos.y < 0;
        boolean right = this.pos.x > Globals.W_WIDTH;
        boolean bottom = this.pos.y > Globals.W_HEIGHT;

        boolean left = this.pos.x < 0;
