-
Notifications
You must be signed in to change notification settings - Fork 2
/
gop_autogen.go
99 lines (94 loc) · 1.62 KB
/
gop_autogen.go
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Code generated by gop (Go+); DO NOT EDIT.
package main
import "github.com/goplus/spx"
const _ = true
type Calf struct {
spx.Sprite
*Game
}
type Maze struct {
spx.Sprite
*Game
}
type Red struct {
spx.Sprite
*Game
}
type Game struct {
spx.Game
Calf Calf
Maze Maze
Red Red
mhit spx.Sound
}
func (this *Game) MainEntry() {
}
func (this *Game) Main() {
spx.Gopt_Game_Main(this, new(Calf), new(Maze), new(Red))
}
//line Calf.spx:1
func (this *Calf) Main() {
//line Calf.spx:1:1
this.OnStart(func() {
//line Calf.spx:2:1
this.SetXYpos(-204, 145)
//line Calf.spx:3:1
for {
spx.Sched()
//line Calf.spx:4:1
if this.Touching("Maze") {
//line Calf.spx:5:1
this.Play__0(this.mhit)
//line Calf.spx:6:1
this.SetXYpos(-204, 145)
}
//line Calf.spx:8:1
if this.Touching("Red") {
//line Calf.spx:9:1
this.Say("You win")
//line Calf.spx:10:1
this.Wait(3)
//line Calf.spx:11:1
spx.Exit__0(-1)
}
//line Calf.spx:13:1
this.Wait(0.03)
}
})
//line Calf.spx:17:1
this.OnKey__0(spx.KeyUp, func() {
//line Calf.spx:18:1
this.ChangeYpos(3)
})
//line Calf.spx:21:1
this.OnKey__0(spx.KeyDown, func() {
//line Calf.spx:22:1
this.ChangeYpos(-3)
})
//line Calf.spx:25:1
this.OnKey__0(spx.KeyLeft, func() {
//line Calf.spx:26:1
this.ChangeXpos(-3)
})
//line Calf.spx:29:1
this.OnKey__0(spx.KeyRight, func() {
//line Calf.spx:30:1
this.ChangeXpos(3)
})
}
func (this *Calf) Classfname() string {
return "Calf"
}
func (this *Maze) Classfname() string {
return "Maze"
}
func (this *Maze) Main() {
}
func (this *Red) Classfname() string {
return "Red"
}
func (this *Red) Main() {
}
func main() {
new(Game).Main()
}