-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgamer.py
41 lines (34 loc) · 1.01 KB
/
gamer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from turtle import Turtle, Screen
Sqr = "square"
Col = "white"
pkt = 0
class Gracz():
def __init__(self):
self.gm = Turtle(Sqr)
self.gm.color(Col)
self.gm.penup()
self.gm.goto(0, -200)
def gora(self):
if self.gm.heading() == 90:
self.gm.forward(15)
if self.gm.heading() != 90:
self.gm.setheading(90)
def dol(self):
if self.gm.heading() == 270:
self.gm.forward(15)
if self.gm.heading() != 270:
self.gm.setheading(270)
# self.calculate_distance()
def lewa(self):
if self.gm.heading() == 180:
self.gm.forward(15)
if self.gm.heading() != 180:
self.gm.setheading(180)
# self.calculate_distance()
def prawa(self):
if self.gm.heading() == 0:
self.gm.forward(15)
if self.gm.heading() != 0:
self.gm.setheading(0)
# self.calculate_distance()
# def g(self):