C# Class fliXNA_xbox.FlxObject

Inheritance: FlxBasic
Afficher le fichier Open project: konamicode/fliXNA_xbox Class Usage Examples

Méthodes publiques

Свойство Type Description
acceleration FlxPoint
allowCollisions uint
angle float
angularAcceleration float
angularDrag float
angularVelocity float
drag FlxPoint
elasticity float
health float
height float
immovable bool
last FlxPoint
mass float
maxAngular float
maxVelocity FlxPoint
moves bool
path FlxPath
pathAngle float
pathSpeed float
scrollFactor FlxPoint
touching uint
velocity FlxPoint
wasTouching uint
width float
x float
y float

Protected Properties

Свойство Type Description
_flicker bool
_flickerTimer float
_pZero FlxPoint
_pathInc int
_pathMode uint
_pathNodeIndex int
_pathRotate bool
_point FlxPoint
_rect FlxRect

Méthodes publiques

Méthode Description
FlxObject ( float X, float Y, float Width, float Height ) : System

Instantiates a FlxObject

destroy ( ) : void

Override to null out variables manually

draw ( ) : void

Rarely called. Not yet implemented like AS3 Flixel

drawDebug ( FlxCamera Camera = null ) : void

Not yet implemented

flicker ( float Duration = 1.0f ) : void

Flicker this object

followPath ( FlxPath Path, float Speed = 100, uint Mode = PATH_FORWARD, bool AutoRotate = false ) : void
getMidpoint ( FlxPoint Point = null ) : FlxPoint

Retrieve midpoint of this object in world coordinates

getScreenXY ( FlxPoint Point = null, FlxCamera Camera = null ) : FlxPoint

Call this to figure out the on-screen position of the object

hurt ( float Damage ) : void

Reduces the health

isTouching ( uint Direction ) : bool

Check to see if this object is touching a particular surface

justTouched ( uint Direction ) : bool

Check to see if this object just touched a particular surface

onScreen ( FlxCamera Camera = null ) : bool

Check to see if this object is currently on the screen

overlaps ( FlxBasic ObjectOrGroup, bool InScreenSpace = false, FlxCamera Camera = null ) : bool

Checks to see if some FlxObject overlaps this FlxObject or FlxGroup. If the group has a LOT of things in it, it might be faster to use FlxG.ovelaps()

overlapsAt ( float X, float Y, FlxBasic ObjectOrGroup, bool InScreenSpace = false, FlxCamera Camera = null ) : bool

Checks to see if this FlxObject were located at the given position

overlapsPoint ( FlxPoint Point, bool InScreenSpace = false, FlxCamera Camera = null ) : bool

Check to see if a point in 2D world space overlaps this FlxObject

postUpdate ( ) : void

Called right after update()

preUpdate ( ) : void

Called right before update()

reset ( float X, float Y ) : void

Handy function for reviving game objects. Resets their existence flags and position

separate ( FlxObject Object1, FlxObject Object2 ) : bool

The main collision resolution function

separateX ( FlxObject Object1, FlxObject Object2 ) : bool

X-axis component of the object separation process

separateY ( FlxObject Object1, FlxObject Object2 ) : bool

Y-axis component of the object separation process

stopFollowingPath ( bool DestroyPath = false ) : void
update ( ) : void

Méthodes protégées

Méthode Description
advancePath ( bool Snap = true ) : FlxPoint
updatePathMotion ( ) : void

Private Methods

Méthode Description
updateMotion ( ) : void

Internal function for updating the position and speed of this object.

Method Details

FlxObject() public méthode

Instantiates a FlxObject
public FlxObject ( float X, float Y, float Width, float Height ) : System
X float X-coordinate of the object in space
Y float y-coordinate of the object in space
Width float Desired width of the rectangle
Height float Desired height of the rectangle
Résultat System

advancePath() protected méthode

protected advancePath ( bool Snap = true ) : FlxPoint
Snap bool
Résultat FlxPoint

destroy() public méthode

Override to null out variables manually
public destroy ( ) : void
Résultat void

draw() public méthode

Rarely called. Not yet implemented like AS3 Flixel
public draw ( ) : void
Résultat void

drawDebug() public méthode

Not yet implemented
public drawDebug ( FlxCamera Camera = null ) : void
Camera FlxCamera Which Camera - currently only one exists
Résultat void

flicker() public méthode

Flicker this object
public flicker ( float Duration = 1.0f ) : void
Duration float How many seconds
Résultat void

followPath() public méthode

public followPath ( FlxPath Path, float Speed = 100, uint Mode = PATH_FORWARD, bool AutoRotate = false ) : void
Path FlxPath
Speed float
Mode uint
AutoRotate bool
Résultat void

getMidpoint() public méthode

Retrieve midpoint of this object in world coordinates
public getMidpoint ( FlxPoint Point = null ) : FlxPoint
Point FlxPoint
Résultat FlxPoint

getScreenXY() public méthode

Call this to figure out the on-screen position of the object
public getScreenXY ( FlxPoint Point = null, FlxCamera Camera = null ) : FlxPoint
Point FlxPoint Take a FlxPoint object and assign the post-scrolled X and Y values of this object to it
Camera FlxCamera Which Camera - currently only one exists
Résultat FlxPoint

hurt() public méthode

Reduces the health
public hurt ( float Damage ) : void
Damage float Amount to reduce by
Résultat void

isTouching() public méthode

Check to see if this object is touching a particular surface
public isTouching ( uint Direction ) : bool
Direction uint Any of the collision flags (e.g. LEFT, FLOOR, etc)
Résultat bool

justTouched() public méthode

Check to see if this object just touched a particular surface
public justTouched ( uint Direction ) : bool
Direction uint Any of the collision flags (e.g. LEFT, FLOOR, etc)
Résultat bool

onScreen() public méthode

Check to see if this object is currently on the screen
public onScreen ( FlxCamera Camera = null ) : bool
Camera FlxCamera Which Camera - currently only one exists
Résultat bool

overlaps() public méthode

Checks to see if some FlxObject overlaps this FlxObject or FlxGroup. If the group has a LOT of things in it, it might be faster to use FlxG.ovelaps()
public overlaps ( FlxBasic ObjectOrGroup, bool InScreenSpace = false, FlxCamera Camera = null ) : bool
ObjectOrGroup FlxBasic The object or group being tested
InScreenSpace bool Whether to take scroll factors into account.
Camera FlxCamera Which Camera - currently only one exists
Résultat bool

overlapsAt() public méthode

Checks to see if this FlxObject were located at the given position
public overlapsAt ( float X, float Y, FlxBasic ObjectOrGroup, bool InScreenSpace = false, FlxCamera Camera = null ) : bool
X float X position you want to check
Y float Y position you want to check
ObjectOrGroup FlxBasic The object or group being tested
InScreenSpace bool Whether to take scroll factors into account.
Camera FlxCamera Which Camera - currently only one exists
Résultat bool

overlapsPoint() public méthode

Check to see if a point in 2D world space overlaps this FlxObject
public overlapsPoint ( FlxPoint Point, bool InScreenSpace = false, FlxCamera Camera = null ) : bool
Point FlxPoint The point in world space you want to check
InScreenSpace bool Whether to take scroll factors into account.
Camera FlxCamera Which Camera - currently only one exists
Résultat bool

postUpdate() public méthode

Called right after update()
public postUpdate ( ) : void
Résultat void

preUpdate() public méthode

Called right before update()
public preUpdate ( ) : void
Résultat void

reset() public méthode

Handy function for reviving game objects. Resets their existence flags and position
public reset ( float X, float Y ) : void
X float
Y float
Résultat void

separate() public static méthode

The main collision resolution function
public static separate ( FlxObject Object1, FlxObject Object2 ) : bool
Object1 FlxObject
Object2 FlxObject
Résultat bool

separateX() public static méthode

X-axis component of the object separation process
public static separateX ( FlxObject Object1, FlxObject Object2 ) : bool
Object1 FlxObject
Object2 FlxObject
Résultat bool

separateY() public static méthode

Y-axis component of the object separation process
public static separateY ( FlxObject Object1, FlxObject Object2 ) : bool
Object1 FlxObject
Object2 FlxObject
Résultat bool

stopFollowingPath() public méthode

public stopFollowingPath ( bool DestroyPath = false ) : void
DestroyPath bool
Résultat void

update() public méthode

public update ( ) : void
Résultat void

updatePathMotion() protected méthode

protected updatePathMotion ( ) : void
Résultat void

Property Details

_flicker protected_oe property

Internal helper for Retro-styled flickering
protected bool _flicker
Résultat bool

_flickerTimer protected_oe property

Internal helper for Retro-styled flickering
protected float _flickerTimer
Résultat float

_pZero protected_oe static_oe property

Should always represent (0,0) - useful for different things, for avoideing unnecessary new calls
protected static FlxPoint _pZero
Résultat FlxPoint

_pathInc protected_oe property

Internal helper for node navigation, specifically yoyo and backwards movement
protected int _pathInc
Résultat int

