C# Class SunsetHigh.Projectile

Inheritance: FreeMovingSprite
Show file Open project: ErraticUnicorn/MOSH Class Usage Examples

Public Methods

Method Description
Projectile ( ) : System

Initializes a Projectile at the origin with a default speed and heading east.

Projectile ( float speed, Direction dir ) : System

Initializes a Projectile with the given speed and direction

Projectile ( float speed, float angle ) : System

Initializes a Projectile with the given speed and angle

Projectile ( int x, int y, float speed, Direction dir ) : System

Initializes a Projectile with a given position, speed, and direction

Projectile ( int x, int y, float speed, float angle ) : System

Initializes a Projectile with a given position, speed, and angle

Projectile ( int x, int y, int width, int height ) : System

Initializes a Projectile with a given position and dimensions, a default speed heading east

Projectile ( int x, int y, int width, int height, float speed, Direction dir ) : System

Initializes a Projectile with a given position, dimensions, speed, and angle

Projectile ( int x, int y, int width, int height, float speed, float angle ) : System

Initializes a Projectile with a given position, dimensions, speed, and angle

addCollideEvent ( ProjectileCollideEvent e ) : void
getAngle ( ) : float
getDirection ( ) : Direction
onCollide ( IInteractable other ) : void
setAngle ( float angle ) : void
setCollideEvent ( ProjectileCollideEvent e ) : void
setDirection ( Direction dir ) : void
update ( float elapsed ) : void

Method Details

Projectile() public method

Initializes a Projectile at the origin with a default speed and heading east.
public Projectile ( ) : System
return System

Projectile() public method

Initializes a Projectile with the given speed and direction
public Projectile ( float speed, Direction dir ) : System
speed float A positive speed (in pixels per second)
dir Direction A direction in which it will move
return System

Projectile() public method

Initializes a Projectile with the given speed and angle
public Projectile ( float speed, float angle ) : System
speed float A positive speed (in pixels per second)
angle float An angle in radians (from 0 to 2 PI)
return System

Projectile() public method

Initializes a Projectile with a given position, speed, and direction
public Projectile ( int x, int y, float speed, Direction dir ) : System
x int X coordinate of the top-left corner
y int Y coordinate of the top-left corner
speed float A positive speed (in pixels per second)
dir Direction A direction in which it will move
return System

Projectile() public method

Initializes a Projectile with a given position, speed, and angle
public Projectile ( int x, int y, float speed, float angle ) : System
x int X coordinate of the top-left corner
y int Y coordinate of the top-left corner
speed float A positive speed (in pixels per second)
angle float An angle in radians (from 0 to 2 PI)
return System

Projectile() public method

Initializes a Projectile with a given position and dimensions, a default speed heading east
public Projectile ( int x, int y, int width, int height ) : System
x int X coordinate of the top-left corner
y int Y coordinate of the top-left corner
width int Width in pixels
height int Height in pixels
return System

Projectile() public method

Initializes a Projectile with a given position, dimensions, speed, and angle
public Projectile ( int x, int y, int width, int height, float speed, Direction dir ) : System
x int X coordinate of the top-left corner
y int Y coordinate of the top-left corner
width int Width in pixels
height int Height in pixels
speed float A positive speed (in pixels per second)
dir Direction A direction in which it will move
return System

Projectile() public method

Initializes a Projectile with a given position, dimensions, speed, and angle
public Projectile ( int x, int y, int width, int height, float speed, float angle ) : System
x int X coordinate of the top-left corner
y int Y coordinate of the top-left corner
width int Width in pixels
height int Height in pixels
speed float A positive speed (in pixels per second)
angle float An angle in radians (from 0 to 2 PI)
return System

addCollideEvent() public method

public addCollideEvent ( ProjectileCollideEvent e ) : void
e ProjectileCollideEvent
return void

getAngle() public method

public getAngle ( ) : float
return float

getDirection() public method

public getDirection ( ) : Direction
return Direction

onCollide() public method

public onCollide ( IInteractable other ) : void
other IInteractable
return void

setAngle() public method

public setAngle ( float angle ) : void
angle float
return void

setCollideEvent() public method

public setCollideEvent ( ProjectileCollideEvent e ) : void
e ProjectileCollideEvent
return void

setDirection() public method

public setDirection ( Direction dir ) : void
dir Direction
return void

update() public method

public update ( float elapsed ) : void
elapsed float
return void