Class Pattern


  • public class Pattern
    extends java.lang.Object
    Stores patterns of bullets to fire
    Author:
    Riju De
    • Constructor Summary

      Constructors 
      Constructor Description
      Pattern​(int speed, int range, float timeBetweenShots, int patternLength, int multi, float cooldown)
      Create an aimed pattern
      Pattern​(int degree, int speed, int range, float timeBetweenShots, int patternLength, int multi, float cooldown)
      Create a static directional pattern, fires in a single defined direction
      Pattern​(java.lang.Boolean clockwise, int startAngle, int rotations, int speed, int range, float timeBetweenShots, int multi, float cooldown)
      Create a spiral pattern
    • Method Summary

      Modifier and Type Method Description
      Bullet[] aimedSet​(int set, com.badlogic.gdx.math.Vector2 aimDir)  
      Bullet[] bulletSet​(int set)  
      java.lang.Boolean getAim()  
      Bullet[][] getBullets()  
      float getCooldown()  
      float getWaitTime()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Pattern

        public Pattern​(int degree,
                       int speed,
                       int range,
                       float timeBetweenShots,
                       int patternLength,
                       int multi,
                       float cooldown)
        Create a static directional pattern, fires in a single defined direction
        Parameters:
        degree - Direction to shoot
        speed - Speed of the bullets
        range - Distance each bullet travels
        timeBetweenShots - Time before the next shot
        patternLength - How many shots in the pattern
        multi - How many bullets per shot (spread)
        cooldown - Time after pattern to wait before firing the next pattern
      • Pattern

        public Pattern​(int speed,
                       int range,
                       float timeBetweenShots,
                       int patternLength,
                       int multi,
                       float cooldown)
        Create an aimed pattern
        Parameters:
        speed - Speed of the bullets
        range - Distance each bullet travels
        timeBetweenShots - Time before the next shot
        patternLength - How many shots in the pattern
        multi - How many bullets per shot (spread)
        cooldown - Time after pattern to wait before firing the next pattern
      • Pattern

        public Pattern​(java.lang.Boolean clockwise,
                       int startAngle,
                       int rotations,
                       int speed,
                       int range,
                       float timeBetweenShots,
                       int multi,
                       float cooldown)
        Create a spiral pattern
        Parameters:
        clockwise - Should the spiral spin clockwise?
        startAngle - Starting direction of the spiral
        rotations - How many full rotations to perform
        speed - Speed of the bullets
        range - Distance each bullet travels
        timeBetweenShots - Time before the next shot
        multi - How many bullets per shot (spread)
        cooldown - Time after pattern to wait before firing the next pattern
    • Method Detail

      • bulletSet

        public Bullet[] bulletSet​(int set)
        Parameters:
        set - The set of bullets to fire
        Returns:
        Set of bullets to fire
      • aimedSet

        public Bullet[] aimedSet​(int set,
                                 com.badlogic.gdx.math.Vector2 aimDir)
        Parameters:
        set - The set of bullets to fire
        aimDir - The direction the bullets should fire
        Returns:
        Set of aimed bullets to fire
      • getAim

        public java.lang.Boolean getAim()
      • getBullets

        public Bullet[][] getBullets()
      • getWaitTime

        public float getWaitTime()
      • getCooldown

        public float getCooldown()