comparison clients/rio_de_hola/scripts/world.py @ 245:ed1565a5a2a0

Fixed second camera in rio. Now multiple Camera.setLocation calls per frame are handled correctly.
author phoku@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 25 Mar 2009 14:17:59 +0000
parents 9a1529f9625e
children 8156de05a544
comparison
equal deleted inserted replaced
244:7887f3854862 245:ed1565a5a2a0
1 # -*- coding: utf-8 -*-
1 import fife, math, random 2 import fife, math, random
2 import pychan 3 import pychan
3 import pychan.widgets as widgets 4 import pychan.widgets as widgets
4 5
5 from scripts.common.eventlistenerbase import EventListenerBase 6 from scripts.common.eventlistenerbase import EventListenerBase
143 144
144 self.cameras['small'].getLocationRef().setExactLayerCoordinates( fife.ExactModelCoordinate( 40.0, 40.0, 0.0 )) 145 self.cameras['small'].getLocationRef().setExactLayerCoordinates( fife.ExactModelCoordinate( 40.0, 40.0, 0.0 ))
145 self.initial_cam2_x = self.cameras['small'].getLocation().getExactLayerCoordinates().x 146 self.initial_cam2_x = self.cameras['small'].getLocation().getExactLayerCoordinates().x
146 self.cur_cam2_x = self.initial_cam2_x 147 self.cur_cam2_x = self.initial_cam2_x
147 self.cam2_scrolling_right = True 148 self.cam2_scrolling_right = True
148 self.cameras['small'].setEnabled(False) 149 # We need to set the second cameras location
149 150 self.cameras['small'].setLocation(self.hero.agent.getLocation())
150 self.target_rotation = self.cameras['main'].getRotation() 151 self.target_rotation = self.cameras['main'].getRotation()
151 152
152 def save(self, filename): 153 def save(self, filename):
153 saveMapFile(filename, self.engine, self.map) 154 saveMapFile(filename, self.engine, self.map)
154 155