1st time pygamer here does anyone know how to add more than 1 copy of a sprite into your window?
class Spriterock:
def __init__(self,x,y,width,height):
self.x=x
self.y=y
self.width=width
self.height=height
self.i2 = pygame.image.load("rocks.png")
def render(self):
window.blit(self.i2, (self.x,self.y))
Sprite2=Spriterock(random.randrange(150,350),random.randrange(100,400),62,47)
im trying to make more of the rocks
EDIT
do you guys know how to apply the same properties to the clones as well? im using
def detectCollisionsrock(x1,y1,w1,h1,x2,y2,w2,h2):
if (x2+w2>=x1>=x2 and y2+h2>=y1>=y2):
return True
elif (x2+w2>=x1+w1>=x2 and y2+h2>=y1>=y2):
return True
elif (x2+w2>=x1>=x2 and y2+h2>=y1+h1>=y2):
return True
elif (x2+w2>=x1+w1>=x2 and y2+h2>=y1+h1>=y2):
return True
else:
return False
collisionsrock=detectCollisionsrock(Sprite1.x,Sprite1.y,Sprite1.width,Sprite1.height,rock.x,rock.y,rock.width,rock.height,)