Shooting Game Prototype

9/02/2008

Here’s something I’ve been working on lately - It’s ultimately going to be a platformer/shooting game. For now, I have been working on the weapons. I’ve got a sort of good system worked out for changing and assigning weapons and giving different weapons different attributes. Here is the game so far:

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

A/D to move Left/Right. Click to shoot. 1, 2 or 3 to change weapons. (Click and hold shoot with the 1st and 3rd weapon.)

The main target of this little exercise was to make it easy to add more weapons and adjust their stats. I count each weapon as a different object and they all extend the Weapons class, which handles basic firing, reloading and holds all the variables for power and accuracy etc. For example, here are the weapons I have.

PKM -

  • power = .9; //Between 0 and 1
  • accuracy = 45; //offset - 0 is perfect shot, offset gets higher
  • maxAmmo = 200; //Max no. of ammo held in one clip
  • ammo = maxAmmo; //Ammo left in a clip
  • maxClips = 4; //Max no. of clips held
  • clips = maxClips; //No. of ammo clips left
  • reloadTime = 600; //Also the start delay time
  • auto = true;
  • fireRate = 125;
  • weaponName = “PKM”;

AK-47 -

  • power = .4;//Between 0 and 1
  • accuracy = 10;//offset - 0 is perfect shot, offset gets higher
  • maxAmmo = 80;//Max no. of ammo held in one clip
  • ammo = maxAmmo;//Ammo left in a clip
  • maxClips = 3;//Max no. of clips held
  • clips = maxClips;//No. of ammo clips left
  • reloadTime = 500;//Also the start delay time
  • auto = true;
  • fireRate = 100;
  • weaponName = “AK-47″;

Pistol -

  • power = .2; //Between 0 and 1
  • accuracy = 0; //offset - 0 is perfect shot, offset gets higher
  • maxAmmo = 9; //Max no. of ammo held in one clip
  • ammo = maxAmmo; //Ammo left in a clip
  • maxClips = 5; //Max no. of clips held
  • clips = maxClips; //No. of ammo clips left
  • reloadTime = 320; //Also the start delay time
  • auto = false;
  • fireRate = 0;
  • weaponName = “PP-19 PISTOL”;

The next thing I will be working on is decent movement of the player, and I will be working on creating and interacting with the level.

No comments yet.

Write a comment: