Python Forum
Bringing My Game Code Into Class Format
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bringing My Game Code Into Class Format
#2
The best move would be to use the pygame Sprite class. Plenty of tutorials and examples out there. You can use one class for your tanks and one for your projectiles. This will also allow you to use the pygame sprite collision to tell when a tank gets hit.

www.101computing.net/creating-sprites-using-pygame/
Reply


Messages In This Thread
Bringing My Game Code Into Class Format - by ZQ12 - Dec-22-2019, 12:55 AM
RE: Bringing My Game Code Into Class Format - by michael1789 - Dec-22-2019, 05:32 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  My game's code works but Python still freezes at random intervals. game_slayer_99 13 8,185 Dec-09-2021, 11:23 AM
Last Post: metulburr
  Game “Pong” I have problems with the code BenBach18 2 3,627 Jan-10-2021, 05:16 PM
Last Post: michael1789
  Creating a “Player” class, and then importing it into game onizuka 4 3,199 Sep-01-2020, 06:06 PM
Last Post: onizuka

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020