space.py
def merge(self, planet):
        """Merge 2 planets together when they collide"""
        if planet.exist is True and self.exist is True:
            # Pick the planet with the highest mass to be the origin
            planet.exist = False
            self.x = self.x if self.mass > planet.mass else planet.x
            self.y = self.y if self.mass > planet.mass else planet.y
            self.mass = self.mass + planet.mass
            self.density = max((self.density, planet.density))
            self.radius = self.size
            self.set_color(((self.color[0] + planet.color[0]) / 2, (self.color[1] + planet.color[1]) / 2, (self.color[2] + planet.color[2]) / 2))
            self.ix = 0
            self.iy = 0
Merge 2 planets together when they collide
Merge 2 planets together when they collide
Merge 2 planets together when they collide
def merge(self, planet):
        if planet.exist is True and self.exist is True:
            planet.exist = False
            self.x = self.x if self.mass > planet.mass else planet.x
            self.y = self.y if self.mass > planet.mass else planet.y
            self.mass = self.mass + planet.mass
            self.density = max((self.density, planet.density))
            self.radius = self.size
            self.set_color(((self.color[0] + planet.color[0]) / 2, (self.color[1] + planet.color[1]) / 2, (self.color[2] + planet.color[2]) / 2))
            self.ix = 0
            self.iy = 0
def merge ( self , planet ) : if planet . exist is True and self . exist is True : planet . exist = False self . x = self . x if self . mass > planet . mass else planet . x self . y = self . y if self . mass > planet . mass else planet . y self . mass = self . mass + planet . mass self . density = max ( ( self . density , planet . density ) ) self . radius = self . size self . set_color ( ( ( self . color [ 0 ] + planet . color [ 0 ] ) / 2 , ( self . color [ 1 ] + planet . color [ 1 ] ) / 2 , ( self . color [ 2 ] + planet . color [ 2 ] ) / 2 ) ) self . ix = 0 self . iy = 0
Merge 2 planets together when they collide
Merge 2 planets together when they collide
"""Merge 2 planets together when they collide""" # Pick the planet with the highest mass to be the origin

self
planet