C# Class Server.GameObject

Summary description for GameObject.
Inheritance: Object
Show file 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 property

public float angle
return float

id public property

public int id
return int

mass public property

public int mass
return int

radius public property

public int radius
return int

speedX public property

public float speedX
return float

speedY public property

public float speedY
return float

spriteID public property

public int spriteID
return int

x public property

public float x
return float

y public property

public float y
return float