-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshapes.py
50 lines (35 loc) · 1.1 KB
/
shapes.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
42
43
44
45
46
47
48
49
50
import EdgeLaser
import time
game = EdgeLaser.LaserGame('SuperTetris')
game.setResolution(500).setDefaultColor(EdgeLaser.LaserColor.LIME)
coeff = 0
posx = 450
posy = 450
font = EdgeLaser.LaserFont('lcd.elfc')
while game.isStopped():
game.receiveServerCommands()
i = 1
while not game.isStopped():
commands = game.receiveServerCommands()
# for cmd in commands:
if game.player1_keys:
if game.player1_keys.yp :
posy-=5
if game.player1_keys.xn :
posx-=5
if game.player1_keys.yn :
posy+=5
if game.player1_keys.xp :
posx+=5
game.addRectangle(posx, posy, posx+10, posy+10, EdgeLaser.LaserColor.RED)
coeff = 0 if coeff > 499 else coeff + 4
i += 1
if i > 400:
i = 1
font.render(game, 'EDGEFEST', 40, 40, coeff=i%40+1)
game.addLine(250, 0, coeff, 250, EdgeLaser.LaserColor.CYAN) \
.addLine(250, 500, coeff, 250, EdgeLaser.LaserColor.CYAN) \
.addCircle(250, 250, coeff, EdgeLaser.LaserColor.FUCHSIA) \
.addRectangle(10, 10, coeff, coeff) #\
game.refresh()
time.sleep(0.05)