Deutsch   English   Français   Italiano  
<IfmdnZyKJqzosGH8nZ2dnUU7_8zNnZ2d@giganews.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 03 Feb 2022 13:31:01 -0600
Newsgroups: fr.comp.lang.python
Subject: Python et pygame
X-poster: PEAR::Net_NNTP v1.5.0 (stable)
From: Tobias467 <nospam_antonymanon@icloud.com.invalid>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
Organization: !No_Organization!
Message-ID: <IfmdnZyKJqzosGH8nZ2dnUU7_8zNnZ2d@giganews.com>
Date: Thu, 03 Feb 2022 13:31:01 -0600
Lines: 44
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-Fwk0YmdvCHHcKPIhFaOLRt6Z9MpVVE36N6COfU3Vd3saHu1BujdqQQeQ7BZSdYFfGYquPJY4Pfpfj2o!bIFIwlTL2iZeAFtTCSHePkoVBfQatnb5jqNJxEdnXVfNYrvkbwGUlQZ9zAuGyBmEUGL84duywLsh
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
Bytes: 2245

Bonjour,

from graphique jeu import
from pygame. locals import K_UP, K_DOWN, K_RIGHT, K_LEFT, QUIT
from random import randint

### Vos fonctions ci-dessous
def cree _listes (taillex, tailley, nbre):
taillex,taillev: dimensions de l'écran de jeu Nbre
nombre de carrés voulus crée deux listes x et ly de carrés mobiles en début de
jeu, et les renvoie"""
# code:

Fonction du jeu
def jeu (taillex, tailley) :
"'" taillex et tailley sont les dimensions du jeu souhaitées
Règles du jeu :
delai=
# délai en secondes entre deux mouvements des objets
# création des objets mobiles en début de jeu (combien ?)
lx, ly = cree_ listes (taillex, tailley,
# Initialisation de x et y les coordonnées du carré perso
y
# Autres initialisation (score, points de vie,
?)
# Cette variable pourra passer à False quand on aura perdu (ou qu'
# arrêter le jeu)
continuer = True
t=0 # temps écoulé depuis le délai, ne pas modifier
T
###### Boucle principale du jeu #
while continuer:
# Gestion des évènements
for event in pygame.event.get (): # Si on quitte
if event. type
== pygame. QUIT:
pygame.quit()
return
# Si touche appuyée
if event.type
== pygame. KEYDOWN:
if event.key== K LEFT:
#
appui sur la touche
"gauche"