Implementation Documentation on

How to Implement…

…New Tank Movement

  1. In order to create a new type of movement behavior for the tank first start by creating a new script under the folder Tank>Movement>InputActionTypes

  2. Name the script describing the type of tank movement behavior you want to implement like this

    Untitled

  3. Use the IInputActionController interface to choose the actions your new tank behavior would like to implement and those are

    public interface IInputActionController
    {
        IInputActionController Up(Action onUp);
        IInputActionController Down(Action onDown);
        IInputActionController Left(Action onLeft);
        IInputActionController Right(Action onRight);
        IInputActionController Fire(Action onFire);
        IInputActionController VerticalMovementFinish(Action onVerticalMovementFinish);
        IInputActionController HorizontalMovementFinish(Action onHorizontalMovementFinish);
    }
    
  4. Example for RandomInputActions implementation using the interface IInputActionController

    public IInputActionController Up(Action onUp)
        {
            Update();
            if (moveDirection==0)
                onUp();
            return this;
        }
    
  5. Finally, add the desired direction in an Update method that will execute the tank movement behavior as desired when the script is called upon like this

    private void Update()
        {
            CountDown -= Time.deltaTime;
            if (CountDown <= 0)
            {
                moveDirection = UnityEngine.Random.Range(0, 4);
                CountDown = maxTime;
            }
        }
    

Known Issues

  1. Tank Jerking

    1. Start game
    2. Start moving the tank in any direction
    3. While holding the same direction, start tapping in the opposite direction
    4. Observe the jerking movement of the tank

    Actual behavior: the tank is jerking back and forth every time the opposite direction is tapped

    Expected behavior: the tank does not jerk when any buttons are pressed at the same time. When a new movement direction is inputted the tank needs to start to move in the latest input direction and ignore all other previous inputs.

    Game Design/Technical comment: the tank position rounding is expected only when the tank changes direction under an angle of 90° in any direction other than the direction it is currently moving. Because the only time the tank object needs to adapt its position according to the rails is when it’s changing direction at an angle of 90°.

    TankJerking140223.gif

  2. Power-Ups Spawn Half Out of Bounds

    1. Start the game
    2. Play until a Power-Up spawns out of the bounds of the map (half in, half out)
    3. Observe

    Actual: The power-up spawns half out of the bounds of the map

    Expected: The power-up can only spawn fully within the bounds of the map

  3. Power-Ups Spawn On Top of The Player Tank

    1. Start the game
    2. Play until a Power-Up spawns on top of the player's tank
    3. Observe

    Actual: The power-up spawns on top of the player's tank and causes unexpected behavior for the player

    Expected: The power-up can not spawn on top of the player tank, only at a distance of 4 environment tiles

  4. Power-Ups Spawn On Top of Eagle

    1. Start Game
    2. Play until a power-up spawns on top of the eagle
    3. Observe

    Actual: The power-up spawns on top of the eagle

    Expected: The power-up can not spawn on top of the eagle

  5. Enemy Tanks Spawn on top of Each-Other

    1. When the spawn point is physically taken by an active tank, the spawn point should be activated elsewhere
    2. Start game
    3. Position the tank in one of the spawn points
    4. Destroy enemy tanks
    5. Observe the interaction between the active tank and the tank that spawns.

Actual behavior: The spawning tank is physically moving the active tank when it appears on the screen.

Expected behavior: When the spawn point is physically taken by an active tank, the spawn point should be activated elsewhere

Game Design/Technical comment: The spawn point should be prompted` in a location where there is no active tank

  1. Score screen ads +2 every time