Hello everyone
I'm new to pythonista and programming, trying to write tetris
For now i have buttons⬅️⬆️⬇️➡️ and a frame. But yhe frame is to much in the corner and i can't move it
Here's the code
import arrows
from scene import *
colors = ['purple', 'red', 'blue', 'orange', 'yellow', 'green',
'lightblue']
sw = get_screen_size()[0]
sh = get_screen_size()[1]
class Board(ShapeNode):
def __init__(self, parent=None, *args, **kwargs):
self.rect_w = sw/2
self.rect_h = sh-100
path = ui.Path.rect(0, 0, self.rect_w, self.rect_h)
path.line_width = 10
super().__init__(path,
fill_color='white',
stroke_color='purple',
parent=parent,
*args, **kwargs)
def draw_lines(self):
stroke(0, 0, 0)
stroke_weight(2)
line(l*30+50, self.rect_h+50, l*30+50, 50)
class Game(Scene):
def setup(self):
self.background_color = 'white'
Board(parent=self)
self.add_buttons()
def add_buttons(self):
ars = arrows.Main()
self.present_modal_scene(ars)
if __name__ == '__main__':
run(Game())
In the line path = ui.Path.rect(0, 0, self.rect_w, self.rect_h) if i change first two args from zero, nothing changes. So what they do? And how i can change pos of the frame?





