diff src/parpg/behaviours/base.py @ 79:62cff91a19cb

Modifications to make the player agent move around by clicking with the mouse.
author KarstenBock@gmx.net
date Thu, 08 Sep 2011 18:23:06 +0200
parents 8a7bb62f9f5d
children 9f8faf6e974d
line wrap: on
line diff
--- a/src/parpg/behaviours/base.py	Thu Sep 08 15:18:39 2011 +0200
+++ b/src/parpg/behaviours/base.py	Thu Sep 08 18:23:06 2011 +0200
@@ -109,4 +109,23 @@
            @return: None"""
         self.state = _AGENT_STATE_TALK
         self.pc = pc.behaviour.agent
-        self.idle()
\ No newline at end of file
+        self.idle()
+        
+    def run(self, location):
+        """Makes the PC run to a certain location
+           @type location: fife.ScreenPoint
+           @param location: Screen position to run to.
+           @return: None"""
+        self.state = _AGENT_STATE_RUN
+        self.nextAction = None
+        self.agent.move('run', location, self.speed + 1)
+
+    def walk(self, location):
+        """Makes the PC walk to a certain location.
+           @type location: fife.ScreenPoint
+           @param location: Screen position to walk to.
+           @return: None"""
+        self.state = _AGENT_STATE_RUN
+        self.nextAction = None 
+        self.agent.move('walk', location, self.speed - 1)
+        
\ No newline at end of file