On Tue, Jul 6, 2010 at 12:16 AM, Richard Jones <[email protected]>wrote:
> > This is how I'm handling it: > > class MoveShip(actions.WrappedMove): > def step(self, dt): > self.target.dr = (keys[key.RIGHT] - keys[key.LEFT]) * 360 > rotation = math.pi * self.target.rotation / 180.0 > rotation_x = math.cos(-rotation) > rotation_y = math.sin(-rotation) > if keys[key.UP]: > self.target.acceleration = (200 * rotation_x, 200 * rotation_y) > super(MoveShip, self).step(dt) > > and then: > > ship.do(MoveShip()) > > which *I* think is quite elegant. I'm used to people disagreeing with > me though :-) > > Looks good, but if you want me to nitpick, you need to handle key bindings... Just teasing, Richard ! > > Unfortunately there's that one unit test that relies on the old > behaviour to test the setting of the target on the IntervalAction - > but it tests once the action is complete. > > > > I am a bit tired, need to update text files in the top dir of trunk, > update > > setup py, work in the cocos2d.org upgrade. > > So, if feasible i would prefer to revert the other changes instead of dig > > the test to see if I need to fix the tests, the base_actions code or > what. > > Given this I will revert the changes. > > Probably the change was reasonable, but I thanks for your comprehension. -- claudio -- You received this message because you are subscribed to the Google Groups "cocos2d discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/cocos-discuss?hl=en.
