CodePudding user response:
Why is move by? notCodePudding user response:
Look at the code will be a problem, can only step by step debuggingCodePudding user response:
I'm better than the original poster is a novice, now even the plane how bullets fired all don't know,,,What a great god can do me a favor and tell me a little, if one of the most simple way, a lot of things didn't learn,,,
CodePudding user response:
Void the HelloWorld: : CreateBullet float (dt){
PlanePos=myPlane - & gt; GetPosition ();
Sprite * bullut=Sprite: : createWithSpriteFrameName (" bullet_0. PNG ");
This - & gt; AddChild (bullut, 10);
Bullut - & gt; SetPosition (planePos. X, planePos. Y);
ActionInterval * bullutMove=MoveBy: : create (0.2, Point (0, visibleSize. Height + 20));
Bullut - & gt; RunAction (bullutMove);
Bullut - & gt; SetScale (0.5);
BullutArr. PushBack (bullut);
}
Added to the timer
CodePudding user response: