C# 클래스 MyGame.BulletsManager

This class represent the bullet manager that manages creating and calling updates on bullets, also removing bullet at collision detected.
상속: Microsoft.Xna.Framework.DrawableGameComponent, IEvent
파일 보기 프로젝트 열기: mahmoudbahaa/XNA-Game-project 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
events List

공개 메소드들

메소드 설명
AddBullet ( Vector3 position, Vector3 rotation, Vector3 direction ) : void

Add a new bullet at the specified position, rotation and direction

BulletsManager ( MyGame game ) : System

Constructor that initialize the bullet manager

Draw ( GameTime gameTime ) : void

This method renders the current state.

Update ( GameTime gameTime ) : void

Allows the component to run logic.

addEvent ( Event ev ) : void

Add event to the event queue

보호된 메소드들

메소드 설명
FireShots ( ) : void

Fire a new bullet if the specified event(C_ATTACK_BULLET_END) was received

UpdateShots ( GameTime gameTime ) : void

update the bullet if the bulltet out of range or collide with the monster remove it

메소드 상세

AddBullet() 공개 메소드

Add a new bullet at the specified position, rotation and direction
public AddBullet ( Vector3 position, Vector3 rotation, Vector3 direction ) : void
position Vector3 initial position of the new bullet
rotation Vector3 rotation of the new bullet
direction Vector3 Direction in which the bullet will move
리턴 void

BulletsManager() 공개 메소드

Constructor that initialize the bullet manager
public BulletsManager ( MyGame game ) : System
game MyGame Instance of MyGame this game component is attached to
리턴 System

Draw() 공개 메소드

This method renders the current state.
public Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The elapsed game time.
리턴 void

FireShots() 보호된 메소드

Fire a new bullet if the specified event(C_ATTACK_BULLET_END) was received
protected FireShots ( ) : void
리턴 void

Update() 공개 메소드

Allows the component to run logic.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The gametime.
리턴 void

UpdateShots() 보호된 메소드

update the bullet if the bulltet out of range or collide with the monster remove it
protected UpdateShots ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The game time
리턴 void

addEvent() 공개 메소드

Add event to the event queue
public addEvent ( Event ev ) : void
ev Event Event to be added
리턴 void

프로퍼티 상세

events 보호되어 있는 프로퍼티

protected List events
리턴 List