Ignore:
Timestamp:
10/09/09 20:03:08 (10 years ago)
Author:
eliedebrauwer
Message:

Ticket #66: Patch by saritor (& eliedebrauwer), implements saritors rework of teleporting, at this point it implements the within-a-map teleport successfully, but cross map teleport still has in issue which probably has to do with the setup of the PC. comment[s:trac, t:66]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/world.py

    r302 r310  
    211211        self.data.gameState.PC.run(click) 
    212212 
     213    def teleport(self, position): 
     214        """Called when a door is used that moves a player to a new 
     215           location on the same map. the setting of position may want 
     216           to be created as its own method down the road. 
     217            
     218           @type position: String Tuple 
     219           @param position: X,Y coordinates passed from enigine.changeMap 
     220           @return: fife.Location 
     221        """ 
     222        coord = fife.DoublePoint3D(float(position[0]), float(position[1]), 0) 
     223        location = fife.Location(self.activeMap.agent_layer) 
     224        location.setMapCoordinates(coord) 
     225        self.data.gameState.PC.teleport(location) 
     226 
    213227    def mouseMoved(self, evt): 
    214228        """Called when the mouse is moved 
Note: See TracChangeset for help on using the changeset viewer.