thing
desc
This commit is contained in:
15
Throot.py
15
Throot.py
@@ -46,6 +46,9 @@ class GameManager:
|
|||||||
|
|
||||||
|
|
||||||
class Room:
|
class Room:
|
||||||
|
def __init__(self):
|
||||||
|
self.ind_button = 0
|
||||||
|
|
||||||
def start(self, event):
|
def start(self, event):
|
||||||
t0 = time.ticks_ms() # Get time (ms)
|
t0 = time.ticks_ms() # Get time (ms)
|
||||||
thumby.display.fill(0) # Fill canvas to black
|
thumby.display.fill(0) # Fill canvas to black
|
||||||
@@ -83,9 +86,19 @@ class RoomTitle(Room):
|
|||||||
#thumby.display.drawText('press a', x, y, 0)
|
#thumby.display.drawText('press a', x, y, 0)
|
||||||
thumby.display.drawText('start', x, y, 1)
|
thumby.display.drawText('start', x, y, 1)
|
||||||
|
|
||||||
thumby.display.blit(sprite_buttona.image, 2, 40 - 8, sprite_buttona.width, sprite_buttona.height,
|
spr_b = thumby.Sprite(sprite_buttona1.width, sprite_buttona1.height, sprite_buttona1.image + sprite_buttona2.image, 2, 40 - 8,
|
||||||
-1, 0, 0)
|
-1, 0, 0)
|
||||||
|
|
||||||
|
# thumby.display.blit(sprite_buttona.image, 2, 40 - 8, sprite_buttona.width, sprite_buttona.height,
|
||||||
|
# -1, 0, 0)
|
||||||
|
|
||||||
|
self.ind_button = (self.ind_button + 1) % (2 * CONST_FPS)
|
||||||
|
spr_b.setFrame(self.ind_button // (2 * CONST_FPS))
|
||||||
|
|
||||||
|
#print(self.ind_button // CONST_FPS)
|
||||||
|
|
||||||
|
thumby.display.drawSprite(spr_b)
|
||||||
|
|
||||||
class GameLoop(Room):
|
class GameLoop(Room):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.diving_velocity = 10
|
self.diving_velocity = 10
|
||||||
|
|||||||
@@ -189,8 +189,15 @@ sprite_title = SpriteImage(
|
|||||||
40
|
40
|
||||||
)
|
)
|
||||||
|
|
||||||
sprite_water = SpriteImage(
|
sprite_buttona1 = SpriteImage(
|
||||||
bytearray([60,98,221,203,203,221,98,60]) + bytearray([56,68,186,150,150,186,68,56]),
|
bytearray([60,98,221,203,203,221,98,60]),
|
||||||
|
None,
|
||||||
|
8,
|
||||||
|
8
|
||||||
|
)
|
||||||
|
|
||||||
|
sprite_buttona2 = SpriteImage(
|
||||||
|
bytearray([56,68,186,150,150,186,68,56]),
|
||||||
None,
|
None,
|
||||||
8,
|
8,
|
||||||
8
|
8
|
||||||
|
|||||||
Reference in New Issue
Block a user