C# Class SunsetHigh.Projectile

Inheritance: FreeMovingSprite
Afficher le fichier Open project: ErraticUnicorn/MOSH Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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

Projectile() public méthode

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
Résultat System

Projectile() public méthode

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)
Résultat System

Projectile() public méthode

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
Résultat System

Projectile() public méthode

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)
Résultat System

Projectile() public méthode

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
Résultat System

Projectile() public méthode

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
Résultat System

Projectile() public méthode

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)
Résultat System

addCollideEvent() public méthode

public addCollideEvent ( ProjectileCollideEvent e ) : void
e ProjectileCollideEvent
Résultat void

getAngle() public méthode

public getAngle ( ) : float
Résultat float

getDirection() public méthode

public getDirection ( ) : Direction
Résultat Direction

onCollide() public méthode

public onCollide ( IInteractable other ) : void
other IInteractable
Résultat void

setAngle() public méthode

public setAngle ( float angle ) : void
angle float
Résultat void

setCollideEvent() public méthode

public setCollideEvent ( ProjectileCollideEvent e ) : void
e ProjectileCollideEvent
Résultat void

setDirection() public méthode

public setDirection ( Direction dir ) : void
dir Direction
Résultat void

update() public méthode

public update ( float elapsed ) : void
elapsed float
Résultat void