questions on the Tanks tutorial

Hi everyone, I’m new on GD. Please help me out; I appreciate it!

  1. For the tanks tutorial, if I have a rocket as the projectile, how do I rotate the rocket so that it fires in the right orientation? RIght now it fires at the right spot, but the ORIENTATION is always with the nose at the top.
    For example, it fires to the right like this ^ ^ ^ instead of > > >.

  2. Is there a way to create explosions without the Particles Extension? I am building the app for Android instead of the web.

  3. I am creating an ash png so that after a tank explodes, there is a pile of ash where they were. But the problem is, if two tanks explode in the same spot, the second tank’s ash goes UNDER instead of OVER the first tank’s ash. It’s backwards.

Thanks for anyone’s help.

GD default direction (angle = 0) is facing to the right, try modifying the rocket sprite so it faces to the right.

Yes, with sprites, I think the tutorial use sprites for explosions.
By the way, particles are not available for web, only for native platform :wink:

Use a variable Ash_Z to store the current ash’s Z order, and increase it after an ash creation. If the ash objects should be always under the tanks, after creating a new ash, add 1 to every tank’s Z order so the ashes never overlap tanks. Of course the tanks should be created with a value greater than Ash_Z:

[code]Conditions: At the beginning of the scene
Actions: Do = 0 to variable Ash_Z (or a value lesser than the tanks Z order in the scene)

Conditions: Rocket collides with Tank
Actions: Create Ash at Tank.X(); Tank.Y()
Do = Variable(Ash_Z) to Z-Order of Ash
Do + 1 to variable Ash_Z
Delete Tank
// This is a sub event, I haven’t tested it but should work
Conditions: Consider all Tank objects
Actions: Do + 1 to Z-Order of Tank

Conditions: Conditions to create a new Tank
Actions: Create Tank at X; Y
Do = Variable(Ash_Z) + 1 to Z-Order of Tank
[/code]

Thanks, Lizard-13! I’ll try your suggestions.

Turning the rocket to the right didn’t do anything. It still fires in the right direction but with the wrong orientation.

There should be a change… for better or worse… :confused:
Your project was open while you edited the rocket image? If so, did you try to close the project and reopen it? So GD reloads the resources.

If the problem is not solved, share it here :slight_smile:

It sounds like you need to add another action -

All Objects > Angle > Rotate towards position

  • and put in the position of whatever the target is.