Module pong3dgpl :: Class gameplay
[frames] | no frames]

Class gameplay

source code


Pong3D gameplay class. Derived from a generic base gameply class, this is custom-specialized to play the pong3D game.

Instance Methods
 
__init__(self, parent, settings={'opponent': 'human', 'playernames': ['CPU0', 'Player1']}, callback=None) (Inherited from gamelogic01.gameplaybase) source code
 
ballinpulse(self, vec) source code
 
ballreset(self, foo=None) source code
 
ballrestart(self, foo=None)
to start the ball off the pad
source code
 
bot0(self, padz, ballpos, balldir)
npc AI (actually very dumb)
source code
 
bot1(self, padz, ballpos, balldir)
npc AI (less dumb)
source code
 
checkmatchball(self) source code
 
collideEventIn(self, entry) source code
 
dbgprint(self, msg) (Inherited from gamelogic01.gameplaybase) source code
 
endset(self)
a set is won by one player
source code
 
finish(self) (Inherited from gamelogic01.gameplaybase) source code
 
gameover(self) source code
 
humanvscpuscore(self) source code
 
intermessage(self, msg, scale=0.1, delay=-1) source code
 
loadeffects(self) (Inherited from gamelogic01.gameplaybase) source code
 
mainloop(self, task) source code
 
npcloop(self, task) source code
 
onfinish(self) source code
 
pause(self, force=None) (Inherited from gamelogic01.gameplaybase) source code
 
playeffect(self, name) (Inherited from gamelogic01.gameplaybase) source code
 
playerscore(self, player) source code
 
setcamera(self)
WARNING you actually cannot dynamically switch from 2d to 3d and vice-versa but just stay stick to one dimension or the other one
source code
 
setgame(self) source code
 
setinputs(self) source code
 
setmaintask(self, on) source code
 
setpadvel(self, p, v) source code
 
setscene(self) source code
 
si_easyinput(self) source code
 
si_noeasyinput(self) source code
 
startclock(self) (Inherited from gamelogic01.gameplaybase) source code
 
stopclock(self) (Inherited from gamelogic01.gameplaybase) source code
 
toggle_collisions(self) source code
 
updatescore(self) source code
 
walktree(self, top, ext='.ogg') (Inherited from gamelogic01.gameplaybase) source code
 
wallbouncheck(self, reset=False)
check for triple bounces in a player's middlefield
source code
 
xsetpadvel(self, a, b) source code

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

Class Variables
  BALLSPEED = 1.0
  BALLSPEEDMAX = 2.0
  CPUSPD = 0.15
  NPCSPD = 1.0
  PADVEL = 1.0
  foesdefeated = 0
  totsets = 0
Method Details

onfinish(self)

source code 
Overrides: gamelogic01.gameplaybase.onfinish

setcamera(self)

source code 

WARNING you actually cannot dynamically switch from 2d to 3d and vice-versa but just stay stick to one dimension or the other one

Overrides: gamelogic01.gameplaybase.setcamera

setgame(self)

source code 
Overrides: gamelogic01.gameplaybase.setgame

setinputs(self)

source code 
Overrides: gamelogic01.gameplaybase.setinputs

setscene(self)

source code 
Overrides: gamelogic01.gameplaybase.setscene