C# Class Server.GameObject

Summary description for GameObject.
Inheritance: Object
Afficher le fichier Open project: pmyoung/Advanced-Game-Project Class Usage Examples

Méthodes publiques

Свойство Type Description
angle float
id int
mass int
radius int
speedX float
speedY float
spriteID int
x float
y float

Méthodes publiques

Méthode Description
GameObject ( ) : System

GameObject() initializes a new ID for every GameObject object which is one more than the previous ID.

This sets the IDs so that they will always be unique.

calculateGravity ( ) : void

calculateGravity() modifies acceleration rates of game objects based on gravity effect

checkCollision ( GameObject object2 ) : bool

checkCollision() checks the collision between two GameObjects.

Collision detection is based upon the radius of the objects and the distance between them.

outOfBounds ( ) : void
updatePosition ( ) : void

updatePosition() updates the GameObjects position based off of its current speed.

At this time, function is not called. In the future, this method might handle all movement for the GameObjects

Method Details

GameObject() public méthode

GameObject() initializes a new ID for every GameObject object which is one more than the previous ID.
This sets the IDs so that they will always be unique.
public GameObject ( ) : System
Résultat System

calculateGravity() public méthode

calculateGravity() modifies acceleration rates of game objects based on gravity effect
public calculateGravity ( ) : void
Résultat void

checkCollision() public méthode

checkCollision() checks the collision between two GameObjects.
Collision detection is based upon the radius of the objects and the distance between them.
public checkCollision ( GameObject object2 ) : bool
object2 GameObject An instance to a GameObject
Résultat bool

outOfBounds() public méthode

public outOfBounds ( ) : void
Résultat void

updatePosition() public méthode

updatePosition() updates the GameObjects position based off of its current speed.
At this time, function is not called. In the future, this method might handle all movement for the GameObjects
public updatePosition ( ) : void
Résultat void

Property Details

angle public_oe property

public float angle
Résultat float

id public_oe property

public int id
Résultat int

mass public_oe property

public int mass
Résultat int

radius public_oe property

public int radius
Résultat int

speedX public_oe property

public float speedX
Résultat float

speedY public_oe property

public float speedY
Résultat float

spriteID public_oe property

public int spriteID
Résultat int

x public_oe property

public float x
Résultat float

y public_oe property

public float y
Résultat float