Faire des missiles
Bonjour je suis débutant en Python et je souhaite créer des objets (ici missiles, shurikens) avec des points de coordonnées y randint pour les 2 mais je souhaite que les 2 ne se touchent pas.
Savez vous comment faire svp.

mon code :

 Code : Sélectionner tout - Visualiser dans une fenêtre à part
```123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114import  pygame
from random import *
from pygame.locals import *

blue = (113,177,227) #valeur max =255.
white = (255,255,255)
black = (0, 0, 0)

pygame.init()

surfaceW = 800
surfaceH = 500
persoW = 50
persoH = 66
shurikenW = 300
shurikenH = 300
missileW = 300
missileH = 150

surface = pygame.display.set_mode((surfaceW,surfaceH))
pygame.display.set_caption("main")

obstacle.set_colorkey((255,255,255))

missile.set_colorkey((255, 255, 255))

def personnage(x,y, image):
surface.blit(image, (x, y))

def shuriken(x,y, image ):
surface.blit(image, (x, y))

def lance_roquette(x, y, image):
surface.blit(image, (x, y))

def main():
x_perso = 0
y_perso = 360
y_move = 0
x_move = 0

x_shuriken = surfaceW
y_shuriken = randint(0, 450)
shuriken_vitesse = 1

x_missile = surfaceW
y_missile = randint(50,400)
missile_vitesse = 0.60

game_over = False

while not game_over:
for event in pygame.event.get():
if event.type == pygame.QUIT:
game_over= True
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_UP:
y_move = -0.50
if event.key == pygame.K_DOWN:
y_move = 0.50
if event.type == pygame.KEYUP:
y_move = 0

y_perso += y_move
x_shuriken -= shuriken_vitesse
x_missile -= missile_vitesse

if x_shuriken  < (-1*shurikenW):
y_shuriken = randint(0, 450)
x_shuriken = surfaceW

if x_missile < (-1*missileW):
y_missile = randint(50, 400)
x_missile = surfaceW

surface.fill(blue)

shuriken(x_shuriken, y_shuriken, obstacle )

personnage(x_perso, y_perso,perso)

lance_roquette(x_missile, y_missile, missile)

pygame.display.update()

main()
pygame.quit()
quit()```