Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
TwoDWalker Class Reference
Inheritance diagram for TwoDWalker:
GravityWalker

Public Member Functions

 __init__ (self, gravity=-32.1740, standableGround=0.707, hardLandingForce=16.0)
 
 handleAvatarControls (self, task)
 
 jumpPressed (self)
 
- Public Member Functions inherited from GravityWalker
 addBlastForce (self, vector)
 
 debugPrint (self, message)
 
 deleteCollisions (self)
 
 disableAvatarControls (self)
 
 displayDebugInfo (self)
 
 doDeltaPos (self)
 
 enableAvatarControls (self)
 
 flushEventHandlers (self)
 
 getAirborneHeight (self)
 
 getCollisionsActive (self)
 
 getGravity (self, gravity)
 
 getIsAirborne (self)
 
 getSpeeds (self)
 
 getVelocity (self)
 
 initializeCollisions (self, collisionTraverser, avatarNodePath, avatarRadius=1.4, floorOffset=1.0, reach=1.0)
 
 oneTimeCollide (self)
 
 placeOnFloor (self)
 
 reset (self)
 
 setAirborneHeightFunc (self, unused_parameter)
 
 setAvatar (self, avatar)
 
 setAvatarPhysicsIndicator (self, indicator)
 
 setCollisionRayHeight (self, height)
 
 setCollisionsActive (self, active=1)
 
 setFloorBitMask (self, bitMask)
 
 setGravity (self, gravity)
 
 setMayJump (self, task)
 
 setPriorParentVector (self)
 
 setTag (self, key, value)
 
 setupEventSphere (self, bitmask, avatarRadius)
 
 setupFloorSphere (self, bitmask, avatarRadius)
 
 setupRay (self, bitmask, floorOffset, reach)
 
 setupWallSphere (self, bitmask, avatarRadius)
 
 setWalkSpeed (self, forward, jump, reverse, rotate)
 
 setWallBitMask (self, bitMask)
 
 startJumpDelay (self, delay)
 
 swapFloorBitMask (self, oldMask, newMask)
 

Public Attributes

 avatarControlJumpForce
 
 isAirborne
 
 priorParent
 
- Public Attributes inherited from GravityWalker
 avatar
 
 avatarControlForwardSpeed
 
 avatarControlJumpForce
 
 avatarControlReverseSpeed
 
 avatarControlRotateSpeed
 
 avatarNodePath
 
 avatarPhysicsIndicator
 
 avatarRadius
 
 cEventSphereNodePath
 
 cFloorSphereNodePath
 
 collisionsActive
 
 controlsTask
 
 cRay
 
 cRayNodePath
 
 cTrav
 
 cWallSphereNodePath
 
 event
 
 falling
 
 floorBitmask
 
 getAirborneHeight
 
 highMark
 
 indicatorTask
 
 isAirborne
 
 jumpDelayTask
 
 lifter
 
 mayJump
 
 moving
 
 needToDeltaPos
 
 physVelocityIndicator
 
 priorParent
 
 pusher
 
 pusherFloor
 
 pusherFloorhandler
 
 rotationSpeed
 
 setMayJump
 
 slideSpeed
 
 speed
 
 vel
 
 wallBitmask
 

Static Public Attributes

 earlyEventSphere = ConfigVariableBool('early-event-sphere', False)
 
 notify = directNotify.newCategory("TwoDWalker")
 
 wantDebugIndicator = ConfigVariableBool('want-avatar-physics-indicator', False)
 
 wantFloorSphere = ConfigVariableBool('want-floor-sphere', False)
 
- Static Public Attributes inherited from GravityWalker
int DiagonalFactor = math.sqrt(2.) / 2.
 
 earlyEventSphere = ConfigVariableBool('early-event-sphere', False)
 
 notify = directNotify.newCategory("GravityWalker")
 
 wantDebugIndicator = ConfigVariableBool('want-avatar-physics-indicator', False)
 
 wantFloorSphere = ConfigVariableBool('want-floor-sphere', False)
 

Additional Inherited Members

- Protected Attributes inherited from GravityWalker
 _legacyLifter
 

Detailed Description

The TwoDWalker is primarily for a 2D Scroller game environment. Eg - Toon Blitz minigame.
TODO: This class is still work in progress.
Currently Toon Blitz is using this only for jumping.
Moving the Toon left to right is handled by toontown/src/minigame/TwoDDrive.py.
I eventually want this class to control all the 2 D movements, possibly with a
customizable input list.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
gravity = -32.1740,
standableGround = 0.707,
hardLandingForce = 16.0 )

Reimplemented from GravityWalker.

Member Function Documentation

◆ handleAvatarControls()

handleAvatarControls ( self,
task )
Check on the arrow keys and update the avatar.

Reimplemented from GravityWalker.

◆ jumpPressed()

jumpPressed ( self)
This function should be called from TwoDDrive when the jump key is pressed.

Member Data Documentation

◆ avatarControlJumpForce

avatarControlJumpForce

◆ earlyEventSphere

earlyEventSphere = ConfigVariableBool('early-event-sphere', False)
static

◆ isAirborne

isAirborne

◆ notify

notify = directNotify.newCategory("TwoDWalker")
static

◆ priorParent

priorParent

◆ wantDebugIndicator

wantDebugIndicator = ConfigVariableBool('want-avatar-physics-indicator', False)
static

◆ wantFloorSphere

wantFloorSphere = ConfigVariableBool('want-floor-sphere', False)
static