> This if statement does not work. Neither does mainTo.isDone. Is
> there a way to find out if my character has landed after jumping
> that's not a hack?
>
> id mainTo = [JumpTo actionWithDuration:2 position:
> [DieMonstersDieAppDelegate get].mainCharacter.position height:50
> jumps:1];
>
> if ([mainTo isDone]) {
> [[DieMonstersDieAppDelegate get].mainCharacter runAction: mainTo];
> }
[action stop] is called when the action stops. What I'm doing right
now in ShinyCocos to install a hook when the action stops is to use
that stop selector. Actually, I'm replacing the implementation of
@selector(stop) in the Action class, but you could get the same effect
subclassing JumpTo and implementing just the stop method, or just
opening it:
@interface JumpTo (StopHook)
- (void)stop;
@end
@implementation JumpTo (StopHook)
- (void)stop {
// do something here
}
@end
Also, are you constantly testing for [mainTo isDone]?...
hth,
--
Rolando Abarca M.