Repository navigation
Expand file tree
/
Copy pathAbout.txt
More file actions
150 lines (141 loc) · 3.69 KB
/
Copy pathAbout.txt
File metadata and controls
150 lines (141 loc) · 3.69 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
I'm restarting this kinda, a few notes for the future:
- PaintScript only for now.
I made a new empty console project, we will make the PaintScript Engine here instead of directly in the VM.
So we are restarting.
Here is a basic script:
#PaintScript Alpha 0.1
#Sprite Sprite_1
@Start {
var message:String = "Hello, World!";
say(AddSmile(message));
}
function AddSmile(test) {
return test + " :)";
}
This get's compiled to json, then it get's linked, the linker links all the output json together making the final json program that the engine runs. Example final program:
{
"PaintScript": "Alpha 0.1.0",
"Permissions": {
"FileSystem": false,
"Networking": false
},
"StageSize": {
"width": 640,
"height": 450
},
"Targets": [
{
"name": "Sprite 1",
"instance-name": "Sprite_1",
"isVisible": false,
"x": 0,
"y": 0,
"direction": 90,
"size": 0
}
],
"global-variables": null,
"global-functions": null,
"Code": [
{
"target": "Sprite_1",
"code": {
"event handlers": {
"Start": [
[
{
"callable": false,
"call": null,
"op": "var",
"type": "#System.Types.Variable.Local",
"value": {
"type": "#System.Types.String",
"value": "Hello, World!"
},
"name": { "value": "message", "pointer": "0x8747r" }
},
{
"callable": false,
"call": null,
"op": "fn_call",
"value": {
"type": "#System.Types.Function",
"value": "say",
"callable": true,
"call": true
},
"args": [
"#System.Sprite.Say",
[
{
"type": "#System.Types.Function",
"value": "$Sprite_1.AddSmile",
"callable": true,
"call": true,
"args": [
{
"type": "#System.Types.String",
"value": "!var{0x8747r}",
"callable": false,
"call": false,
"args": []
}
]
}
]
]
},
{
"callable": false,
"op": "event_call",
"value": "@refresh",
"args": [
"#System.Diplay.refresh"
],
"code": null
}
]
],
"Receive": [
[]
]
},
"public-functions": [
{
"type": "*",
"name": "AddSmile",
"params": [
{
"type": "*",
"name": "text"
}
],
"code": [
{
"op": "return",
"value": {
"op": "expression",
"value": [
{
"op": "add",
"value": null,
"args": [
{
"value": "!param{name}"
},
{
"value": " :)"
}
]
}
]
}
}
]
}
],
"public-variables": null
}
}
]
}