C# 클래스 SunsetHigh.FreeMovingSprite

A child of Sprite that has the ability to move around the scene through preprogrammed directions or through user control. Can move with speed and acceleration independent of framerate - the units for these quantities are pixels/sec and pixels/(sec^2).
상속: Sprite
파일 보기 프로젝트 열기: ErraticUnicorn/MOSH 1 사용 예제들

공개 메소드들

메소드 설명
FreeMovingSprite ( ) : System
FreeMovingSprite ( int x, int y ) : System
FreeMovingSprite ( int x, int y, float speed, float accel ) : System
FreeMovingSprite ( int x, int y, int width, int height ) : System
FreeMovingSprite ( int x, int y, int width, int height, float speed, float accel ) : System
cancelMoveToDestination ( ) : void
getAcceleration ( ) : float
getSpeed ( ) : float
move ( Direction dir, float elapsed, bool collide = true ) : bool

Moves this Sprite a given Direction. Optional parameter sets it to collide with the scene and characters in the scene.

move ( float angle, float elapsed, bool collide = true ) : bool

Moves this Sprite a given angle (0 to 2 pi). Optional parameter sets it to collide with the scene and characters in the scene.

moveToDestination ( int x, int y, System.Action postExecute, bool collide = false ) : void
moveToDestination ( int x, int y, float time, System.Action postExecute, bool collide = false ) : void
reset ( ) : void
setAcceleration ( float accel ) : void
setSpeed ( float speed ) : void
update ( float elapsed ) : void

비공개 메소드들

메소드 설명
moveAngleHelper ( float angle, float speed, float elapsed, bool collide = true ) : bool
moveDirectionHelper ( Direction dir, float speed, float elapsed, bool collide = true ) : bool

메소드 상세

FreeMovingSprite() 공개 메소드

public FreeMovingSprite ( ) : System
리턴 System

FreeMovingSprite() 공개 메소드

public FreeMovingSprite ( int x, int y ) : System
x int
y int
리턴 System

FreeMovingSprite() 공개 메소드

public FreeMovingSprite ( int x, int y, float speed, float accel ) : System
x int
y int
speed float
accel float
리턴 System

FreeMovingSprite() 공개 메소드

public FreeMovingSprite ( int x, int y, int width, int height ) : System
x int
y int
width int
height int
리턴 System

FreeMovingSprite() 공개 메소드

public FreeMovingSprite ( int x, int y, int width, int height, float speed, float accel ) : System
x int
y int
width int
height int
speed float
accel float
리턴 System

cancelMoveToDestination() 공개 메소드

public cancelMoveToDestination ( ) : void
리턴 void

getAcceleration() 공개 메소드

public getAcceleration ( ) : float
리턴 float

getSpeed() 공개 메소드

public getSpeed ( ) : float
리턴 float

move() 공개 메소드

Moves this Sprite a given Direction. Optional parameter sets it to collide with the scene and characters in the scene.
public move ( Direction dir, float elapsed, bool collide = true ) : bool
dir Direction Direction to move the Character
elapsed float Time that has elapsed since last update, in seconds
collide bool Specifies whether the Sprite should collide with objects in the scene
리턴 bool

move() 공개 메소드

Moves this Sprite a given angle (0 to 2 pi). Optional parameter sets it to collide with the scene and characters in the scene.
public move ( float angle, float elapsed, bool collide = true ) : bool
angle float Angle in radians, from 0 to 2 pi, to move the Character
elapsed float Time that has elapsed since last update, in seconds
collide bool Specifies whether the Sprite should collide with objects in the scene
리턴 bool

moveToDestination() 공개 메소드

public moveToDestination ( int x, int y, System.Action postExecute, bool collide = false ) : void
x int
y int
postExecute System.Action
collide bool
리턴 void

moveToDestination() 공개 메소드

public moveToDestination ( int x, int y, float time, System.Action postExecute, bool collide = false ) : void
x int
y int
time float
postExecute System.Action
collide bool
리턴 void

reset() 공개 메소드

public reset ( ) : void
리턴 void

setAcceleration() 공개 메소드

public setAcceleration ( float accel ) : void
accel float
리턴 void

setSpeed() 공개 메소드

public setSpeed ( float speed ) : void
speed float
리턴 void

update() 공개 메소드

public update ( float elapsed ) : void
elapsed float
리턴 void