C# Class Manic_Shooter.Classes.DefaultEnemy

Inheritance: Sprite, IEnemy
Exibir arquivo Open project: TheGameDevelopmentClub/Manic-Shooter Class Usage Examples

Protected Properties

Property Type Description
_state EnemyState
_weapons List
targetEntryPoint Vector2

Public Methods

Method Description
DefaultEnemy ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, int health ) : System
DefaultEnemy ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, int health, Vector2 targetEntryPoint ) : System
Destroy ( ) : void
Entering ( GameTime gameTime ) : bool
Fire ( System.TimeSpan elapsedTime ) : void

Fires a shot from all available weapons

HorizontalPasses ( GameTime gameTime ) : bool

An enemy movement where the enemy passes horizontally across the screen while firing shots.

LeaveScreen ( System.TimeSpan elapsedTime ) : bool
Update ( GameTime gameTime ) : void

Updates this enemy instance

UpdateWeaponPositions ( ) : void

Updates the position of each of the weapons so they stay in one place relative to the movement of this enemy instance

Private Methods

Method Description
InitializeDefaultEnemy ( Vector2 TargetEntryPoint ) : void

Method Details

DefaultEnemy() public method

public DefaultEnemy ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, int health ) : System
texture Microsoft.Xna.Framework.Graphics.Texture2D
position Vector2
health int
return System

DefaultEnemy() public method

public DefaultEnemy ( Microsoft.Xna.Framework.Graphics.Texture2D texture, Vector2 position, int health, Vector2 targetEntryPoint ) : System
texture Microsoft.Xna.Framework.Graphics.Texture2D
position Vector2
health int
targetEntryPoint Vector2
return System

Destroy() public method

public Destroy ( ) : void
return void

Entering() public method

public Entering ( GameTime gameTime ) : bool
gameTime Microsoft.Xna.Framework.GameTime
return bool

Fire() public method

Fires a shot from all available weapons
public Fire ( System.TimeSpan elapsedTime ) : void
elapsedTime System.TimeSpan The time elapsed since the last update
return void

HorizontalPasses() public method

An enemy movement where the enemy passes horizontally across the screen while firing shots.
public HorizontalPasses ( GameTime gameTime ) : bool
gameTime Microsoft.Xna.Framework.GameTime
return bool

LeaveScreen() public method

public LeaveScreen ( System.TimeSpan elapsedTime ) : bool
elapsedTime System.TimeSpan
return bool

Update() public method

Updates this enemy instance
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The time elapsed since the last update
return void

UpdateWeaponPositions() public method

Updates the position of each of the weapons so they stay in one place relative to the movement of this enemy instance
public UpdateWeaponPositions ( ) : void
return void

Property Details

_state protected_oe property

protected EnemyState _state
return EnemyState

_weapons protected_oe property

protected List _weapons
return List

targetEntryPoint protected_oe property

The target entry point is used while the sprite is entering the screen. Once the sprite reaches this point, it will progress to the next state
protected Vector2 targetEntryPoint
return Vector2