AS Wars 2007
Game Description:
You have 72 hours or so to create an autonomous (automatically moving and functioning movieclip), which must destroy the other movieclips on stage using movement, shooting, healing, mining, and reloading functions. The code is actually very simple to code since the backend is all done, so if you are a beginning actionscripter, you can easily participate. However, if you are a long time developer, you’ll also have an interesting time creating a clip that can fight in the AS Arena and hopefully win the 2007 AS Wars Battle #1.
If you have participated in the previous AS Wars last year, this game is similar. Check the rules for more info. As you may already know, I am a compulsive writer, so I hope I can cover most of the rules here. Don't be scared of the large amounts of code, take a look at the template file and see how simple it is.
Deadline:
11:59 PM EST Friday, January 5. Your bot must be tested and functional by this date, no exceptions.
Submission:
Email me the FLA (NOT SWF!!!) of your bot. jmtb02@gmail.com. PM works too.
Prize:
I will ship a NG Tshirt to the winner.
Gameplay:
Four bots will compete during each competition, starting out at each of the four corners of the arena. Every frame, your bot will have an option for what it wants to execute. It may only execute a single (ONE) action every frame (don't confuse this with lines of code, it may take several lines of code to execute the action you like). The five actions you may execute are:
Move (option = 1)
Shoot (option = )
Reload (option = 3)
Heal (option = 4)
Mine (option = 5)
To tell the file that you are going to be using one of these commands, you must set the option variable of your bot to that number. For example:
option = 1;
Bots Design
Each player will design their own bot. Each bot must follow these guidelines:
*Size: 30x30 pixels exactly, square.
*Coloring: You must draw a unique style on your bot in order to compete. Get a good artist to draw something awesome if you can, because we know that Actionscripters can’t draw worth shit.
*Symbol Type: Movieclip with the name of your screen name. No more than 10 characters, letter and numbers only, no spaces. InstanceName must be the same as the symbol name.
*Arena: The arena is 600x600 pixels, and is completely empty except for the bots that are competing. The actual movie stage size is 700x600, so using Stage.width is not advised.
*Battle Style: Free-for-all, every bot will be fighting each other. No allies.
*Weapons: Weapons are generated for you. You get 20 bullets and 4 mines. You can reload bullets but not mines.
Template Files
Flash 8 | Flash 7
Please look at the tutorial file. A lot of this will make sense once you take a look at the code. This template may be updated if errors are found, so stick around the thread for few days. You MUST use the template file.
Quick Script Reference
This reference was built in case you want to just get right to building, the longer rules are expanded in the Expanded Reference Guide (below).
----Variables you can reference but not modify
_root.bullets[] = An array containing all the live bullets.
_root.livebots[] = An array containing all the live bots.
_root.mines[] = An array containing all the mines, both active and not.
life = A Number for the amount of life you have left.
mines = A Number for the amount of mines left
shots = A Number for the amount of shots you have left
----Variables you can alter
option = A Number specifying what action you will take this frame
moveX = A range of -2 to 2 that you can move in the X direction if you choose to move
moveY = A range of -2 to 2 that you can move in the Y direction if you choose to move
shotAngle = The angle, in degrees, you shoot if you choose to shoot
----Options
option = 1; //Move
option = 2; //Shoot
option = 3; //Reload
option = 4; //Heal
option = 5; //Mine
----Symbol Naming Scheme
Bullets = All named "bullet"+bulletNumber.
Bots = All named as loaded on screen.
Mines = All named "mine"+mineNumber.
Expanded Reference Guide
This guide is to further explain all these variables and options you may use in battle.
*Movement:
option = 1;
The movement option will move your bot around the arena. You may move anywhere within the 600x600 fighting area, and if you try to move off, you will automatically be blocked. You can set how far your clip will move with these two variables:
moveX = 2;
move Y = -2;
The range of both of these values is between 2 and -2. You can use decimals if you like, but be warned that your movement option will not execute if your value is outside of the range of 2 to -2.
*Shooting:
option = 2;
The shoot option will shoot a bullet (10 px long) at a velocity of 8 px a frame, and will last 80 frames or so. A player has 20 shots before having to reload. If a bullet hits a player, it will be removed from the game and will cause the player 5 damage (player has a 100). If a bullet is shot but the player has no more shots, the shot will not execute and the player will lose their action for the frame. To set the angle of the shot, use:
shotAngle = 250; //in degrees
*Reload:
option = 3;
The reload option will recover 1 bullet. If the player is at 20 shots, the player will not recover anymore and their action will be lost for the frame.
*Healing:
option = 4;
The heal option will recover 1 point of damage. If the player is at 100 life, it will not increase.
*Mine:
option = 5;
The mine option will lay a mine on the stage. A player gets 4 mines per game, and may not recover them. The mine is inactive for 50 frames, and then can cause damage to any player, including the player that placed it. A mine causes 25 damage.
Variable Descriptions/Reservations:
There are several important codes you may or may not use in your bot development.
*Bot Variables
These are variables reserved for your own bot. You cannot edit them, but you can use them to determine important information.
life = the number of life points you have left. At 0 life, your bot will be removed from the game. The maximum is 100.
mines = the number of mines you have left.
shots = the number of shots you have left. You get a maximum of 20 in stock before reloading.
These you can edit, however...
moveX = the distance X you will be moving if you use the move option.
moveY = the distance Y you will be moving if you use the move option.
option = the number specifing what action you will take.
*Bullet Names
Every bullet in the game will be named "bullet"+bulletNumber. For example...
bullet0
bullet1
bullet59
bullet120
The maximum bullet number at any given time will be 200. Every bullet that exists will be stored in the array _root.bullets[]. For example...
_root.bullets[0,1,59,120];
Once a bullet is removed, it's name become's available for the next bullet to be loaded. Each bot shares the same array and names of bullets, and are all located on the stage. The way bullets are loaded are complex and silly to try to make you better utilize the array and not individually code bullet checking one-by-one.
*Bot Names
Each bot is automatically added when it appears on the stage, and is stored in the array liveBots. For example, when the game loads, if there are four bots...
liveBots[botnum1, botbot2, botsome3, bot4].
When a bot dies, the name will be removed from the array.
*Mine Names
Mines exist like the bullet system, "mine" + mineNumber. For example..
mine0
mine1
All mines are stored within the _root.mines[] array, as...
_root.mines[0,1].
Hi there!