Skip to content
Snippets Groups Projects
Commit 09e12d5c authored by Andrew B's avatar Andrew B
Browse files

scale it

parent 2b798b33
No related branches found
No related tags found
No related merge requests found
# Port of this pygame tetris https://gist.github.com/silvasur/565419 # Port of this pygame tetris https://gist.github.com/silvasur/565419
#
#
# Copyright (c) 2010 "Laria Carolin Chabowski"<me@laria.me> # Copyright (c) 2010 "Laria Carolin Chabowski"<me@laria.me>
# #
# Permission is hereby granted, free of charge, to any person obtaining a copy # Permission is hereby granted, free of charge, to any person obtaining a copy
...@@ -205,6 +203,12 @@ class TetrisApp(Application): ...@@ -205,6 +203,12 @@ class TetrisApp(Application):
def draw(self, ctx: Context) -> None: def draw(self, ctx: Context) -> None:
# Paint the background black # Paint the background black
ctx.rgb(0, 0, 0).rectangle(-120, -120, 240, 240).fill() ctx.rgb(0, 0, 0).rectangle(-120, -120, 240, 240).fill()
ctx.scale(2, 2).translate(-25, -50)
ctx.rgb(1, 1, 1).rectangle(0, 0, self.width, self.height).stroke()
# abc w 0 x 2 0 -100
# def 0 h y 0 2 -100
# ghi 0 0 1 0 0 1
if self.gameover: if self.gameover:
ctx.text_align = ctx.CENTER ctx.text_align = ctx.CENTER
...@@ -242,7 +246,7 @@ class TetrisApp(Application): ...@@ -242,7 +246,7 @@ class TetrisApp(Application):
self.input.think(ins, delta_ms) self.input.think(ins, delta_ms)
if self.input.buttons.app.middle.pressed: if self.input.buttons.app.middle.pressed:
self.rotate_stone self.rotate_stone()
elif self.input.buttons.app.left.pressed: elif self.input.buttons.app.left.pressed:
self.move(-1) self.move(-1)
elif self.input.buttons.app.right.pressed: elif self.input.buttons.app.right.pressed:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment