Module PhysBaseClass

Level physical object base class

Collision types enumeration (CollisionType)

PhysBase.COLLISION_NONE Colliding is disabled
PhysBase.COLLISION_ANY Collide on any side
PhysBase.COLLISION_TOP Collide on top side
PhysBase.COLLISION_BOTTOM Collide on bottom side
PhysBase.COLLISION_LEFT Collide on left side
PhysBase.COLLISION_RIGHT Collide on right side

Item types enumeration (ObjTypes)

PhysBase.Unknown Unknown type of object
PhysBase.Block Block object
PhysBase.BGO BGO object
PhysBase.NPC NPC object
PhysBase.Player Playable character object
PhysBase.Warp Warp entrance object
PhysBase.Special Object of special type, reserved
PhysBase.PhysEnv Physical environment object

Class PhysBase

PhysBase.x X position on the scene (left-top corner)
PhysBase.y Y position on the scene (left-top corner)
PhysBase.center_x X position on the scene at center
PhysBase.center_y Y position on the scene at center
PhysBase.width Width of body
PhysBase.height Height of body
PhysBase.top Top side position
PhysBase.left Left side position
PhysBase.right Right side position
PhysBase.bottom Bottom side position
PhysBase.abs_x Absolute X position (when object is a member of group and has relative coordinates)
PhysBase.abs_y Absolute Y position (when object is a member of group and has relative coordinates)
PhysBase.abs_center_x Absolute center X position (when object is a member of group and has relative coordinates)
PhysBase.abs_center_y Absolute center Y position (when object is a member of group and has relative coordinates)
PhysBase.abs_width Absolute width of body (when object is a member of group with a scale transform)
PhysBase.abs_height Absolute height of body (when object is a member of group with a scale transform)
PhysBase.abs_top Absolute top position (when object is a member of group and has relative coordinates)
PhysBase.abs_left Absolute left position (when object is a member of group and has relative coordinates)
PhysBase.abs_right Absolute right position (when object is a member of group and has relative coordinates)
PhysBase.abs_bottom Absolute bottom position (when object is a member of group and has relative coordinates)
PhysBase.type Type of object
PhysBase.paused_physics Pause physical processing, object will don't interact with world and will be frozen
PhysBase.visible Object is visible and will be drawn on player's camera
PhysBase.speedX Moving X velocity in pixels per 1/65 of second units
PhysBase.speedY Moving Y velocity in pixels per 1/65 of second units
PhysBase.minVelX Minimal horizontal moving velocity in pixels per 1/65 of second units
PhysBase.minVelY Minimal vertical moving velocity in pixels per 1/65 of second units
PhysBase.maxVelX Maximal horizontal moving velocity in pixels per 1/65 of second units
PhysBase.maxVelY Maximal vertical moving velocity in pixels per 1/65 of second units
PhysBase.gravity Gravity scale multiplier to global gravity force.
PhysBase.gravity_accel Gravity acceleration
PhysBase.collide_player Allow player collide with this NPC by the way
PhysBase.collide_npc Allow another NPCs collide with this NPC by the way
PhysBase:applyAccel (x, y) Apply acceneration force on this frame To have speed acceleration of object you must call this function every frame (for example in onLoop() event callback of NPC or playable character)
Unit - one pixel per 1/65 of second in 1 / 65 of second.
PhysBase:setDecelX (x) Set a horizontal movement deceleration when is no acceleration applying
Unit - one pixel per 1/65 of second in 1 / 65 of second.
PhysBase:setDecelY (y) Set a vertical movement deceleration when is no acceleration or gravity applying
Unit - one pixel per 1/65 of second in 1 / 65 of second.


Collision types enumeration (CollisionType)

PhysBase.COLLISION_NONE
Colliding is disabled
PhysBase.COLLISION_ANY
Collide on any side
PhysBase.COLLISION_TOP
Collide on top side
PhysBase.COLLISION_BOTTOM
Collide on bottom side
PhysBase.COLLISION_LEFT
Collide on left side
PhysBase.COLLISION_RIGHT
Collide on right side

Item types enumeration (ObjTypes)

PhysBase.Unknown
Unknown type of object
PhysBase.Block
Block object
PhysBase.BGO
BGO object
PhysBase.NPC
NPC object
PhysBase.Player
Playable character object
PhysBase.Warp
Warp entrance object
PhysBase.Special
Object of special type, reserved
PhysBase.PhysEnv
Physical environment object

