C# Class Server.GameObject

Summary description for GameObject.
Inheritance: Object
Mostrar archivo Open project: pmyoung/Advanced-Game-Project Class Usage Examples

Public Properties

Property Type Description
angle float
id int
mass int
radius int
speedX float
speedY float
spriteID int
x float
y float

Public Methods

Method 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 method

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
return System

calculateGravity() public method

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

checkCollision() public method

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
return bool

outOfBounds() public method

public outOfBounds ( ) : void
return void

updatePosition() public method

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
return void

Property Details

angle public_oe property

public float angle
return float

id public_oe property

public int id
return int

mass public_oe property

public int mass
return int

radius public_oe property

public int radius
return int

speedX public_oe property

public float speedX
return float

speedY public_oe property

public float speedY
return float

spriteID public_oe property

public int spriteID
return int

x public_oe property

public float x
return float

y public_oe property

public float y
return float