-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathc-info.py
executable file
·61 lines (53 loc) · 1.56 KB
/
c-info.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
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/python
from libavg import avg, anim
MoreGlueh = False
ClampActive = False
def onCursorDown(Event):
global ClampActive
StackNode = Player.getElementByID("stack")
ClampNode = Player.getElementByID("clamp0")
ClampActive = not(ClampActive)
if ClampActive:
StackNode.x = ClampNode.x
StackNode.y = ClampNode.y
anim.fadeIn(StackNode, 100, 1)
ClampNode.opacity = 0
else:
anim.fadeOut(StackNode, 100)
ClampNode.opacity = 1
def onFrame():
global MoreGlueh
global ClampActive
if not(ClampActive):
Node = Player.getElementByID("clamp0")
# Node.angle += 0.002
Node.x += 0.1
Node.y += 0.1
Node = Player.getElementByID("gluehen")
if MoreGlueh:
Node.opacity += 0.002
if Node.opacity > 0.5:
MoreGlueh = False
else:
Node.opacity -= 0.002
if Node.opacity < 0.2:
MoreGlueh = True
Node = Player.getElementByID("greece")
Node.x -= 0.1
Node.y -= 0.04
for id in ["weltraum0", "weltraum1", "weltraum2", "weltraum3"]:
Node = Player.getElementByID(id)
Node.x -= 0.1
Node.y -= 0.04
Player = avg.Player()
Player.loadFile('c-info.avg')
Player.setResolution(1,0,0,0)
Player.setVBlankFramerate(1)
for id in ["clamp0", "clamp1", "clamp2", "clamp3", "clamp4", "clamp5", "clamp6"]:
Node = Player.getElementByID(id)
Node.play()
Node.setEventHandler(avg.CURSORDOWN, avg.TOUCH, onCursorDown)
Player.setOnFrameHandler(onFrame)
Player.addTracker()
anim.init(Player)
Player.play()