Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ii:lab:laborator3 [2020/11/16 11:03]
radu.mantu [Exerciții]
ii:lab:laborator3 [2020/11/25 10:25] (current)
florin.stancu [Input de la utilizator] fix code
Line 102: Line 102:
  
 import pygame import pygame
 +from pygame import KEYDOWN
    
 screen = pygame.display.set_mode((800,​ 600)) screen = pygame.display.set_mode((800,​ 600))
Line 113: Line 114:
    
         if event.type == KEYDOWN:         if event.type == KEYDOWN:
-            if event.key == K_UP:+            if event.key == pygame.K_UP:
                 print '​sageata sus'                 print '​sageata sus'
-            elif event.key == K_DOWN:+            elif event.key == pygame.K_DOWN:
                 print '​sageata jos'                 print '​sageata jos'
-            elif event.key == K_LEFT:+            elif event.key == pygame.K_LEFT:
                 print '​sageata stanga'​                 print '​sageata stanga'​
-            elif event.key == K_RIGHT:+            elif event.key == pygame.K_RIGHT:
                 print '​sageata dreapta'​                 print '​sageata dreapta'​
-            elif event.key == K_SPACE:+            elif event.key == pygame.K_SPACE:
                 print '​space'​                 print '​space'​
  
ii/lab/laborator3.1605517392.txt.gz · Last modified: 2020/11/16 11:03 by radu.mantu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0