_pathMode protected_oe property

Internal tracker for path behavior flags (looping, horizontal only, etc)
protected uint _pathMode
Résultat uint

_pathNodeIndex protected_oe property

Internal helper, tracks which node of the path this object is moving toward
protected int _pathNodeIndex
Résultat int

_pathRotate protected_oe property

Internal flag for whether the object's angle should be adjusted to the path angle during path follow behavior
protected bool _pathRotate
Résultat bool

_point protected_oe property

Pre-allocated x-y point container to be used however you like
protected FlxPoint _point
Résultat FlxPoint

_rect protected_oe property

Pre-allocated rectangle container to be used however you like
protected FlxRect,fliXNA_xbox _rect
Résultat FlxRect

acceleration public_oe property

How fast the speed of this object is changing. Useful for smooth movement and gravity
public FlxPoint acceleration
Résultat FlxPoint

allowCollisions public_oe property

Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating collision directions. Use bitwise operators to check the values stored here. Useful for things like one-way platforms (e.g. allowCollisions = UP;) The accessor "solid" just flips this variable between NONE and ANY/
public uint allowCollisions
Résultat uint

angle public_oe property

The angle of the sprite, used for rotation
public float angle
Résultat float

angularAcceleration public_oe property

How fast the spin should change
public float angularAcceleration
Résultat float

angularDrag public_oe property

Like drag but for spinning
public float angularDrag
Résultat float

angularVelocity public_oe property

How fast you want the sprite to spin
public float angularVelocity
Résultat float

drag public_oe property

This is like deceleration that is only applied when acceleration is not affecting the sprite.
public FlxPoint drag
Résultat FlxPoint

elasticity public_oe property

The bounciness of this object, Only affects collisions. Default is 0, or "not bouncy at all."
public float elasticity
Résultat float

health public_oe property

Handy for storing health percentage or armor points or whatever
public float health
Résultat float

height public_oe property

The height of this object
public float height
Résultat float

immovable public_oe property

Whether this object will move/alter position after a collision
public bool immovable
Résultat bool

last public_oe property

Important variable for collision processing. Set automatically during preUpdate()
public FlxPoint last
Résultat FlxPoint

mass public_oe property

Virtual mass of this object. Defauly value is 1. Currently only used with elasticity during collision resolution. Change at your own risk; effects seem crazy unpredictable so far!
public float mass
Résultat float

maxAngular public_oe property

Use in conjunction with angularAcceleration fir fluid spin speed control
public float maxAngular
Résultat float

maxVelocity public_oe property

Max speed of this object
public FlxPoint maxVelocity
Résultat FlxPoint

moves public_oe property

Set this to false if you want to skip automatic motion/movement stuff. Default is true for FlxObject and FlxSprite. Default is false for FlxText, FlxTileblock, FlxTilemap, and FlxSound.
public bool moves
Résultat bool

path public_oe property

A reference to a path object. Null by default, assigned by followPath()
public FlxPath path
Résultat FlxPath

pathAngle public_oe property

The angle in degrees between this object and the next node, where 0 is directly North, 90 is East
public float pathAngle
Résultat float

pathSpeed public_oe property

The speed at which the object is moving on the path. When an object completes a non-looping path circuit, the pathSpeed will be zeroed out, but the path reference will NOT be nulled out. So pathSpeed is a good way to check if this object is currently following a path of not
public float pathSpeed
Résultat float

scrollFactor public_oe property

How much this object is affected by the camera subsystem. 0 means it never moves, like a HUD element or background graphic. 1 means it scrolls along at the same speed as the foreground layer. (1,1) by default. CURRENTLY NOT IMPLEMENTED
public FlxPoint scrollFactor
Résultat FlxPoint

touching public_oe property

Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating surface contacts. Use bitwise operators to check the values stored here, or use touching(), justStartedTouching(), etc. You can even use them broadly as boolean values if you're feeling saucy!
public uint touching
Résultat uint

velocity public_oe property

Basic speed of this object
public FlxPoint velocity
Résultat FlxPoint

wasTouching public_oe property

Bit field of flags (use with UP, DOWN, LEFT, RIGHT, etc) indicating surface contacts from the previous game loop step. Use bitwise operators to check the values stored here, or use touching(), justStartedTouching(), etc. You can even use them broadly as boolean values if you're feeling saucy!
public uint wasTouching
Résultat uint

width public_oe property

The width of this object
public float width
Résultat float

x public_oe property

X position of the upper left corner of this object in world space
public float x
Résultat float

y public_oe property

Y position of the upper left corner of this object in world space
public float y
Résultat float