Packageverlocity.ents.items
Classpublic class Pickup
InheritancePickup Inheritance DisplayEntity Inheritance DynamicEntity Inheritance Entity Inheritance Object



Public Properties
 PropertyDefined By
 InheritedabsX : Number
[override] [read-only] Returns the absolute X position.
DisplayEntity
 InheritedabsY : Number
[override] [read-only] Returns the absolute Y position.
DisplayEntity
 InheritedbaseClass : Object
[override] [read-only] Returns the entity base class.
DisplayEntity
 InheritedbitmapClip : BitmapClip
[read-only] Returns the bitmap clip of the entity.
DisplayEntity
 Inheritedbounds : Rectangle
[read-only] Returns the bounds of the display entity
DisplayEntity
 InheritedcollisionRect : CRectangle
[read-only] Returns the collision rect
DynamicEntity
 InheritedcurrentFrame : int
[read-only] Gets the current frame of the display object (if it's a MovieClip/_bitmapClip)
DisplayEntity
 InheritedcurrentFrameLabel : String
[read-only] Gets the current frame label of the display object (if it's a MovieClip)
DisplayEntity
 InheritedcurrentLayer : Layer
[read-only] A getter that returns the layer the entity is currently in.
DisplayEntity
 InheritedcurrentLayerName : String
[read-only] A getter that returns the layer name the entity is currently in.
DisplayEntity
 InheriteddefaultHealth : int
[read-only] A getter that returns the default health the entity has.
Entity
 Inherited_display : Boolean
[override] [read-only] Returns if this entity base contains display functionality (will not Init until spawned).
DisplayEntity
 InheriteddisplayObj : DisplayObject
[read-only] Returns the display object of the entity.
DisplayEntity
 InheriteddisplayType : Class
[read-only] Returns the display type class
DisplayEntity
 Inherited_dynamic : Boolean
[override] [read-only] Returns if the entity is dynamic.
DynamicEntity
 Inheritedgraphics : Graphics
[read-only] Returns the graphics object.
DisplayEntity
 InheritedhalfHeight : Number
[read-only] A getter that returns the height divided by two (center of y).
DisplayEntity
 InheritedhalfWidth : Number
[read-only] A getter that returns the width divided by two (center of x).
DisplayEntity
 Inheritedhealth : int
[read-only] A getter that returns the current health value of the entity.
Entity
 Inheritedheight : Number
Returns the height of the display entity.
DisplayEntity
 Inherited_id : int
Returns the registration ID of the entity.
Entity
 InheritedinitX : Number
[read-only] A getter that returns the initial X position.
DynamicEntity
 InheritedinitY : Number
[read-only] A getter that returns the initial Y position.
DynamicEntity
 InheritedmaxHealth : int
A getter that returns the maximum health this entity can have.
Entity
 Inheritedparent : DisplayObjectContainer
[read-only] Returns the parent display object container.
DisplayEntity
 Inheritedphys : PhysObject
[read-only] Returns the physics object (short-hand).
DynamicEntity
 Inheritedrotation : Number
Returns the rotation of the display entity
DisplayEntity
 InheritedscaleX : Number
Returns the X scale of the display entity.
DisplayEntity
 InheritedscaleY : Number
Returns the Y scale of the display entity.
DisplayEntity
 InheritedsourceClass : Class
[read-only] Returns the artwork source class name
DisplayEntity
 InheritedtotalFrames : int
[read-only] Gets the total frames of the display object (if it's a MovieClip/_bitmapClip)
DisplayEntity
 Inheritedwidth : Number
Returns the width of the display entity.
DisplayEntity
 Inheritedx : Number
[override] Sets the position of the display entity.
DisplayEntity
 Inheritedy : Number
[override] Sets the position of the display entity.
DisplayEntity
Protected Properties
 PropertyDefined By
 InheritedbCollisionEnabled : Boolean
DynamicEntity
 InheritedbIsBeingRemoved : Boolean
DisplayEntity
 InheritedbIsSpawned : Boolean
DisplayEntity
 Inherited_bitmap : Bitmap
DisplayEntity
 Inherited_bitmapData : BitmapData
DisplayEntity
 Inherited_bitmapDataRect : Rectangle
DisplayEntity
 Inherited_bitmapDrawRect : Rectangle
DisplayEntity
 InheritedctColor : ColorTransform
DisplayEntity
 InheritedcTint : Color
DisplayEntity
 InheritediBoundPadding : int = 100
DynamicEntity
 InheritediCollisionFlags : int
DynamicEntity
 InheritediRemoveOffScreenPadding : int = 100
DynamicEntity
 InheritedlLayer : Layer
DisplayEntity
 InheritednAlpha : Number = 1
DisplayEntity
 InheritednInitialX : Number
DynamicEntity
 InheritednInitialY : Number
DynamicEntity
 InheritednPosX : Number
DynamicEntity
 InheritednPosY : Number
DynamicEntity
 InheritedrectBounds : Rectangle
DynamicEntity
 InheritedrectCollision : CRectangle
DynamicEntity
 InheriteduiColor : uint
DisplayEntity
Public Methods
 MethodDefined By
 Inherited
_Dispose():void
[override] Cleans the entity's data.
DisplayEntity
  
_Update():void
[override] Handles moving towards the activator entitiy.
Pickup
 Inherited
addChild(disp:DisplayObject):void
Adds a child display object
DisplayEntity
 Inherited
BitmapDrawRect(drawX:int, drawY:int, drawWidth:Number, drawHeight:Number, uiColor:uint):void
Draws a simple rectangle in the drawable bitmap (see CreateDrawableBitmap).
DisplayEntity
 Inherited
Clear():void
Clears the graphics of the display object of the entity.
DisplayEntity
 Inherited
Clears the boundaries of the entity.
DynamicEntity
 Inherited
Construct():void
Called before the entity is spawned to setup the constants of the entity.
Entity
 Inherited
CreateDrawableBitmap(iWidth:int, iHeight:int, bOverrideDisplay:Boolean = false):void
Creates a bitmap canvas for graphic drawing.
DisplayEntity
 Inherited
DeInit():void
Called when the entity is deleted.
Entity
 Inherited
DisplayIs(cClassName:Class):Boolean
Returns if the display is a specified base class.
DisplayEntity
 Inherited
DrawRect(drawX:int, drawY:int, drawWidth:Number, drawHeight:Number, nAlpha:Number = 1, uiColor:uint):void
Draws a simple rectangle in the display object.
DisplayEntity
 Inherited
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
 Inherited
EnableCollision(bEnable:Boolean = true):void
Enables/disables calculations for collision.
DynamicEntity
 Inherited
EnablePhysics(bEnable:Boolean = true, bRemovePhysicsObj:Boolean = true):void
Enables/disables calculations for physics.
DynamicEntity
 Inherited
EnableUpdate(bUpdate:Boolean = true):void
Sets if the entity will update each engine tick.
Entity
 Inherited
FadeColors(oldColor:uint, newColor:uint, amount:Number = 1):void
Fades between two colors (hex).
DisplayEntity
 Inherited
FadeColorsRGB(oldR:int, oldG:int, oldB:int, newR:int, newG:int, newB:int, amount:Number = 1):void
Fades between two RGB values.
DisplayEntity
 Inherited
FadeRemove(nSetFadeSpeed:Number = 0.05):void
Removes the entity with a fading effect.
DisplayEntity
 Inherited
GetAlpha():Number
Returns the overall transparency of the entity.
DisplayEntity
 Inherited
GetAngle():Point
Returns the angle of rotation as a unit vector.
DisplayEntity
 Inherited
GetClass():Object
Returns the class of the entity.
Entity
 Inherited
GetColor():uint
Returns the color of the entity.
DisplayEntity
 Inherited
Returns the rotation (0-360) from the relation of the mouse and the entity.
DynamicEntity
 Inherited
GetOwner():Object
Returns the current owner of the entity.
Entity
 Inherited
Returns the physics object
DynamicEntity
 Inherited
GetPos():Point
Returns the current position as a point
DynamicEntity
 Inherited
GetScale():Number
Returns the current scale of the entity.
DisplayEntity
 Inherited
GetType():String
Returns the current string type of the entity.
Entity
 Inherited
HasEnded():Boolean
Returns if the MovieClip/_bitmapClip
DisplayEntity
 Inherited
HasMoved():Boolean
Returns if the entity has moved (determined by its previous position set) This is used to optimize collision and physics calculations
DynamicEntity
 Inherited
Init():void
Called when the entity is first registered/spawned.
Entity
 Inherited
Is(cClass:Class):Boolean
Returns if the entity matches a class.
Entity
 Inherited
IsBeingRemoved():Boolean
Returns if the entity is being fade removed.
DisplayEntity
 Inherited
Returns the method of basic collision between other types
DynamicEntity
 Inherited
Returns if collision is enabled
DynamicEntity
 Inherited
IsCollisionFlagOn(iCollisionFlag:int):Boolean
Returns if a collision flag is enabled or not.
DynamicEntity
 Inherited
IsDead():Boolean
Returns if the entity is dead.
Entity
 Inherited
IsHealthZero():Boolean
Returns if the health is zero.
Entity
 Inherited
DynamicEntity
 Inherited
IsOnBoundary():Boolean
DynamicEntity
 Inherited
DynamicEntity
 Inherited
DynamicEntity
 Inherited
IsOnScreen():Boolean
Returns if the entity is within the boundaries of the screen.
DynamicEntity
 Inherited
IsOnTopBoundary():Boolean
DynamicEntity
 Inherited
IsOnXBoundary():Boolean
DynamicEntity
 Inherited
IsOnYBoundary():Boolean
DynamicEntity
 Inherited
Returns if physics is enabled
DynamicEntity
 Inherited
IsPlaying():Boolean
Returns if the display object (if it's a MovieClip/_bitmapClip) is currently playing
DisplayEntity
 Inherited
IsProtected():Boolean
Returns if the entity is protected.
Entity
 Inherited
IsSpawned():Boolean
Returns if the entity was spawned.
DisplayEntity
 Inherited
IsT(sCheckType:String):Boolean
Returns if the entity is matches a type (lowercase only).
Entity
 Inherited
IsUpdating():Boolean
Returns if the entity is updating.
Entity
 Inherited
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
 Inherited
Pause():void
Pauses the display object (if it's a MovieClip/_bitmapClip and was playing)
DisplayEntity
 Inherited
Play():void
Plays the display object (if it's a MovieClip/BitmapClip)
DisplayEntity
 Inherited
Remove():void
Marks the entity for removal.
Entity
 Inherited
Removes the color transforms, tinting, and alpha changes applied to the entity.
DisplayEntity
 Inherited
Removes all health of the entity.
Entity
 Inherited
removeChild(disp:DisplayObject):void
Removes a child display object
DisplayEntity
 Inherited
Removes all displays of the entity.
DisplayEntity
 Inherited
Removes the bitmap drawable, if it exists.
DisplayEntity
 Inherited
Removes the filters of the display object
DisplayEntity
 Inherited
RemoveOffScreen(bShouldRemove:Boolean = true, iPadding:int = 100):void
Tells the entity to remove itself when its off screen.
DynamicEntity
 Inherited
RemoveTint():void
Removes any tinting applied.
DisplayEntity
 Inherited
Reset():void
[override] Resets the entity to its original values.
DisplayEntity
 Inherited
Resets the entity's health to the default health.
Entity
 Inherited
ResetPos():void
Resets the entity to its initial position.
DynamicEntity
 Inherited
ResetScale():void
Resets the scale of the entity to defaults (1).
DisplayEntity
 Inherited
Respawn():void
Calls DeInit then Init.
DisplayEntity
 Inherited
Resume():void
Resumes the display object (if it's a MovieClip/_bitmapClip and was playing)
DisplayEntity
 Inherited
SetAlpha(nSetAlpha:Number):void
Sets the overall transparency of the entity.
DisplayEntity
 Inherited
SetBounds(rectSetBounds:Rectangle, iInnerPadding:int = 0):void
Sets the screen boundaries of the entity.
DynamicEntity
 Inherited
SetCollisionFlags(iFlags:int):void
Set collision flags.
DynamicEntity
 Inherited
SetCollisionRect(rect:Rectangle, nOffsetX:Number = 0, nOffsetY:Number = 0):void
Sets the collision rect (required for collision)
DynamicEntity
 Inherited
SetColor(newColor:uint, nAlpha:Number = 1):void
Sets the color of the entity.
DisplayEntity
 Inherited
SetColorRGB(r:int = 255, g:int = 255, b:int = 255, nAlpha:Number = 1):void
Sets the color of the entity with RGB.
DisplayEntity
 Inherited
SetDefaultHealth(setHealth:int = 100):void
Sets the default health of this entity.
Entity
 Inherited
SetDisplayObject(dispObject:DisplayObject, bBitmap:Boolean = false, iFPS:int = 60):void
Sets the display object of the entity - i.e.
DisplayEntity
 Inherited
SetFilters(... filters):void
Sets the filters of the display object.
DisplayEntity
 Inherited
SetFrame(iFrame:int, bPlayAnim:Boolean = true):void
Sets the display object (if it's a MovieClip/BitmapClip) to a specific frame number.
DisplayEntity
 Inherited
SetFrameLabel(sString:String, bPlayAnim:Boolean = true):void
Sets the display object (if it's a MovieClip/BitmapClip) to a specific labeled frame.
DisplayEntity
 Inherited
SetHealth(newHealth:int):void
Sets the health value of this entity.
Entity
 Inherited
SetOwner(newOwner:Object):void
Sets the owner of the entity.
Entity
 Inherited
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
 Inherited
SetPos(nSetPosX:Number, nSetPosY:Number):void
Sets the X and Y position of the entity
DynamicEntity
 Inherited
SetProtected(bProtected:Boolean = true):void
Protects an entity from being removed by clean up calls, such as CleanSlate.
Entity
 Inherited
SetRandomFrame(bPlayAnim:Boolean = false):void
Sets the display object (if it's a MovieClip/BitmapClip) to a random frame.
DisplayEntity
 Inherited
SetRemoveTime(iMilliSecs:int, bFadeOut:Boolean = false, nSetFadeSpeed:Number = 0.05):void
Sets the time the entity should be removed in.
DisplayEntity
 Inherited
SetRotation(iRot:int):void
Sets the rotation of the entity.
DisplayEntity
 Inherited
SetScale(nSetScale:Number):void
Sets the scale of the entity.
DisplayEntity
 Inherited
SetTint(amount:Number, newColor:uint):void
Sets the tint of the entity.
DisplayEntity
 Inherited
SetTintRGB(amount:Number, r:int = 255, g:int = 255, b:int = 255):void
Sets the tint of the entity with RGB.
DisplayEntity
 Inherited
SetType(sSetType:String):void
Sets the string type of the entity.
Entity
 Inherited
Sets up the collision bounds.
DisplayEntity
 Inherited
Spawn(sSetLayer:String, bSpawnOnBottom:Boolean = false):void
Spawns the entity into a layer and calls Init.
DisplayEntity
 Inherited
Stop():void
Stops the display object (if it's a MovieClip/_bitmapClip)
DisplayEntity
 Inherited
Stops all sounds that are emitting from this entity.
DynamicEntity
 Inherited
SwapLayer(sSetLayer:String, bSpawnOnBottom:Boolean = false):void
Swaps the current layer of the entity.
DisplayEntity
 Inherited
TakeDamage(iDamageAmount:int):void
Subtracts the current health.
Entity
 Inherited
Update():void
Called each engine tick.
Entity
Protected Methods
 MethodDefined By
 Inherited
CalcXBoundaries(nSetPosX:Number):void
Calculates if a position is beyond the Y boundaries
DynamicEntity
 Inherited
CalcYBoundaries(nSetPosY:Number):void
Calculates if a position is beyond the Y boundaries
DynamicEntity
 Inherited
DynamicEntity
 Inherited
OnDeath():void
Called when the entity's health is now 0.
Entity
 Inherited
Called when the entity's health has been changed.
Entity
 Inherited
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
 Inherited
OnRespawn():void
Called when the entity is repawned with the Respawn function
DisplayEntity
 Inherited
Called when the entity took damage via TakeDamage function.
Entity
 Inherited
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
Method Detail
_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).