@silkweaver/build 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,45 @@
1
+ export class obj_player extends gm_object {
2
+
3
+ on_step(): void {
4
+ // inputs
5
+ let key_up = keyboard_check(ord("W"));
6
+ let key_down = keyboard_check(ord("S"));
7
+ let key_left = keyboard_check(ord("A"));
8
+ let key_right = keyboard_check(ord("D"));
9
+
10
+ //direction
11
+ let dir: vector2 = new vector2(0,0);
12
+ if (key_up) {
13
+ dir.y = -1;
14
+ }
15
+
16
+ if (key_down) {
17
+ dir.y = 1;
18
+ }
19
+
20
+ if (key_left) {
21
+ dir.x = -1;
22
+ }
23
+
24
+ if (key_right) {
25
+ dir.x = 1;
26
+ }
27
+
28
+ // motion
29
+ let motion_x = dir.x * this.spd;
30
+ let motion_y = dir.y * this.spd;
31
+
32
+ if (!this.place_meeting(this.x + motion_x, this.y, _col)) {
33
+ this.x += motion_x;
34
+ }
35
+
36
+ if (!this.place_meeting(this.x, this.y + motion_y, _col)) {
37
+ this.y += motion_y;
38
+ }
39
+
40
+
41
+ }
42
+
43
+ static sprite = 'spr_player'
44
+ spd = 3
45
+ }
@@ -0,0 +1,6 @@
1
+ export class obj_wall extends gm_object {
2
+
3
+
4
+ static sprite = 'spr_wall'
5
+ static parent = _col
6
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "Top-down",
3
+ "version": "1.0.0",
4
+ "engineVersion": "1.0.0",
5
+ "settings": {
6
+ "roomSpeed": 60,
7
+ "windowWidth": 640,
8
+ "windowHeight": 480,
9
+ "startRoom": "room_main",
10
+ "displayColor": "#101814"
11
+ },
12
+ "resources": {
13
+ "sprites": {
14
+ "spr_player": {
15
+ "name": "spr_player"
16
+ },
17
+ "spr_wall": {
18
+ "name": "spr_wall"
19
+ }
20
+ },
21
+ "sounds": {},
22
+ "backgrounds": {},
23
+ "paths": {},
24
+ "scripts": {},
25
+ "fonts": {},
26
+ "timelines": {},
27
+ "objects": {
28
+ "obj_player": {
29
+ "name": "obj_player"
30
+ },
31
+ "obj_wall": {
32
+ "name": "obj_wall"
33
+ },
34
+ "_col": {
35
+ "name": "_col"
36
+ }
37
+ },
38
+ "rooms": {
39
+ "room_main": {
40
+ "name": "room_main"
41
+ }
42
+ }
43
+ }
44
+ }