Skip to content

Commit 6641bc2

Browse files
added sign sprite, some small level changes
1 parent 21785ed commit 6641bc2

File tree

3 files changed

+51
-35
lines changed

3 files changed

+51
-35
lines changed

stick-together/build.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

stick-together/main.ts

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,18 @@ setGravity(1600);
4747
const SPEED = 380;
4848
const JUMPFORCE = 700;
4949

50-
// Levels
50+
/*
51+
Level 1: tested, easy, works
52+
Level 2, tested, repeated spike jumps are annoying, but it works
53+
Level 3, tested, the spike fall is mean, but it works
54+
Level 4, tested, needs more gimmicks
55+
Level 5, tested, works, teaches some important mechanics. It needs another gimmick though
56+
Level 6, tested, but it might be confusing how to get up to the top. add a sign of some sort?
57+
Level 7, semitested, works, the jumps are tight, and the final part needs more gimmicks
58+
Level 8, untested, the maze is a bit confusing
59+
Level 9, untested, the stairs are also a bit confusing
60+
Level 10, untested, final level, needs to be epic
61+
*/
5162
const LEVELS = [
5263
// test level
5364
[
@@ -90,16 +101,16 @@ const LEVELS = [
90101
// the pit
91102
[
92103
"L ",
93-
"O@ $$$ ^^^ A",
94-
"===aaa=======",
95-
"= $$$ =",
96-
"= $$$ =",
97-
"= $$$ $ =",
98-
"= $ $ $ =",
99-
"= ^^^ $ =",
104+
"O@$$$ ^^^ A",
105+
"==aaa========",
106+
"= $$$ =",
107+
"= $$$ =",
108+
"= $$$ $ =",
109+
"= $ $ $ =",
110+
"= ^^^ $ =",
100111
"======= =",
101-
"= B =",
102-
"= =======",
112+
"= VVV B =",
113+
"= b======",
103114
"= b cc=",
104115
"= b c>=",
105116
"= U b ===",
@@ -143,30 +154,31 @@ const LEVELS = [
143154
// boing
144155
[
145156
" ",
146-
" a ",
147-
" @ O U =ddddddd===",
148-
"====== $ $ $ ^^^ $ ^^^ $ ",
149-
"= a $ $ $ === $ === $ U ",
150-
"= a $ $ ^^^ $ $ VVV $ ",
157+
" L a ",
158+
" @ O === U =ddddddd===",
159+
"====== $ $ $ ^ $ VVV $ ",
160+
"= a $ $ $ = $ $ U ",
161+
"= a $ $ ^^^ $ $ $ ",
151162
"= a $ $ === $ $ $ ",
152163
"= a U U U U U ",
153164
"= a ",
154165
"= a ",
155166
"= a U ",
156167
"= > a D ",
157-
"====== u ===",
168+
"====== U UUU ===",
158169
],
159170
// aMAZEng
160171
[
161172
" ^ =",
162-
" = =",
163-
" $$ = =",
164-
" $ ================== ^$$ C = ===================--====",
165-
"== $$$= ======= == $ =$$$$$ $$$=",
166-
" $ ====================== ==== = ====== ======--====",
167-
" = = = = ac =",
168-
"== = $$$ = ac>=",
169-
" ===============- = ================= ===============",
173+
" = $ =",
174+
" $$ = D =",
175+
" $ ================== ^$$ C = ==================---====",
176+
"== $$$= ======= == V $ =$$$$$$$$$$=",
177+
" $ ====================== === = ===== = =",
178+
" V V V V = = U = ====----====",
179+
" = = = ac =",
180+
"== ^ ^ ^ = $$$ = ac>=",
181+
" ===============- = ================= ======ddddd====",
170182
"L = - = =",
171183
"O @ ^^^$$$- $$ $$$^= $ $ $ $ A =",
172184
"================================================================",
@@ -384,7 +396,7 @@ scene("game", ({ levelId, coins }) => {
384396
],
385397
"B": () => [
386398
sprite("buttonB"),
387-
area(),
399+
area({scale:vec2(0.5,1)}),
388400
body({isStatic: true}),
389401
anchor("bot"),
390402
pos(),
@@ -397,7 +409,7 @@ scene("game", ({ levelId, coins }) => {
397409
],
398410
"C": () => [
399411
sprite("buttonC"),
400-
area(),
412+
area({scale:vec2(0.5,1)}),
401413
body({isStatic: true}),
402414
anchor("bot"),
403415
pos(),
@@ -412,7 +424,7 @@ scene("game", ({ levelId, coins }) => {
412424
],
413425
"D": () => [
414426
sprite("buttonD"),
415-
area(),
427+
area({scale:vec2(0.5,1)}),
416428
body({isStatic: true}),
417429
anchor("bot"),
418430
pos(),
@@ -482,10 +494,12 @@ scene("game", ({ levelId, coins }) => {
482494
//debug.log("level: " + levelId);
483495
// Movements
484496
const upKeyListener = onKeyPress("up", () => {
485-
if (player1.locked && !player1.dead && !player2.dead) {
497+
if (player1.locked && player1.portal && !player1.dead && !player2.dead) {
486498
player1.locked = false;
487499
player1.opacity = 1;
488500
player1.area.scale = 1;
501+
player1.jump(JUMPFORCE);
502+
player1.portal = false;
489503
return;
490504
}
491505
if (player1.isGrounded()) {
@@ -518,10 +532,12 @@ scene("game", ({ levelId, coins }) => {
518532
}
519533
});
520534
const wKeyListener = onKeyPress("w", () => {
521-
if (player2.locked && !player1.dead && !player2.dead) {
535+
if (player2.locked && player2.portal && !player1.dead && !player2.dead) {
522536
player2.locked = false;
523537
player2.opacity = 1;
524538
player2.area.scale = 1;
539+
player2.jump(JUMPFORCE);
540+
player2.portal = false;
525541
return;
526542
}
527543
if (player2.isGrounded()) {
3.56 KB
Loading

0 commit comments

Comments
 (0)