Class PhysBase

Level generic physical body object
PhysBase.x
X position on the scene (left-top corner)
  • x double
PhysBase.y
Y position on the scene (left-top corner)
  • y double
PhysBase.center_x
X position on the scene at center
  • center_x double
PhysBase.center_y
Y position on the scene at center
  • center_y double
PhysBase.width
Width of body
  • width double
PhysBase.height
Height of body
  • height double
PhysBase.top
Top side position
  • top double
PhysBase.left
Left side position
  • left double
PhysBase.right
Right side position
  • right double
PhysBase.bottom
Bottom side position
  • bottom double
PhysBase.abs_x
Absolute X position (when object is a member of group and has relative coordinates)
  • abs_x double
PhysBase.abs_y
Absolute Y position (when object is a member of group and has relative coordinates)
  • abs_y double
PhysBase.abs_center_x
Absolute center X position (when object is a member of group and has relative coordinates)
  • abs_center_x double
PhysBase.abs_center_y
Absolute center Y position (when object is a member of group and has relative coordinates)
  • abs_center_y double
PhysBase.abs_width
Absolute width of body (when object is a member of group with a scale transform)
  • abs_width double
PhysBase.abs_height
Absolute height of body (when object is a member of group with a scale transform)
  • abs_height double
PhysBase.abs_top
Absolute top position (when object is a member of group and has relative coordinates)
  • abs_top double
PhysBase.abs_left
Absolute left position (when object is a member of group and has relative coordinates)
  • abs_left double
PhysBase.abs_right
Absolute right position (when object is a member of group and has relative coordinates)
  • abs_right double
PhysBase.abs_bottom
Absolute bottom position (when object is a member of group and has relative coordinates)
  • abs_bottom double
PhysBase.type
Type of object
  • type ObjTypes
PhysBase.paused_physics
Pause physical processing, object will don't interact with world and will be frozen
  • paused_physics bool
PhysBase.visible
Object is visible and will be drawn on player's camera
  • visible bool
PhysBase.speedX
Moving X velocity in pixels per 1/65 of second units
  • speedX double
PhysBase.speedY
Moving Y velocity in pixels per 1/65 of second units
  • speedY double
PhysBase.minVelX
Minimal horizontal moving velocity in pixels per 1/65 of second units
  • minVelX double
PhysBase.minVelY
Minimal vertical moving velocity in pixels per 1/65 of second units
  • minVelY double
PhysBase.maxVelX
Maximal horizontal moving velocity in pixels per 1/65 of second units
  • maxVelX double
PhysBase.maxVelY
Maximal vertical moving velocity in pixels per 1/65 of second units
  • maxVelY double
PhysBase.gravity
Gravity scale multiplier to global gravity force.
  • gravity double 1.0 is same as global, 0.0 is no gravity, any negative value will invert gravity
PhysBase.gravity_accel
Gravity acceleration
  • gravity_accel double 1.0 is same as global, 0.0 is no gravity, any negative value will invert gravity
PhysBase.collide_player
Allow player collide with this NPC by the way
  • collide_player PhysBase.CollisionType
PhysBase.collide_npc
Allow another NPCs collide with this NPC by the way
  • collide_npc PhysBase.CollisionType
PhysBase:applyAccel (x, y)
Apply acceneration force on this frame To have speed acceleration of object you must call this function every frame (for example in onLoop() event callback of NPC or playable character)
Unit - one pixel per 1/65 of second in 1 / 65 of second. I.e. In one 1/65 of second interval speed will change one pixel per 1/65 of second

Parameters:

  • x double Horizontal acceleration (<0 to left, >0 to right)
  • y double Vertical acceleration (<0 to up, >0 to down)
PhysBase:setDecelX (x)
Set a horizontal movement deceleration when is no acceleration applying
Unit - one pixel per 1/65 of second in 1 / 65 of second. I.e. In one 1/65 of second interval speed will change one pixel per 1/65 of second

Parameters:

  • x double Horzontal deceleration
PhysBase:setDecelY (y)
Set a vertical movement deceleration when is no acceleration or gravity applying
Unit - one pixel per 1/65 of second in 1 / 65 of second. I.e. In one 1/65 of second interval speed will change one pixel per 1/65 of second

Parameters:

  • y double Horzontal deceleration
generated by LDoc 1.4.6 Last updated 2017-08-21 02:20:32