Skip to content

Commit 8ceef64

Browse files
committed
map snippets and partial math
1 parent 6b69194 commit 8ceef64

File tree

2 files changed

+69
-2
lines changed

2 files changed

+69
-2
lines changed

snippets/map.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
11
{
2-
2+
"map.map": {
3+
"prefix": "map",
4+
"scope": "pico8p8",
5+
"body": [
6+
"map(${1:cell_x},${2:cell_y},${3:screen_x},${5:screen_y},${3:cells_wide},${3:cells_high})",
7+
"$0"
8+
],
9+
"description": "Draw the selection of map cells at the given screen position"
10+
},
11+
"map.mget": {
12+
"prefix": "mget",
13+
"scope": "pico8p8",
14+
"body": [
15+
"mget(${1:cell_x},${2:cell_y})",
16+
"$0"
17+
],
18+
"description": "Gets the map value of the given cell"
19+
},
20+
"map.mset": {
21+
"prefix": "mset",
22+
"scope": "pico8p8",
23+
"body": [
24+
"mset(${1:cell_x},${2:cell_y},${3:value})",
25+
"$0"
26+
],
27+
"description": "Sets the map value of the given cell"
28+
}
329
}

snippets/math.json

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
11
{
2-
2+
"math.abs": {
3+
"prefix": "abs",
4+
"body": [
5+
"abs(${1:value})"
6+
],
7+
"description": "Abolute value"
8+
},
9+
"math.atan2": {
10+
"prefix": "atan2",
11+
"body": [
12+
"atan2(${1:dx},${1:dy})"
13+
],
14+
"description": "Converts dx,dy to an angle in the range 0-1"
15+
},
16+
"math.band": {
17+
"prefix": "band",
18+
"body": [
19+
"band(${1:x},${1:y})"
20+
],
21+
"description": "Bitwise AND"
22+
},
23+
"math.bnot": {
24+
"prefix": "bnot",
25+
"body": [
26+
"bnot(${1:x},${1:y})"
27+
],
28+
"description": "Bitwise NOT"
29+
},
30+
"math.bor": {
31+
"prefix": "bor",
32+
"body": [
33+
"bor(${1:x},${1:y})"
34+
],
35+
"description": "Bitwise OR"
36+
},
37+
"math.bxor": {
38+
"prefix": "bxor",
39+
"body": [
40+
"bxor(${1:x},${1:y})"
41+
],
42+
"description": "Bitwise XOR"
43+
}
344
}

0 commit comments

Comments
 (0)