Module gamelogic01 :: Class gameLogic01
[frames] | no frames]

Class gameLogic01

source code


Instance Methods
 
__init__(self, gameplay, settings={}) source code
 
abortgame(self, foo=None) source code
 
dbgprint(self, msg) source code
 
defaultFilter(self, request, args)
This is the function that is called if there is no filterState() method for a particular state name.
source code
 
enterGameplay(self, *args)
will enter here after 'Gameplay' FSM request.
source code
 
enterMenu(self, *args) source code
 
enterTitle(self, *args) source code
 
exitGameplay(self) source code
 
exitMenu(self) source code
 
exitTitle(self) source code
 
filterGameplay(self, request, args) source code
 
filterMenu(self, request, *args) source code
 
filterTitle(self, request, args) source code
 
istuneplaying(self) source code
 
playtune(self, tunetoplay='')
Helper to play sounds
source code
 
pop_menu(self, foo=None) source code
 
postgameover(self, score=None) source code
 
push_entry(self, menudata) source code
 
push_menu(self, menudata) source code
 
setinputs(self, on=True)
FSM keyboard inputs
source code
 
walktree(self, top, ext='.ogg') source code

Inherited from direct.showbase.ShowBase.ShowBase: SetAllSfxEnables, addAngularIntegrator, addSfxManager, backfaceCullingOff, backfaceCullingOn, changeMouseInterface, closeWindow, createBaseAudioManagers, createStats, destroy, disableAllAudio, disableMouse, disableParticles, enableAllAudio, enableMouse, enableMusic, enableParticles, enableSoftwareMousePointer, enableSoundEffects, exitfunc, finalizeExit, getAlt, getAspectRatio, getBackgroundColor, getControl, getExitErrorCode, getMeta, getRepository, getShift, getSize, initShadowTrav, isMainWindowOpen, isParticleMgrEnabled, isPhysicsMgrEnabled, loadMusic, loadSfx, makeAllPipes, makeCamera, makeCamera2d, makeCamera2dp, makeDefaultPipe, makeModulePipe, movie, oobe, oobeCull, openDefaultWindow, openMainWindow, openWindow, playMusic, playSfx, popCTrav, printEnvDebugInfo, pushCTrav, removeCameraFrustum, restart, reviveInput, run, saveCubeMap, saveSphereMap, screenshot, setBackgroundColor, setFrameRateMeter, setMouseOnNode, setSleep, setupDataGraph, setupMouse, setupMouseCB, setupRender, setupRender2d, setupRender2dp, setupWindowControls, showCameraFrustum, shutdown, silenceInput, sleepCycleTask, startDirect, startTk, startWx, textureOff, textureOn, toggleBackface, toggleParticles, toggleShowVertices, toggleTexMem, toggleTexture, toggleWireframe, updateManagers, useDrive, useTrackball, userExit, windowEvent, wireframeOff, wireframeOn

Inherited from direct.showbase.DirectObject.DirectObject: accept, acceptOnce, addTask, classTree, detectLeaks, doMethodLater, getAllAccepting, ignore, ignoreAll, isAccepting, isIgnoring, removeAllTasks, removeTask

Inherited from direct.fsm.FSM.FSM: __getattr__, __repr__, __str__, cleanup, defaultEnter, defaultExit, demand, filterOff, forceTransition, getCurrentOrNextState, getStateChangeEvent, isInTransition, request, requestNext, requestPrev, setBroadcastStateChanges, setStateArray

Class Variables
  gameplayshell = None
  playingtune = None

Inherited from direct.showbase.ShowBase.ShowBase: notify

Inherited from direct.fsm.FSM.FSM: SerialNum, defaultTransitions

Method Details

__init__(self, gameplay, settings={})
(Constructor)

source code 
Overrides: direct.fsm.FSM.FSM.__init__

defaultFilter(self, request, args)

source code 

This is the function that is called if there is no filterState() method for a particular state name.

This default filter function behaves in one of two modes:

(1) if self.defaultTransitions is None, allow any request whose name begins with a capital letter, which is assumed to be a direct request to a particular state. This is similar to the old ClassicFSM onUndefTransition=ALLOW, with no explicit state transitions listed.

(2) if self.defaultTransitions is not None, allow only those requests explicitly identified in this map. This is similar to the old ClassicFSM onUndefTransition=DISALLOW, with an explicit list of allowed state transitions.

Specialized FSM's may wish to redefine this default filter (for instance, to always return the request itself, thus allowing any transition.).

Overrides: direct.fsm.FSM.FSM.defaultFilter
(inherited documentation)

enterGameplay(self, *args)

source code 

will enter here after 'Gameplay' FSM request. Will be evaluated here the gameplay status and eventually the game will be paused/restarted.

filterGameplay(self, request, args)

source code 

Note: 'quit' request here will just pause the game, therefore the 'Menu' request must be called explicitly

setinputs(self, on=True)

source code 

FSM keyboard inputs

Note: with this we'll define all the FSM states inputs once for all - if an input is not used will fall in the default, safely unmanaged