I try to transfer my project(solar system) to OOP. I don't know how to tell the class that it should create a sphere for every project? How can I assign it with "shape"?
Original code:
...
planets = []
#Sonne
sun = sphere(pos = vec(0,0,0), radius = 5, make_trail = True )
sun.mass = 2e30
sun.velocity = vec(0,0,0)
...
planets.extend((mercury,venus,earth,mars,jupiter,saturn,uranus,neptun,pluto))
OOP:
...
planets = []
class Planet(object):
def __init__(pos,radius,mass,velocity,make_trail)
sun = Planet((0,0,0),5,2e30,(0,0,0)True)
...
planets.extend((mercury,venus,earth,mars,jupiter,saturn,uranus,neptun,pluto))