C# 클래스 PantheonPrototype.Entity

The Entity defines an object within the game. It has physical presence in the game as a Sprite and can collide with other Entities.
파일 보기 프로젝트 열기: Bacon41/PantheonPrototype

보호된 프로퍼티들

프로퍼티 타입 설명
actionPoint Vector2
boundingBox Microsoft.Xna.Framework.Rectangle
characteristics List
currentState string
drawingBox Microsoft.Xna.Framework.Rectangle
prevLocation Vector2
sprite Sprite
toDestroy bool

공개 메소드들

메소드 설명
Draw ( SpriteBatch canvas ) : void

Draws the entity to its current location.

Entity ( ) : System

A no parameter entity for conveniences sake.

Entity ( Vector2 location, Rectangle drawBox, Rectangle boundingBox ) : System

Constructs a basic entity. This is a more accessible constructor. In general, use this constructor when making new entities.

Entity ( float x, float y, Rectangle drawBox, Rectangle boundingBox ) : System

Constructs a basic entity. This is the technical constructor. Unless you understand exactly how the entity is stored, I recommend using the other constructor.

Load ( Microsoft.Xna.Framework.Content.ContentManager contentManager ) : void

Loads any assets this particular entity needs.

Update ( GameTime gameTime, Pantheon gameReference ) : void

Updates the entity... yeah.

collidesWith ( Entity other ) : bool

Detects collisions between another entity. Uses the rectangle defining sprite to detect collisions.

메소드 상세

Draw() 공개 메소드

Draws the entity to its current location.
public Draw ( SpriteBatch canvas ) : void
canvas Microsoft.Xna.Framework.Graphics.SpriteBatch An initialized sprite batch to draw the sprite upon.
리턴 void

Entity() 공개 메소드

A no parameter entity for conveniences sake.
public Entity ( ) : System
리턴 System

Entity() 공개 메소드

Constructs a basic entity. This is a more accessible constructor. In general, use this constructor when making new entities.
public Entity ( Vector2 location, Rectangle drawBox, Rectangle boundingBox ) : System
location Vector2 The location of the entity relative to global space. Note that the reference point of the entity is the center of the bounding box.
drawBox Microsoft.Xna.Framework.Rectangle The box to which the sprite will be drawn. Only the width and height will be used.
boundingBox Microsoft.Xna.Framework.Rectangle The bounding box of the entity relative to the upper right hand corner of the entity.
리턴 System

Entity() 공개 메소드

Constructs a basic entity. This is the technical constructor. Unless you understand exactly how the entity is stored, I recommend using the other constructor.
public Entity ( float x, float y, Rectangle drawBox, Rectangle boundingBox ) : System
x float The x coordinate of the action point.
y float The y coordinate of the action point.
drawBox Microsoft.Xna.Framework.Rectangle The draw box defines the area to which the sprite /// is drawn relative to the upper left hand corner..
boundingBox Microsoft.Xna.Framework.Rectangle The bounding box relative to the action point.
리턴 System

Load() 공개 메소드

Loads any assets this particular entity needs.
public Load ( Microsoft.Xna.Framework.Content.ContentManager contentManager ) : void
contentManager Microsoft.Xna.Framework.Content.ContentManager
리턴 void

Update() 공개 메소드

Updates the entity... yeah.
public Update ( GameTime gameTime, Pantheon gameReference ) : void
gameTime Microsoft.Xna.Framework.GameTime Even has the option for frame rate, pretty cool eh?
gameReference Pantheon The ugly global game reference of doom.
리턴 void

collidesWith() 공개 메소드

Detects collisions between another entity. Uses the rectangle defining sprite to detect collisions.
public collidesWith ( Entity other ) : bool
other Entity The entity to detect collision with.
리턴 bool

프로퍼티 상세

actionPoint 보호되어 있는 프로퍼티

This is the point around which the sprite is drawn. It functions as the center of the entity and is automatically set to the center of the bounding box.
protected Vector2 actionPoint
리턴 Vector2

boundingBox 보호되어 있는 프로퍼티

Puppies!!! No puppies, actually fruit. Also, this is the bounding box.
protected Rectangle,Microsoft.Xna.Framework boundingBox
리턴 Microsoft.Xna.Framework.Rectangle

characteristics 보호되어 있는 프로퍼티

A list of characteristics which determine what an entity does on collision. Basically, this is a list that determines which collision types to check.
protected List characteristics
리턴 List

currentState 보호되어 있는 프로퍼티

A string representing the current state.
protected string currentState
리턴 string

drawingBox 보호되어 있는 프로퍼티

The box to which the sprite will be drawn.
protected Rectangle,Microsoft.Xna.Framework drawingBox
리턴 Microsoft.Xna.Framework.Rectangle

prevLocation 보호되어 있는 프로퍼티

protected Vector2 prevLocation
리턴 Vector2

sprite 보호되어 있는 프로퍼티

The visual representation of the entity.
protected Sprite sprite
리턴 Sprite

toDestroy 보호되어 있는 프로퍼티

This tells the level that it is dead, and needs to be removed.
protected bool toDestroy
리턴 bool