Package | verlocity.ents.items |
Class | public class Pickup |
Inheritance | Pickup DisplayEntity DynamicEntity Entity Object |
Method | Defined By | ||
---|---|---|---|
_Dispose():void [override]
Cleans the entity's data. | DisplayEntity | ||
_Update():void [override]
Handles moving towards the activator entitiy. | Pickup | ||
addChild(disp:DisplayObject):void
Adds a child display object
| DisplayEntity | ||
BitmapDrawRect(drawX:int, drawY:int, drawWidth:Number, drawHeight:Number, uiColor:uint):void
Draws a simple rectangle in the drawable bitmap (see CreateDrawableBitmap). | DisplayEntity | ||
Clear():void
Clears the graphics of the display object of the entity. | DisplayEntity | ||
ClearBounds():void
Clears the boundaries of the entity. | DynamicEntity | ||
Construct():void
Called before the entity is spawned to setup the constants of the entity. | Entity | ||
CreateDrawableBitmap(iWidth:int, iHeight:int, bOverrideDisplay:Boolean = false):void
Creates a bitmap canvas for graphic drawing. | DisplayEntity | ||
DeInit():void
Called when the entity is deleted. | Entity | ||
DisplayIs(cClassName:Class):Boolean
Returns if the display is a specified base class. | DisplayEntity | ||
DrawRect(drawX:int, drawY:int, drawWidth:Number, drawHeight:Number, nAlpha:Number = 1, uiColor:uint):void
Draws a simple rectangle in the display object. | DisplayEntity | ||
EmitSound(sSound:*, nStartVolume:Number = 1, bLoops:Boolean = false, bParent:Boolean = false, bFadeIn:Boolean = false):void
Plays a sound at the location of the entity. | DynamicEntity | ||
EnableCollision(bEnable:Boolean = true):void
Enables/disables calculations for collision. | DynamicEntity | ||
EnablePhysics(bEnable:Boolean = true, bRemovePhysicsObj:Boolean = true):void
Enables/disables calculations for physics. | DynamicEntity | ||
EnableUpdate(bUpdate:Boolean = true):void
Sets if the entity will update each engine tick. | Entity | ||
FadeColors(oldColor:uint, newColor:uint, amount:Number = 1):void
Fades between two colors (hex). | DisplayEntity | ||
FadeColorsRGB(oldR:int, oldG:int, oldB:int, newR:int, newG:int, newB:int, amount:Number = 1):void
Fades between two RGB values. | DisplayEntity | ||
FadeRemove(nSetFadeSpeed:Number = 0.05):void
Removes the entity with a fading effect. | DisplayEntity | ||
GetAlpha():Number
Returns the overall transparency of the entity. | DisplayEntity | ||
GetAngle():Point
Returns the angle of rotation as a unit vector. | DisplayEntity | ||
GetClass():Object
Returns the class of the entity. | Entity | ||
GetColor():uint
Returns the color of the entity. | DisplayEntity | ||
GetMouseRotation():Number
Returns the rotation (0-360) from the relation of the mouse and the entity. | DynamicEntity | ||
GetOwner():Object
Returns the current owner of the entity. | Entity | ||
Returns the physics object
| DynamicEntity | ||
GetPos():Point
Returns the current position as a point
| DynamicEntity | ||
GetScale():Number
Returns the current scale of the entity. | DisplayEntity | ||
GetType():String
Returns the current string type of the entity. | Entity | ||
HasEnded():Boolean
Returns if the MovieClip/_bitmapClip
| DisplayEntity | ||
HasMoved():Boolean
Returns if the entity has moved (determined by its previous position set)
This is used to optimize collision and physics calculations
| DynamicEntity | ||
Init():void
Called when the entity is first registered/spawned. | Entity | ||
Is(cClass:Class):Boolean
Returns if the entity matches a class. | Entity | ||
IsBeingRemoved():Boolean
Returns if the entity is being fade removed. | DisplayEntity | ||
IsColliding(ent:DynamicEntity):Boolean
Returns the method of basic collision between other types
| DynamicEntity | ||
IsCollisionEnabled():Boolean
Returns if collision is enabled
| DynamicEntity | ||
IsCollisionFlagOn(iCollisionFlag:int):Boolean
Returns if a collision flag is enabled or not. | DynamicEntity | ||
IsDead():Boolean
Returns if the entity is dead. | Entity | ||
IsHealthZero():Boolean
Returns if the health is zero. | Entity | ||
IsOnBottomBoundary():Boolean | DynamicEntity | ||
IsOnBoundary():Boolean | DynamicEntity | ||
IsOnLeftBoundary():Boolean | DynamicEntity | ||
IsOnRightBoundary():Boolean | DynamicEntity | ||
IsOnScreen():Boolean
Returns if the entity is within the boundaries of the screen. | DynamicEntity | ||
IsOnTopBoundary():Boolean | DynamicEntity | ||
IsOnXBoundary():Boolean | DynamicEntity | ||
IsOnYBoundary():Boolean | DynamicEntity | ||
IsPhysicsEnabled():Boolean
Returns if physics is enabled
| DynamicEntity | ||
IsPlaying():Boolean
Returns if the display object (if it's a MovieClip/_bitmapClip) is currently playing
| DisplayEntity | ||
IsProtected():Boolean
Returns if the entity is protected. | Entity | ||
IsSpawned():Boolean
Returns if the entity was spawned. | DisplayEntity | ||
IsT(sCheckType:String):Boolean
Returns if the entity is matches a type (lowercase only). | Entity | ||
IsUpdating():Boolean
Returns if the entity is updating. | Entity | ||
Kill(bPlayAnim:Boolean = false):void
Plays the death animation of the entity and removes it. | DisplayEntity | ||
OnCollide(ent:*):void [override]
When the pickup collided with the activator entity. | Pickup | ||
Pause():void
Pauses the display object (if it's a MovieClip/_bitmapClip and was playing)
| DisplayEntity | ||
Play():void
Plays the display object (if it's a MovieClip/BitmapClip)
| DisplayEntity | ||
Remove():void
Marks the entity for removal. | Entity | ||
RemoveAllColorProperties():void
Removes the color transforms, tinting, and alpha changes applied to the entity. | DisplayEntity | ||
RemoveAllHealth():void
Removes all health of the entity. | Entity | ||
removeChild(disp:DisplayObject):void
Removes a child display object
| DisplayEntity | ||
RemoveDisplay():void
Removes all displays of the entity. | DisplayEntity | ||
RemoveDrawableBitmap():void
Removes the bitmap drawable, if it exists. | DisplayEntity | ||
RemoveFilters():void
Removes the filters of the display object
| DisplayEntity | ||
RemoveOffScreen(bShouldRemove:Boolean = true, iPadding:int = 100):void
Tells the entity to remove itself when its off screen. | DynamicEntity | ||
RemoveTint():void
Removes any tinting applied. | DisplayEntity | ||
Reset():void [override]
Resets the entity to its original values. | DisplayEntity | ||
ResetHealth():void
Resets the entity's health to the default health. | Entity | ||
ResetPos():void
Resets the entity to its initial position. | DynamicEntity | ||
ResetScale():void
Resets the scale of the entity to defaults (1). | DisplayEntity | ||
Respawn():void
Calls DeInit then Init. | DisplayEntity | ||
Resume():void
Resumes the display object (if it's a MovieClip/_bitmapClip and was playing)
| DisplayEntity | ||
SetAlpha(nSetAlpha:Number):void
Sets the overall transparency of the entity. | DisplayEntity | ||
SetBounds(rectSetBounds:Rectangle, iInnerPadding:int = 0):void
Sets the screen boundaries of the entity. | DynamicEntity | ||
SetCollisionFlags(iFlags:int):void
Set collision flags. | DynamicEntity | ||
SetCollisionRect(rect:Rectangle, nOffsetX:Number = 0, nOffsetY:Number = 0):void
Sets the collision rect (required for collision)
| DynamicEntity | ||
SetColor(newColor:uint, nAlpha:Number = 1):void
Sets the color of the entity. | DisplayEntity | ||
SetColorRGB(r:int = 255, g:int = 255, b:int = 255, nAlpha:Number = 1):void
Sets the color of the entity with RGB. | DisplayEntity | ||
SetDefaultHealth(setHealth:int = 100):void
Sets the default health of this entity. | Entity | ||
SetDisplayObject(dispObject:DisplayObject, bBitmap:Boolean = false, iFPS:int = 60):void
Sets the display object of the entity - i.e. | DisplayEntity | ||
SetFilters(... filters):void
Sets the filters of the display object. | DisplayEntity | ||
SetFrame(iFrame:int, bPlayAnim:Boolean = true):void
Sets the display object (if it's a MovieClip/BitmapClip) to a specific frame number. | DisplayEntity | ||
SetFrameLabel(sString:String, bPlayAnim:Boolean = true):void
Sets the display object (if it's a MovieClip/BitmapClip) to a specific labeled frame. | DisplayEntity | ||
SetHealth(newHealth:int):void
Sets the health value of this entity. | Entity | ||
SetOwner(newOwner:Object):void
Sets the owner of the entity. | Entity | ||
SetPhysicsProperties(nMass:Number, pVelocityDirection:Point, nVelocityMagnitude:Number):void
Sets the physicial properies of this entity
| DynamicEntity | ||
SetPickup(entSetActivator:DynamicEntity, bShouldMoveTowards:Boolean = false, iSetMinMoveDist:int = 0, iSetMoveSpeed:int = 20):void
Sets the pickup data to apply to this pickup. | Pickup | ||
SetPos(nSetPosX:Number, nSetPosY:Number):void
Sets the X and Y position of the entity
| DynamicEntity | ||
SetProtected(bProtected:Boolean = true):void
Protects an entity from being removed by clean up
calls, such as CleanSlate. | Entity | ||
SetRandomFrame(bPlayAnim:Boolean = false):void
Sets the display object (if it's a MovieClip/BitmapClip) to a random frame. | DisplayEntity | ||
SetRemoveTime(iMilliSecs:int, bFadeOut:Boolean = false, nSetFadeSpeed:Number = 0.05):void
Sets the time the entity should be removed in. | DisplayEntity | ||
SetRotation(iRot:int):void
Sets the rotation of the entity. | DisplayEntity | ||
SetScale(nSetScale:Number):void
Sets the scale of the entity. | DisplayEntity | ||
SetTint(amount:Number, newColor:uint):void
Sets the tint of the entity. | DisplayEntity | ||
SetTintRGB(amount:Number, r:int = 255, g:int = 255, b:int = 255):void
Sets the tint of the entity with RGB. | DisplayEntity | ||
SetType(sSetType:String):void
Sets the string type of the entity. | Entity | ||
SetupCollision():void
Sets up the collision bounds. | DisplayEntity | ||
Spawn(sSetLayer:String, bSpawnOnBottom:Boolean = false):void
Spawns the entity into a layer and calls Init. | DisplayEntity | ||
Stop():void
Stops the display object (if it's a MovieClip/_bitmapClip)
| DisplayEntity | ||
StopAllSounds():void
Stops all sounds that are emitting from this entity. | DynamicEntity | ||
SwapLayer(sSetLayer:String, bSpawnOnBottom:Boolean = false):void
Swaps the current layer of the entity. | DisplayEntity | ||
TakeDamage(iDamageAmount:int):void
Subtracts the current health. | Entity | ||
Update():void
Called each engine tick. | Entity |
Method | Defined By | ||
---|---|---|---|
CalcXBoundaries(nSetPosX:Number):void
Calculates if a position is beyond the Y boundaries
| DynamicEntity | ||
CalcYBoundaries(nSetPosY:Number):void
Calculates if a position is beyond the Y boundaries
| DynamicEntity | ||
DrawCollisionRect():void | DynamicEntity | ||
OnDeath():void
Called when the entity's health is now 0. | Entity | ||
OnHealthChanged():void
Called when the entity's health has been changed. | Entity | ||
OnKill():void
Called when the entity is killed. | DisplayEntity | ||
OnPickup(ent:*):void
Override this to fire an event when the activator entity collides with this pickup. | Pickup | ||
OnRespawn():void
Called when the entity is repawned with the Respawn function
| DisplayEntity | ||
OnTakeDamage():void
Called when the entity took damage via TakeDamage function. | Entity | ||
UpdateCollisionRect(nSetPosX:Number, nSetPosY:Number, nSetScaleX:Number, nSetScaleY:Number, nSetWidth:Number, nSetHeight:Number, nSetOffsetX:Number, nSetOffsetY:Number):void
Update the position/scale of the collision rect
| DynamicEntity |
_Update | () | method |
override public function _Update():void
Handles moving towards the activator entitiy.
OnCollide | () | method |
override public function OnCollide(ent:*):void
When the pickup collided with the activator entity.
Parameters
ent:* — The collided entity
|
OnPickup | () | method |
protected function OnPickup(ent:*):void
Override this to fire an event when the activator entity collides with this pickup.
Parameters
ent:* — The activator entity
|
SetPickup | () | method |
public function SetPickup(entSetActivator:DynamicEntity, bShouldMoveTowards:Boolean = false, iSetMinMoveDist:int = 0, iSetMoveSpeed:int = 20):void
Sets the pickup data to apply to this pickup.
Parameters
entSetActivator:DynamicEntity — The entity that activates/collides with this pickup.
| |
bShouldMoveTowards:Boolean (default = false ) — Should this pickup move towards the activator?
| |
iSetMinMoveDist:int (default = 0 ) — The minimum distance to begin moving towards activator (requires bShouldMoveTowards to be on).
| |
iSetMoveSpeed:int (default = 20 ) — The speed to being moving towards activator (requires bShouldMoveTowards to be on).
|