0

Alright so, i'm currently working on a big pygame project. I'm actually working on building a tank game, based on space invaders. The issue is(i mean it's not necessary, but whatever) that whenever my tank moves left or right, i want him to leave a certain trail. Now, the trail is an image of an actual tank trail, and i'd like to keep displaying that image after he moves left, right, down or up, exactly like he's leaving a trail;. The point is that i want my game to look very cool, and i think this is a big extra to that. I won't post my code since i just need general instructions on this topic, not a specific code clarification or something else.

Thank you all in advance, you're awesome! :D

P.S. Here's a trail image! I'm srr it's a link tho :(

https://i.stack.imgur.com/177IS.png

1 Answers1

1

You would have to create an image for the tread marks and then load it using transparency/alpha. Then as you drive you would need to add those to a list with positions trailing the tank as it drove. You would need to keep the entire list of the trail and keep drawing it onto the background as you redraw the screen.

One thing to keep in mind is that if the tank drives back over them, you will not want them visible over the tank, so you will need to layers or just make sure that the tank is drawn last.

Glenn Mackintosh
  • 2,765
  • 1
  • 10
  • 18
  • Can you send me a code example? I mean, i'm sorry to bother, i understood the concept, but i don't actually know how to put it into code :( It's logical and I think it should work once i figure out how to actually do that! – Dimitrije Grozdanovic May 27 '20 at 19:40