create-bloop 0.0.17 → 0.0.18
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.
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ export function draw(g: typeof game, toodle: Toodle) {
|
|
|
6
6
|
toodle.startFrame();
|
|
7
7
|
toodle.draw(
|
|
8
8
|
toodle.shapes.Circle({
|
|
9
|
-
|
|
9
|
+
radius: 50,
|
|
10
10
|
scale: bag.scale,
|
|
11
11
|
position: { x: bag.x, y: bag.y },
|
|
12
12
|
color: Colors.web.hotPink,
|
|
@@ -14,7 +14,7 @@ export function draw(g: typeof game, toodle: Toodle) {
|
|
|
14
14
|
);
|
|
15
15
|
toodle.draw(
|
|
16
16
|
toodle.shapes.Rect({
|
|
17
|
-
|
|
17
|
+
size: { width: 10, height: 10 },
|
|
18
18
|
position: toodle.convertSpace(
|
|
19
19
|
{ x: bag.mouse.x, y: bag.mouse.y },
|
|
20
20
|
{ from: "screen", to: "world" },
|
|
@@ -9,18 +9,18 @@ export const InputsSystem = PhaseSystem("playing", {
|
|
|
9
9
|
|
|
10
10
|
// P1 Horizontal movement
|
|
11
11
|
p1.vx = 0;
|
|
12
|
-
if (players
|
|
12
|
+
if (players.get(0).keys.a.held) {
|
|
13
13
|
p1.x -= cfg.MOVE_SPEED;
|
|
14
14
|
p1.vx = -cfg.MOVE_SPEED;
|
|
15
15
|
p1.facingDir = -1;
|
|
16
16
|
}
|
|
17
|
-
if (players
|
|
17
|
+
if (players.get(0).keys.d.held) {
|
|
18
18
|
p1.x += cfg.MOVE_SPEED;
|
|
19
19
|
p1.vx = cfg.MOVE_SPEED;
|
|
20
20
|
p1.facingDir = 1;
|
|
21
21
|
}
|
|
22
22
|
// P1 Jump
|
|
23
|
-
const wantsJump = players
|
|
23
|
+
const wantsJump = players.get(0).keys.w.down || players.get(0).mouse.left.down;
|
|
24
24
|
if (wantsJump && p1.grounded) {
|
|
25
25
|
p1.vy = cfg.JUMP_VELOCITY;
|
|
26
26
|
p1.grounded = false;
|
|
@@ -28,36 +28,36 @@ export const InputsSystem = PhaseSystem("playing", {
|
|
|
28
28
|
|
|
29
29
|
// P2 Horizontal movement
|
|
30
30
|
p2.vx = 0;
|
|
31
|
-
if (players
|
|
31
|
+
if (players.get(1).keys.a.held) {
|
|
32
32
|
p2.x -= cfg.MOVE_SPEED;
|
|
33
33
|
p2.vx = -cfg.MOVE_SPEED;
|
|
34
34
|
p2.facingDir = -1;
|
|
35
35
|
}
|
|
36
|
-
if (players
|
|
36
|
+
if (players.get(1).keys.d.held) {
|
|
37
37
|
p2.x += cfg.MOVE_SPEED;
|
|
38
38
|
p2.vx = cfg.MOVE_SPEED;
|
|
39
39
|
p2.facingDir = 1;
|
|
40
40
|
}
|
|
41
41
|
// P2 Jump
|
|
42
|
-
if ((players
|
|
42
|
+
if ((players.get(1).keys.w.down || players.get(1).mouse.left.down) && p2.grounded) {
|
|
43
43
|
p2.vy = cfg.JUMP_VELOCITY;
|
|
44
44
|
p2.grounded = false;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
if (!net.isInSession) {
|
|
48
48
|
// locally, control second player with ijkl
|
|
49
|
-
if (players
|
|
49
|
+
if (players.get(0).keys.j.held) {
|
|
50
50
|
p2.x -= cfg.MOVE_SPEED;
|
|
51
51
|
p2.vx = -cfg.MOVE_SPEED;
|
|
52
52
|
p2.facingDir = -1;
|
|
53
53
|
}
|
|
54
|
-
if (players
|
|
54
|
+
if (players.get(0).keys.l.held) {
|
|
55
55
|
p2.x += cfg.MOVE_SPEED;
|
|
56
56
|
p2.vx = cfg.MOVE_SPEED;
|
|
57
57
|
p2.facingDir = 1;
|
|
58
58
|
}
|
|
59
59
|
// Jump
|
|
60
|
-
if (players
|
|
60
|
+
if (players.get(0).keys.i.down && p2.grounded) {
|
|
61
61
|
p2.vy = cfg.JUMP_VELOCITY;
|
|
62
62
|
p2.grounded = false;
|
|
63
63
|
}
|