Panda3D
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
TwoDWalker Class Reference
Inheritance diagram for TwoDWalker:
GravityWalker

Public Member Functions

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

Public Attributes

 isAirborne
 
 priorParent
 
- Public Attributes inherited from GravityWalker
 avatar
 
 avatarControlForwardSpeed
 
 avatarControlJumpForce
 
 avatarControlReverseSpeed
 
 avatarControlRotateSpeed
 
 avatarNodePath
 
 avatarRadius
 
 cEventSphereNodePath
 
 cFloorSphereNodePath
 
 collisionsActive
 
 controlsTask
 
 cRay
 
 cRayNodePath
 
 cTrav
 
 cWallSphereNodePath
 
 event
 
 falling
 
 floorBitmask
 
 getAirborneHeight
 
 highMark
 
 indicatorTask
 
 isAirborne
 
 jumpDelayTask
 
 lifter
 
 mayJump
 
 moving
 
 needToDeltaPos
 
 physVelocityIndicator
 
 priorParent
 
 pusher
 
 pusherFloorhandler
 
 rotationSpeed
 
 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)
 

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__()

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

Member Function Documentation

◆ handleAvatarControls()

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

Reimplemented from GravityWalker.

◆ jumpPressed()

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

Member Data Documentation

◆ 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