Package scripts :: Script gamescenecontroller :: Class GameSceneController
[hide private]
[frames] | no frames]

Class GameSceneController

source code

                                       object --+        
                                                |        
        common.listeners.key_listener.KeyListener --+    
                                                    |    
                                       object --+   |    
                                                |   |    
    common.listeners.mouse_listener.MouseListener --+    
                                                    |    
                                       object --+   |    
                                                |   |    
common.listeners.command_listener.CommandListener --+    
                                                    |    
                        controllerbase.ControllerBase --+
                                                        |
                                                       GameSceneController

This controller handles inputs when the game is in "scene" state. "Scene" state is when the player can move around and interact with objects. Like, talking to a npc or examining the contents of a box.

Instance Methods [hide private]
 
__init__(self, engine, view, model, application)
Constructor
source code
 
initHud(self)
Initialize the hud member
source code
 
keyPressed(self, evt)
Whenever a key is pressed, fife calls this routine.
source code
 
mouseReleased(self, evt)
If a mouse button is released, fife calls this routine.
source code
 
updateMouse(self)
Updates the mouse values
source code
 
handleCommands(self)
Check if a command is to be executed
source code
 
nullFunc(self, userdata)
Sample callback for the context menus.
source code
 
initTalk(self, npc_info)
Starts the PlayerCharacter talking to an NPC.
source code
list
getItemActions(self, obj_id)
Given the objects ID, return the text strings and callbacks.
source code
 
saveGame(self, *args, **kwargs)
Saves the game state, delegates call to engine.Engine
source code
 
loadGame(self, *args, **kwargs)
Loads the game state, delegates call to engine.Engine
source code
 
quitGame(self)
Quits the game
source code
 
pause(self, paused)
Pauses the controller
source code
 
onCommand(self, command)
Called when a command is executed
source code
 
pump(self)
Routine called during each frame.
source code

Inherited from controllerbase.ControllerBase: onStop, resetMouseCursor, setMouseCursor

Inherited from common.listeners.key_listener.KeyListener: attach, detach, keyReleased

Inherited from common.listeners.mouse_listener.MouseListener: mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseWheelMovedDown, mouseWheelMovedUp

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, engine, view, model, application)
(Constructor)

source code 

Constructor

Parameters:
  • engine (fife.Engine) - Instance of the active fife engine
  • view - Instance of a GameSceneView
  • type - scripts.GameSceneView
  • model (scripts.GameModel) - The model that has the current gamestate
  • application (scripts.PARPGApplication) - The application that created this controller
  • settings (fife.extensions.fife_settings.Setting) - The current settings of the application
Overrides: object.__init__

initHud(self)

source code 

Initialize the hud member

Returns:
None

keyPressed(self, evt)

source code 

Whenever a key is pressed, fife calls this routine.

Parameters:
  • evt (fife.event) - The event that fife caught
Returns:
None
Overrides: common.listeners.key_listener.KeyListener.keyPressed

mouseReleased(self, evt)

source code 

If a mouse button is released, fife calls this routine. We want to wait until the button is released, because otherwise pychan captures the release if a menu is opened.

Parameters:
  • evt (fife.event) - The event that fife caught
Returns:
None
Overrides: common.listeners.mouse_listener.MouseListener.mouseReleased

getItemActions(self, obj_id)

source code 

Given the objects ID, return the text strings and callbacks.

Parameters:
  • obj_id (string) - ID of object
Returns: list
List of text and callbacks

saveGame(self, *args, **kwargs)

source code 

Saves the game state, delegates call to engine.Engine

Returns:
None

loadGame(self, *args, **kwargs)

source code 

Loads the game state, delegates call to engine.Engine

Returns:
None

quitGame(self)

source code 

Quits the game

Returns:
None

pause(self, paused)

source code 

Pauses the controller

Overrides: controllerbase.ControllerBase.pause

onCommand(self, command)

source code 

Called when a command is executed

Overrides: common.listeners.command_listener.CommandListener.onCommand
(inherited documentation)

pump(self)

source code 

Routine called during each frame. Our main loop is in ./run.py

Overrides: controllerbase.ControllerBase.pump