Parcourir la source

lifegame cocos: zoom

Bastien Sevajol il y a 8 ans
Parent
révision
3c514177dc
1 fichiers modifiés avec 9 ajouts et 1 suppressions
  1. 9 1
      sandbox/life_game/gui.py

+ 9 - 1
sandbox/life_game/gui.py Voir le fichier

62
     def __init__(self):
62
     def __init__(self):
63
         super().__init__()
63
         super().__init__()
64
 
64
 
65
-        self.scroll_step = 20
65
+        self.scroll_step = 100
66
 
66
 
67
         self.background = Sprite('resources/banner-1711735_640.jpg')
67
         self.background = Sprite('resources/banner-1711735_640.jpg')
68
         self.background.position = 0, 0
68
         self.background.position = 0, 0
95
         if key == wkey.DOWN:
95
         if key == wkey.DOWN:
96
             self.position = (self.position[0], self.position[1] + self.scroll_step)
96
             self.position = (self.position[0], self.position[1] + self.scroll_step)
97
 
97
 
98
+        if key == wkey.A:
99
+            if self.scale >= 0.3:
100
+                self.scale -= 0.2
101
+
102
+        if key == wkey.Z:
103
+            if self.scale <= 4:
104
+                self.scale += 0.2
105
+
98
 
106
 
99
 class LifeGameGui(Gui):
107
 class LifeGameGui(Gui):
100
     def __init__(
108
     def __init__(