Procházet zdrojové kódy

lifegame cocos: zoom

Bastien Sevajol před 8 roky
rodič
revize
3c514177dc
1 změnil soubory, kde provedl 9 přidání a 1 odebrání
  1. 9 1
      sandbox/life_game/gui.py

+ 9 - 1
sandbox/life_game/gui.py Zobrazit soubor

@@ -62,7 +62,7 @@ class MainLayer(ScrollableLayer):
62 62
     def __init__(self):
63 63
         super().__init__()
64 64
 
65
-        self.scroll_step = 20
65
+        self.scroll_step = 100
66 66
 
67 67
         self.background = Sprite('resources/banner-1711735_640.jpg')
68 68
         self.background.position = 0, 0
@@ -95,6 +95,14 @@ class MainLayer(ScrollableLayer):
95 95
         if key == wkey.DOWN:
96 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 107
 class LifeGameGui(Gui):
100 108
     def __init__(