Class UserControlledShooter

    • Constructor Detail

      • UserControlledShooter

        public UserControlledShooter​(int spritesPerDir,
                                     int height)
        Creates a player. The parameters are for the lower half of the player.
        Parameters:
        spritesPerDir -
        height -
    • Method Detail

      • spawn

        public UserControlledShooter spawn​(Point point)
        Description copied from class: AbstractEntity
        Add this entity to the map-> let it spawn
        Overrides:
        spawn in class MovableEntity
        Parameters:
        point - the point in the game world where the object is. If it was previously set this is ignored.
        Returns:
        returns itself
      • walk

        public void walk​(boolean up,
                         boolean down,
                         boolean left,
                         boolean right,
                         float walkingspeed,
                         float dt)
        Description copied from interface: Controllable
        Lets the object walk. Replaces the horizontal movement.
        Specified by:
        walk in interface Controllable
        Parameters:
        up - move up?
        down - move down?
        left - move left?
        right - move right?
        walkingspeed - the higher the speed the bigger the steps. Should be in m/s.
      • getAiming

        public com.badlogic.gdx.math.Vector3 getAiming​()
        Getting aim relative to middle of view by reading mouse position. If no camera is configured dircetion of head.
        Overrides:
        getAiming in class MovableEntity
        Returns:
      • update

        public void update​(float dt)
        Description copied from class: MovableEntity
        Updates the character. Applies gravitation.
        Overrides:
        update in class MovableEntity
        Parameters:
        dt - time since last update in ms
      • setCamera

        public void setCamera​(Camera camera)
        Set the camera which is renderin the player to calculate the aiming. If camera is null
        Parameters:
        camera -
      • getCamera

        public Camera getCamera​()
        Get the camera used to identify the aiming direction.
        Returns:
      • getWeapon

        public Weapon getWeapon​()
        Returns:
      • equipWeapon

        public void equipWeapon​(Weapon weapon)
        Gives the player a weapon. Reloads if not loaded.
        Parameters:
        weapon -