The source code for Indie Brawl is included in the download. To use it, you will need to put it in the same folder as the main game download. It is programmed in Game Maker. It's not necessary for team members to understand or even look at this file. However, the option is there if you would like to try programming a character yourself.If you don't have the registered version of Game Maker, this is the last version of the source that will work for you. You will need to go to the Character's draw event and change draw_sprite_ext to draw_sprite and eliminate the last few arguments. If you would like a version of the source code that is compatible with the unregistered version of Game Maker, PM me.
If you are interested in programming characters, read on...
Each character has the following statistics:
maxhp - Character's total hit points. 30 is average.
weight - A rating of 1-5 that determines how heavy a character is. 3 is average, 1 is Gish, 5 is Balrog.
maxspeed - how fast the character can normally walk. 6 is average.
accel - How fast the character accelerates. 3 is average. If lower, character will be hard to control.
air_accel - How fast the character accelerates in the air. Should be about half of accel, but at least 1.
maxjumps - How many times the character can double jump. Typically 1.
jumpspeed - How high the character jumps. 16 is average. Raising or lowering this just a little vastly changes jump height.
doublejumpspeed - How high the character double jumps. 14 is average.
air_cooldown - The higher this is, the longer the delay between aerial attacks. 6 is average, but for some characters, it could be as low as 0.
Creating attacks is a little more complicated. Generally, just describing the attack will suffice, but if you would like a more in-depth look at how attacks are programmed, here's how it's done (if you're not interested in the programming, you can skip the rest of this post):
Attacks are performed in one or more steps, with a small delay between each step. At each step, the character will perform certain actions. It's easier to explain if I just show you. Here's a sample attack (this is the charging attack from the demo).
Performed when the button is pressed:
//First, we check to see if the player recently performed an aerial attack, since there's a cooldown period between attacks in the air.
//Some attacks (such as dodges and rapid gunfire) may not have cooldown times.
if(air_attack = 1)
//The character's movement (represented by the two momentum variables) freezes.
xmomentum = 0;
ymomentum = 0;
//While the attack charges up, the character is unaffected by gravity.
float = 1;
//The next step will occur in two frames.
alarm = 2;
//The attack_start() method should almost always be invoked at the start of each attack. This method ensures that no other attacks can be performed while you're in the middle of this one.
//We set the character's horizontal speed very high. xscale is a variable that determines which direction the character is facing. x_add is a variable that increases the character's speed with each step. It is used to prevent the player from slowing down while charging.
xmomentum = 12*xscale;
x_add = xscale;
ymomentum = 0;
//The attack_create() method must be used to create the attack.
//The second step is next, and it will occur in four frames.
next_step = 2;
alarm = 4;
//We set x_add and float back to zero so the character's movement returns to normal.
x_add = 0;
float = 0;
//Step 3 is next, an will occur in four frames.
next_step = 3;
alarm = 4;
//The attack_end() method allows the character to attack normally again. If you do not want the attack to have an aerial cooldown timer, you can substitute "act = 0" for "attack_end()".
The attack itself has a duration of four frames. It has the following code for when it collides with an enemy:
//The attack_aim() method should always be called. It makes sure the attack doesn't hurt allies or hit an enemy multiple times. The method's argument determines how long the enemy will be immune to your attacks (it should generally be set to alarm, the attack's duration).
//target will be set to 1 if it hits an enemy (instead of an ally)
if(target = 1)
//The attack_hit() method has several arguments-
//1- The attack's damage. 5 is average.
//2- The attack stuns enemies of this weight or less. Should generally be 5.
//3- Horizontal knockback. 1 is average.
//4- Vertical knockback. 1 is average.
//5- The duration for which the enemy is stunned. 2 is average.
//6- Set this variable to 1 to make the attack unblockable.