Python Forum
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to copy an object
#3
If you deepcopy anything. It copies everything.
Personal I never use pygame sprites class.

Example.
class Ship
    # class instance. There be only one. doesn't matter how many objects you make.
    image = # load ship image

    def __init__(self):
        self.image = pygame.transform.rotate(Ship.image, angle)

class Rock:
    image = # load rock image

    def __init__(self):
        self.image = pygame.transform.rotate(Rock.image, angle)
99 percent of computer problems exists between chair and keyboard.
Reply


Messages In This Thread
How to copy an object - by microphone_head - Aug-05-2018, 09:18 AM
RE: How to copy an object - by metulburr - Aug-05-2018, 01:15 PM
RE: How to copy an object - by microphone_head - Aug-05-2018, 03:02 PM
RE: How to copy an object - by Windspar - Aug-05-2018, 01:57 PM
RE: How to copy an object - by metulburr - Aug-05-2018, 03:31 PM
RE: How to copy an object - by metulburr - Aug-05-2018, 06:38 PM
RE: How to copy an object - by Windspar - Aug-05-2018, 06:42 PM
RE: How to copy an object - by microphone_head - Aug-05-2018, 07:42 PM
RE: How to copy an object - by Windspar - Aug-05-2018, 11:17 PM

Forum Jump:

User Panel Messages

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