-(void)mainLoop:(ccTime)delta {
...................
if(!mySprite.dead) {
[mySprite runAction:myAction];
}
....................
}
works very well... thanks
on a side note, I'm now attempted to "objectize" the entire code more and I'm finding myself lacking in some basic understanding I think.
I read and read the touchesTest code and have adopted (successfully I think) the paddle code to control my movement buttons that control that ship. I believe I understand applying the touches logic to the object rather than my entire program - like I was doing before.
However,
I have in my init:
MyButton *upButton = [MyButton buttonWithTexture:upButtonTexture];
//Sprite *upButton = [Sprite spriteWithFile:@"BTN_arrowUP.png"];
upButton.position = CGPointMake(435, 100);
upButton.scale=1.5f;
[upButton setOpacity:128];
[self addChild:upButton z:3 tag:7];
I don't know enough about objects vs the sprites they are replacing yet to change the accessors any more than that..
So I have my up and down buttons defined that way and the MyButton class should be handling the touches in a similar way to the paddle class.
In my step: schedule, i have:
Sprite *ship1 = (Sprite *)[self getChildByTag:1];
Sprite *ship2 = (Sprite *)[self getChildByTag:11];
MyButton *upButton (MyButton *)[self getChildByTag:7];
MyButton *downButton (MyButton *)[self getChildByTag:8];
and im getting errors on the "getChildByTag:" I'm not sure what to do next?