C# Класс Server.GameObject

Summary description for GameObject.
Наследование: Object
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
angle float
id int
mass int
radius int
speedX float
speedY float
spriteID int
x float
y float

Открытые методы

Метод Описание
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

Описание методов

GameObject() публичный Метод

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
Результат System

calculateGravity() публичный Метод

calculateGravity() modifies acceleration rates of game objects based on gravity effect
public calculateGravity ( ) : void
Результат void

checkCollision() публичный Метод

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
Результат bool

outOfBounds() публичный Метод

public outOfBounds ( ) : void
Результат void

updatePosition() публичный Метод

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
Результат void

Описание свойств

angle публичное свойство

public float angle
Результат float

id публичное свойство

public int id
Результат int

mass публичное свойство

public int mass
Результат int

radius публичное свойство

public int radius
Результат int

speedX публичное свойство

public float speedX
Результат float

speedY публичное свойство

public float speedY
Результат float

spriteID публичное свойство

public int spriteID
Результат int

x публичное свойство

public float x
Результат float

y публичное свойство

public float y
Результат float