Skip to content
megadrive edited this page Jul 10, 2012 · 2 revisions

Refactor code

  • This is a constant issue, but there's no problem with hacking together some code, making it work and then figuring out how to refactor later. Feel free to commit hacky code, as long as it works and IS COMMENTED. Simple comments like /* This code makes the enemy movement move left and right each turn */ is fine.
  • The first thing you should do (preferably before committing, not necessary though) is look at the new code and ask yourself whether it needs an entirely new Class. What does the code depend on? If it just requires an input of a FlxObject, perhaps it's fine in a FlxState derived class.

Add unit to unit collisions

  • units cannot move over other units.
  • If unit collides with another unit, either consider unit movement complete, or if possible (if one unit still has moves left in their moveArray), make the unit go around.

Add enemy units

  • For testing just have them wander around randomly
  • Player cannot control them

Add turn based system - assigned to megadrive

  • 5 seconds to issue orders
  • 3 seconds for orders to execute simultaneously
  • Add a little graphical timer thing that ticks down (can just be a number of seconds if you don't want to make a bar yet)

Add combat

  • Just a simple line of sight thing. If unit sees another unit, shoot at it.
  • Have a little graphic for bullets moving from the unit shooting to unit being shot at
  • Can implement health / killing units as a part of this if you want
  • Units CAN NOT shoot while moving. They have to stand still before shooting.

Unit uniqueness The idea for units is that there will be classes, and unit upgrades. So what we want to do is make it so different units have different values of speed, damage, accuracy, eyesight, etc. While this doesn't need to be implemented as a full fledged class system yet, it's what we should be building towards.

  • Speed - How many squares a unit can move per turn (note: not the actual speed that it moves. Or maybe the speed at whcih it moves. Play around with this idea?)
  • Damage - How much damage projectiles do to enemies (note: possibly introduce a damage falloff. So, lots of damage up close, standard damage from the class's medium range, and less damage from a far)
  • Accuracy - How far a unit can shoot before bullets start missing their mark
  • Range - How far a unit can see (for most units this will be less than the entire board)
  • Anything else cool we can think of

A note on accuracy:

If we have calculated that a unit misses their target, still model the bullet shooting at the new, missed location. So it has a chance of still damaging something behind / to the side of the initial target.

Unit weapons:

  1. Assault Rifle - Accurate, long range.
  2. Shotgun - Short range, high damage.
  3. LMG - Inaccurate, long range.

Unit special attacks:

  1. Assault Rifle - Throw Grenade (AoE damage. Possibly environmental damage?)
  2. Shotgun - Run & Gun? (Can shoot while moving)
  3. LMG - Suppressive fire (Sustained fire over a very wide angle. Does not do much damage, but can hit a lot of enemy units)

A note on encounters:

  • A unit has to be in range of another unit (dependant on eyesight / "range" variable) in order to initiate shooting at them.
  • A unit has to stop moving to start shooting.
  • If the enemy unit is eliminated or moves out of line of sight, the unit will continue with its movement path.
  • If the movement path was to move to the enemy, go to where the unit last saw the enemy target. If unit sees enemy along this path, resume shooting.
  • Turning around to face an enemy takes time depending on class speed. Shotgun class can spin around fast, LMG guy takes a second or so.

A note on movement:

  • Units can be told to move to a square, and they will attempt to move there during the action phase of the turn.
  • Units can also be told to move to a unit. In this case they will move to that unit's location.
  • If unit is an enemy, fire when in range. Units can move to friendly units. Have not decided on any actions they should perform for this.
  • If an enemy movement goes outside of the friendly unit's line of sight, friendly unit will go to where they last saw the enemy unit.
Clone this wiki locally