Spritestacking difficulties (Stacking two objects on one base?)

Greetings, flowlabbers

I’m re-making my first playable game, Vehicle Battlefield. It was pretty good, but there were a few major things that needed fixing. First: the tank movement wasn’t the best. Second, the art could use an upgrade. Third, the maps were too large and the enemies to far apart.

The code was basic, the design was too. All in all, since finishing the game, I’ve learned a BUNCH about saving objects and polishing games, so I started to re-make Vehicle Battlefield.

First, I needed a cool menu, which I finished not too long ago. Second, I needed to make the tank more realistic, that’s what this topic is about.

I’m going to need help spritestacking a two-part tank. The gun and the body need to be attached to the same base, and the gun needs to be able to rotate on its own. Does anyone know how to do this?



Try making one spritestack for the base, and then another spritestack for the gun. For the gun spritestack, just add a bunch (Howevermany frames the base was) of empty frames before starting the gun.

I’m pretty sure this will work, but I haven’t tried it.

1 Like

I finished the base. I’ll do the gun tomorrow.

1 Like

I made the gun and fixed the display order, but it attaches in a weird way:

The easiest way to fix this is adding one pixel at the very back. Make it one alpha so it is hard to see…

Also you didn’t do what I said, you should add empty frames, as many as your base had, to your spritestack so the gun is on top.


Isn’t this easier?


Yes, you are right. This is easier:

Make sure to add on the Y position too

1 Like

yup, this is working for me, working for you?

1 Like

You sure?:

umm this is in the spritestack object not the player base

1 Like

The rest is. Only one thing:
Since the pixels are stacked closer and farther from the screen, then the gun won’t always be in the middle, since its rotation is different from the main body’s.

Oh, lol.

um one way to fix this is to make that gun area in the first spritestack completely in the middle, then that would fix it. Or you can mess around with the position of the back pixel to change the center rotation on the gun spritestack

1 Like

It is in the middle though.

I’ll try this.

no, I mean the spot on the first sprite stack base.

1 Like

pixels at the front make the center the center lol problem solved

1 Like

Huh? It still doesn’t rotate around the center. Try spinning the tank around a few times.

Ok, I’kk try is out sometime later, I have to leave now.

1 Like

Ok, bye for now.