diff gamescenecontroller.py @ 44:98f26f7636d8

Changes to make PARPG "runable" with grease. (With the correct modified assets)
author KarstenBock@gmx.net
date Tue, 06 Sep 2011 15:22:51 +0200
parents 3011bc71ab20
children d3a9caba067b
line wrap: on
line diff
--- a/gamescenecontroller.py	Tue Sep 06 15:21:36 2011 +0200
+++ b/gamescenecontroller.py	Tue Sep 06 15:22:51 2011 +0200
@@ -240,7 +240,7 @@
                                     .getExactLayerCoordinates()
                 commands = ({"Command": "ResetMouseCursor"}, 
                             {"Command": "StopDragging"})
-                self.model.game_state.player_character.approach([coord.x, 
+                self.model.game_state.getObjectById("PlayerCharacter").fifeagent.approach([coord.x, 
                                                                  coord.y],
                                     DropItemAction(self, 
                                                    data_drag.dragged_item, 
@@ -327,8 +327,8 @@
         if self.model.map_change:
             self.pause(True)
             if self.model.active_map:
-                player_char = self.model.game_state.player_character
-                self.model.game_state.player_character = None
+                player_char = self.model.game_state.getObjectById("PlayerCharacter").fifeagent
+                self.model.game_state.getObjectById("PlayerCharacter").fifeagent = None
                 pc_agent = self.model.agents[self.model.ALL_AGENTS_KEY]\
                                                 ["PlayerCharacter"]
                 pc_agent.update(player_char.getStateForSaving())
@@ -346,7 +346,7 @@
             self.model.readAgentsOfMap(self.model.target_map_name)
             
             self.model.placeAgents(self)
-            self.model.placePC()
+            self.model.placePC(self)
             self.model.map_change = False
             # The PlayerCharacter has an inventory, and also some 
             # filling of the ready slots in the HUD. 
@@ -411,7 +411,7 @@
         npc = self.model.game_state.getObjectById(npc_info.ID,
                                             self.model.game_state.\
                                                 current_map_name)
-        self.model.game_state.player_character.approach([npc.getLocation().\
+        self.model.game_state.getObjectById("PlayerCharacter").fifeagent.approach([npc.getLocation().\
                                      getLayerCoordinates().x,
                                      npc.getLocation().\
                                      getLayerCoordinates().y],
@@ -445,7 +445,7 @@
                 # is it a Door?
                 if obj.trueAttr("door"):
                     actions.append(["Change Map", "Change Map",
-                       self.model.game_state.player_character.approach, 
+                       self.model.game_state.getObjectById("PlayerCharacter").fifeagent.approach, 
                        [obj.X, obj.Y],
                        ChangeMapAction(self, obj.target_map_name,
                                        obj.target_pos)])