comparison pytouhou/vm/eclrunner.py @ 70:7c1f20407b3e

Add set_random_angle support
author Thibaut Girka <thib@sitedethib.com>
date Sat, 27 Aug 2011 11:24:22 +0200
parents a142e57218a0
children adac26098408
comparison
equal deleted inserted replaced
69:a142e57218a0 70:7c1f20407b3e
335 @instruction(48) 335 @instruction(48)
336 def set_acceleration(self, acceleration): 336 def set_acceleration(self, acceleration):
337 self._enemy.acceleration = acceleration 337 self._enemy.acceleration = acceleration
338 338
339 339
340 @instruction(49)
341 def set_random_angle(self, min_angle, max_angle):
342 angle = self._game_state.prng.rand_double() * (max_angle - min_angle) + min_angle
343 self._enemy.angle = angle
344
345
340 @instruction(50) 346 @instruction(50)
341 def set_random_angle(self, min_angle, max_angle): 347 def set_random_angle_ex(self, min_angle, max_angle):
342 if self._enemy.screen_box: 348 if self._enemy.screen_box:
343 minx, miny, maxx, maxy = self._enemy.screen_box 349 minx, miny, maxx, maxy = self._enemy.screen_box
344 else: 350 else:
345 minx, miny, maxx, maxy = (0., 0., 0., 0.) 351 minx, miny, maxx, maxy = (0., 0., 0., 0.)
346 352