From 0a1f3eef46bafa088693eee75050a65b5d9e1996 Mon Sep 17 00:00:00 2001 From: Brickbloke <106596322+Brickbloke@users.noreply.github.com> Date: Sun, 11 Aug 2024 02:26:51 +0400 Subject: [PATCH 1/8] Add files via upload this is a game where a purple player character moves obstacles in order to get to the ending point in the map. (plus i think the music i made is pretty dope.) --- mini wario.js | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 mini wario.js diff --git a/mini wario.js b/mini wario.js new file mode 100644 index 0000000000..834120a043 --- /dev/null +++ b/mini wario.js @@ -0,0 +1,178 @@ +/* + +@title: mini wario +@author: Shaibal Haque +@tags: [] +@addedOn: 2024-00-00 +*/ + +/* setting constants will assign sprites to these later */ +const player = "p" +const duck = "d" +const bg_street = "s" +const bg_op = "o" +const building = "b" +const bg_sky = "x" +/* end of assigning variables */ + +/* setting sprites for all the variable */ +setLegend( + [ player, bitmap` +................ +......HHHHH..... +......H2H2H..... +......HHHHH..... +......HHHHH..... +....888HHH888... +....H88HHH888... +....HH8HHH8H8... +....HH88H88H8... +....HH88888HH... +....2.88888..... +......88.8H..... +......88.8H..... +......H8.8H..... +......HH.HH..... +................` ], + [ duck, bitmap` +1111111111111111 +1000000000000001 +1020200LL0020201 +1000000000000001 +1000LLLLLLLL0001 +1020L111111L0201 +1000L111111L0001 +10L0L111111L0L01 +10L0L111111L0L01 +1000L111111L0001 +1020L111111L0201 +1000LLLLLLLL0001 +1000000000000001 +1020200LL0020201 +1000000000000001 +1111111111111111` ], + [ bg_street, bitmap` +7777777777777777 +7777777777722277 +7777777772222227 +7222277772222222 +2222222277112227 +1222222277777777 +7112221777777777 +7777777777777777 +7777777777777777 +7777777777777777 +CCCCCCCCCCCCCCCC +CCCCCCCCCCCCCCCC +1111111111111111 +LLLLLLLLLLLLLLLL +L66LLL66LL66LL66 +LLLLLLLLLLLLLLLL` ], + [ bg_op, bitmap` +................ +................ +................ +................ +.............2.. +.....00000...2.. +....00LLL00..... +....0221220..... +....0321320..... +.00LLL111LLL00.. +.0LLLLL1LLLLL0.. +.0L000LLL000L0.. +.0L0.00000.0L0.. +.000.00.00.000.. +.....11.11...... +....000.000.....` ], + [ building, bitmap` +22227772222277DD +22277777227777DD +2227L0LLLL0L77DD +77771L1717L1777C +77771L1515L17D7C +77771L1717L1DDDC +77771L1515L1DDDC +7L771L1717L1DDDC +11171L1515L17C7C +70771L1717L17C7C +CCCCCCCCCCCCDDDD +CCCCCCCCCCCCCCDD +4444444444444444 +0000000000000000 +0606060606060606 +0000000000000000` ], +[ bg_sky, bitmap` +7777777777777777 +7777777777722277 +7777777772222227 +7222277772222222 +2222222277112227 +1222222277777777 +7112221777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777772222277777 +7777222222222777 +7777122222222777 +7777711122217777 +7777777777777777` ],) +/* end sprite assignment */ + +/* setting the solid objects */ +setSolids([player, bg_op, duck]) +/*end solid objects*/ + +/* setting maps */ +let level = 0 +const levels = [ + map` +pxxxxxxx +xoxoxoxo +sdsdsdsd +dsdsdsds +sdsdsdsd +dsdsdsds +sssssssb` +] +setBackground(bg_sky) +setMap(levels[level]) +/* end setting maps */ + +/* objects that can be pushed */ +setPushables({ + [ player ]: [bg_op, duck] +}) +/* end pushables */ + +/* adjust key setting */ +onInput("s", () => { + getFirst(player).y += 1 +}) +onInput("w", () => { + getFirst(player).y -= 1 +}) +onInput("a", () => { + getFirst(player).x -= 1 +}) +onInput("d", () => { + getFirst(player).x += 1 +}) +onInput("j", () => { + setMap(levels[level]) +}) +/* end adjusting key settings */ + +/* reset button text */ +addText("Press J to reset", { x: 2, y: 7, color: '9' }) +/* reset button text end */ + +/*rest is for winning the game */ +afterInput(() => { + clearText() + if (tilesWith(player, building).length >= 1) { + addText("Game won", { x: 2, y: 7, color: '9' }) + } +}) From 2bd57ce824f6a384a9cdebb9249f50eb5dc2e499 Mon Sep 17 00:00:00 2001 From: Brickbloke <106596322+Brickbloke@users.noreply.github.com> Date: Sun, 11 Aug 2024 02:29:11 +0400 Subject: [PATCH 2/8] Add files via upload this is a game where a purple man pushes obstacles to get to the exit. From 192d312f2b9fb4bc8d81f70337bd97b72ae2beea Mon Sep 17 00:00:00 2001 From: Brickbloke <106596322+Brickbloke@users.noreply.github.com> Date: Tue, 13 Aug 2024 00:56:28 +0400 Subject: [PATCH 3/8] Add files via upload --- purple_guy.js | 281 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 281 insertions(+) create mode 100644 purple_guy.js diff --git a/purple_guy.js b/purple_guy.js new file mode 100644 index 0000000000..f92d35dd10 --- /dev/null +++ b/purple_guy.js @@ -0,0 +1,281 @@ +/* Setting constants for sprites */ +const player = "p" +const duck = "d" +const bg_street = "s" +const bg_op = "o" +const building = "b" +const bg_sky = "x" + +/* Tune for background music */ +const melody = tune` +500: F4/500 + B4/500, +500: D4~500, +500: D4~500 + F4^500, +500: D4~500, +500: E4^500, +500: E4^500, +500: D4~500, +500: D4~500 + F4^500, +500: D4~500, +500: E4^500, +500: E4^500, +500: D4~500, +500: D4~500 + F4^500, +500: D4~500, +500: D4/500, +500: D4/500, +500: D4~500 + F4~500, +500: D4~500 + F4~500 + G4^500 + E4^500, +500: D4~500 + F4~500, +500: E4^500 + G4^500, +500: E4^500 + G4^500, +500: F4~500 + D4~500, +500: F4~500 + D4~500 + G4^500 + E4^500, +500: F4~500 + D4~500, +500: G4^500 + E4^500, +500: G4^500 + E4^500, +500: D4~500 + F4~500, +500: D4~500 + F4~500 + G4^500 + E4^500, +500: D4~500 + F4~500, +500, +500: F4~500 + D4~500 + A4~500 + C5~500 + E5~500, +500` + +playTune(melody, Infinity) + +/* Assigning sprites */ +setLegend( + [player, bitmap` +................ +......HHHHH..... +......H2H2H..... +......HHHHH..... +......HHHHH..... +....888HHH888... +....H88HHH888... +....HH8HHH8H8... +....HH88H88H8... +....HH88888HH... +....2.88888..... +......88.8H..... +......88.8H..... +......H8.8H..... +......HH.HH..... +................`], + [duck, bitmap` +1111111111111111 +1000000000000001 +1020200LL0020201 +1000000000000001 +1000LLLLLLLL0001 +1020L111111L0201 +1000L111111L0001 +10L0L111111L0L01 +10L0L111111L0L01 +1000L111111L0001 +1020L111111L0201 +1000LLLLLLLL0001 +1000000000000001 +1020200LL0020201 +1000000000000001 +1111111111111111`], + [bg_street, bitmap` +7777777777777777 +7777777777722277 +7777777772222227 +7222277772222222 +2222222277112227 +1222222277777777 +7112221777777777 +7777777777777777 +7777777777777777 +7777777777777777 +CCCCCCCCCCCCCCCC +CCCCCCCCCCCCCCCC +1111111111111111 +LLLLLLLLLLLLLLLL +L66LLL66LL66LL66 +LLLLLLLLLLLLLLLL`], + [bg_op, bitmap` +................ +................ +................ +................ +.............2.. +.....00000...2.. +....00LLL00..... +....0221220..... +....0321320..... +.00LLL111LLL00.. +.0LLLLL1LLLLL0.. +.0L000LLL000L0.. +.0L0.00000.0L0.. +.000.00.00.000.. +.....11.11...... +....000.000.....`], + [building, bitmap` +22227772222277DD +22277777227777DD +2227L0LLLL0L77DD +77771L1717L1777C +77771L1515L17D7C +77771L1717L1DDDC +77771L1515L1DDDC +7L771L1717L1DDDC +11171L1515L17C7C +70771L1717L17C7C +CCCCCCCCCCCCDDDD +CCCCCCCCCCCCCCDD +4444444444444444 +0000000000000000 +0606060606060606 +0000000000000000`], + [bg_sky, bitmap` +7777777777777777 +7777777777722277 +7777777772222227 +7222277772222222 +2222222277112227 +1222222277777777 +7112221777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777772222277777 +7777222222222777 +7777122222222777 +7777711122217777 +7777777777777777`] +) + +/* Set solid objects */ +setSolids([player, bg_op, duck]) + +/* Setting maps */ +let level = 0; + +const levels = [ + map` +pxxxxxxx +xoxoxoxo +sdsdsdsd +dsdsdsds +sdsdsdsd +dsdsdsds +sssssssb`, + + map` +bsssssxss +ddddddxdd +ddxdssssd +dsxsddddd +ddxddddxd +dsdssssxd +dddddddxd +xsssssdxd +xdddddddd +sossssssp`, + + map` +ddddddddd +dpdsxsdod +ddddxdddd +dsssxsssd +ddddxdddd +dxxdxdxxd +dosdddsod +ddddxdddd +doodssxbd +ddddddsdd`, + + map` +ddddddddd +dddddddxd +dxsssssxd +dsdddddxd +ddsssbdxd +dxdddddxd +doooooddd +dddddddsp`, + + map` +dpddodxdd +dxddxdxbd +dxddxdxdd +dxddxdxsd +dxddxdddd +dxddxdxod +dxddddddd +dxdxxdxxd +dxdssdood +ddddddddd`, + + map` +posososox +ddddddddx +xsoxsxoss +xddsdxddd +sxsdxsoss +dxddxdddd +sssssssss +ddddddddd +sxsxxxxxx +dsdsssssb`, + + map` +sssssssss +ddddddddd +ddxxxxxdd +dxxxxoxxd +doxdbdxod +ddxdddxdd +ddddxdddd +dsssxsssd +ddddddddd +sssspssss`, +]; + +/* Set the background and load the first level */ +setBackground(bg_sky) +setMap(levels[level]) + +/* Set pushable objects */ +setPushables({ + [player]: [bg_op, duck] +}) + +/* Control player movement */ +onInput("s", () => { + getFirst(player).y += 1 +}) +onInput("w", () => { + getFirst(player).y -= 1 +}) +onInput("a", () => { + getFirst(player).x -= 1 +}) +onInput("d", () => { + getFirst(player).x += 1 +}) + +/* Reset level */ +onInput("j", () => { + setMap(levels[level]) +}) + +/* Text for reset button */ +addText("Press J to reset", { x: 1, y: 1, color: color`8` }) + +/* Check for win condition */ +afterInput(() => { + if (tilesWith(player, building).length > 0) { + if (level < levels.length - 1) { + level++; + setMap(levels[level]); + addText("Level Complete!", { x: 2, y: 7, color: color`9` }); + } else { + addText("GAME WON!!!!!!!!!!!!!!", { x: 2, y: 7, color: color`4` }); + } + } +}) From a64b23277061ed5a6f395ff0fa1d859ec6187e96 Mon Sep 17 00:00:00 2001 From: Brickbloke <106596322+Brickbloke@users.noreply.github.com> Date: Tue, 13 Aug 2024 00:57:06 +0400 Subject: [PATCH 4/8] Add files via upload From 4aef8cfe420177d94d406be768085e3ecdafd9a1 Mon Sep 17 00:00:00 2001 From: Cheru Berhanu Date: Thu, 15 Aug 2024 14:53:52 -0400 Subject: [PATCH 5/8] Update mini wario.js --- mini wario.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mini wario.js b/mini wario.js index 834120a043..c9d41b79d7 100644 --- a/mini wario.js +++ b/mini wario.js @@ -3,7 +3,7 @@ @title: mini wario @author: Shaibal Haque @tags: [] -@addedOn: 2024-00-00 +@addedOn: 2024-08-15 */ /* setting constants will assign sprites to these later */ @@ -176,3 +176,4 @@ afterInput(() => { addText("Game won", { x: 2, y: 7, color: '9' }) } }) + From 2443a992ceeca00637a3f4e31ddc72f3521adbc3 Mon Sep 17 00:00:00 2001 From: Brickbloke <106596322+Brickbloke@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:33:05 +0400 Subject: [PATCH 6/8] Add files via upload --- games/purp_vs_opp.js | 296 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 games/purp_vs_opp.js diff --git a/games/purp_vs_opp.js b/games/purp_vs_opp.js new file mode 100644 index 0000000000..34a08c7b21 --- /dev/null +++ b/games/purp_vs_opp.js @@ -0,0 +1,296 @@ +/* Setting constants for sprites */ +const player = "p" +const duck = "d" +const bg_street = "s" +const bg_op = "o" +const building = "b" +const bg_sky = "x" + +/* Tune for background music */ +const melody = tune` +500: F4/500 + B4/500, +500: D4~500, +500: D4~500 + F4^500, +500: D4~500, +500: E4^500, +500: E4^500, +500: D4~500, +500: D4~500 + F4^500, +500: D4~500, +500: E4^500, +500: E4^500, +500: D4~500, +500: D4~500 + F4^500, +500: D4~500, +500: D4/500, +500: D4/500, +500: D4~500 + F4~500, +500: D4~500 + F4~500 + G4^500 + E4^500, +500: D4~500 + F4~500, +500: E4^500 + G4^500, +500: E4^500 + G4^500, +500: F4~500 + D4~500, +500: F4~500 + D4~500 + G4^500 + E4^500, +500: F4~500 + D4~500, +500: G4^500 + E4^500, +500: G4^500 + E4^500, +500: D4~500 + F4~500, +500: D4~500 + F4~500 + G4^500 + E4^500, +500: D4~500 + F4~500, +500, +500: F4~500 + D4~500 + A4~500 + C5~500 + E5~500, +500` + +playTune(melody, Infinity) + +/* Assigning sprites */ +setLegend( + [player, bitmap` +................ +......HHHHH..... +......H2H2H..... +......HHHHH..... +......HHHHH..... +....888HHH888... +....H88HHH888... +....HH8HHH8H8... +....HH88H88H8... +....HH88888HH... +....2.88888..... +......88.8H..... +......88.8H..... +......H8.8H..... +......HH.HH..... +................`], + [duck, bitmap` +1111111111111111 +1000000000000001 +1020200LL0020201 +1000000000000001 +1000LLLLLLLL0001 +1020L111111L0201 +1000L111111L0001 +10L0L111111L0L01 +10L0L111111L0L01 +1000L111111L0001 +1020L111111L0201 +1000LLLLLLLL0001 +1000000000000001 +1020200LL0020201 +1000000000000001 +1111111111111111`], + [bg_street, bitmap` +7777777777777777 +7777777777722277 +7777777772222227 +7222277772222222 +2222222277112227 +1222222277777777 +7112221777777777 +7777777777777777 +7777777777777777 +7777777777777777 +CCCCCCCCCCCCCCCC +CCCCCCCCCCCCCCCC +1111111111111111 +LLLLLLLLLLLLLLLL +L66LLL66LL66LL66 +LLLLLLLLLLLLLLLL`], + [bg_op, bitmap` +................ +................ +................ +................ +.............2.. +.....00000...2.. +....00LLL00..... +....0221220..... +....0321320..... +.00LLL111LLL00.. +.0LLLLL1LLLLL0.. +.0L000LLL000L0.. +.0L0.00000.0L0.. +.000.00.00.000.. +.....11.11...... +....000.000.....`], + [building, bitmap` +22227772222277DD +22277777227777DD +2227L0LLLL0L77DD +77771L1717L1777C +77771L1515L17D7C +77771L1717L1DDDC +77771L1515L1DDDC +7L771L1717L1DDDC +11171L1515L17C7C +70771L1717L17C7C +CCCCCCCCCCCCDDDD +CCCCCCCCCCCCCCDD +4444444444444444 +0000000000000000 +0606060606060606 +0000000000000000`], + [bg_sky, bitmap` +7777777777777777 +7777777777722277 +7777777772222227 +7222277772222222 +2222222277112227 +1222222277777777 +7112221777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777772222277777 +7777222222222777 +7777122222222777 +7777711122217777 +7777777777777777`] +) + +/* Set solid objects */ +setSolids([player, bg_op, duck]) + +/* Setting maps */ +let level = 0; + +const levels = [ + map` +pxxxxxxx +xoxoxoxo +sdsdsdsd +dsdsdsds +sdsdsdsd +dsdsdsds +sssssssb`, + + map` +bsssssxss +ddddddxdd +ddxdssssd +dsxsddddd +ddxddddxd +dsdssssxd +dddddddxd +xsssssdxd +xdddddddd +sossssssp`, + + map` +ddddddddd +dpdsxsdod +ddddxdddd +dsssxsssd +ddddxdddd +dxxdxdxxd +dosdddsod +ddddxdddd +doodssxbd +ddddddsdd`, + + map` +ddddddddd +dddddddxd +dxsssssxd +dsdddddxd +ddsssbdxd +dxdddddxd +doooooddd +dddddddsp`, + + map` +dpddodxdd +dxddxdxbd +dxddxdxdd +dxddxdxsd +dxddxdddd +dxddxdxod +dxddddddd +dxdxxdxxd +dxdssdood +ddddddddd`, + + map` +posososox +ddddddddx +xsoxsxoss +xddsdxddd +sxsdxsoss +dxddxdddd +sssssssss +ddddddddd +sxsxxxxxx +dsdsssssb`, + + map` +sssssssss +ddddddddd +ddxxxxxdd +dxxxxoxxd +doxdbdxod +ddxdddxdd +ddddxdddd +dsssxsssd +ddddddddd +sssspssss`, +]; + +/* Set the background and load the first level */ +setBackground(bg_sky) +setMap(levels[level]) + +/* Set pushable objects */ +setPushables({ + [player]: [bg_op, duck] +}) + +/* Control player movement */ +onInput("s", () => { + getFirst(player).y += 1 +}) +onInput("w", () => { + getFirst(player).y -= 1 +}) +onInput("a", () => { + getFirst(player).x -= 1 +}) +onInput("d", () => { + getFirst(player).x += 1 +}) + +/* Reset level */ +onInput("j", () => { + setMap(levels[level]) +}) + +/* Text for reset button */ +addText("Press J to reset", { x: 1, y: 1, color: color`8` }) + +/* Check for win condition */ +afterInput(() => { + if (tilesWith(player, building).length > 0) { + if (level < levels.length - 1) { + level++; + setMap(levels[level]); + addText("Level Complete!", { x: 2, y: 7, color: color`9` }); + } else { + addText("GAME WON!!!!!!!!!!!!!!", { x: 2, y: 7, color: color`4` }); + } + } +}) +let timeLeft = 300; + +function startTimer() { + const timerId = setInterval(() => { + timeLeft--; + addText(`Time: ${timeLeft}`, { x: 1, y: 3, color: color`2` }); + if (timeLeft <= 0) { + clearInterval(timerId); + addText("Time's Up! Game Over!", { x: 2, y: 7, color: color`2` }); + // Reset the game or level + } + }, 1000); // Countdown every second +} + +startTimer(); From 089c4a575a8ad7be16c0812a822c46b09f840e7b Mon Sep 17 00:00:00 2001 From: Brickbloke <106596322+Brickbloke@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:52:42 +0400 Subject: [PATCH 7/8] Delete mini wario.js --- mini wario.js | 179 -------------------------------------------------- 1 file changed, 179 deletions(-) delete mode 100644 mini wario.js diff --git a/mini wario.js b/mini wario.js deleted file mode 100644 index c9d41b79d7..0000000000 --- a/mini wario.js +++ /dev/null @@ -1,179 +0,0 @@ -/* - -@title: mini wario -@author: Shaibal Haque -@tags: [] -@addedOn: 2024-08-15 -*/ - -/* setting constants will assign sprites to these later */ -const player = "p" -const duck = "d" -const bg_street = "s" -const bg_op = "o" -const building = "b" -const bg_sky = "x" -/* end of assigning variables */ - -/* setting sprites for all the variable */ -setLegend( - [ player, bitmap` -................ -......HHHHH..... -......H2H2H..... -......HHHHH..... -......HHHHH..... -....888HHH888... -....H88HHH888... -....HH8HHH8H8... -....HH88H88H8... -....HH88888HH... -....2.88888..... -......88.8H..... -......88.8H..... -......H8.8H..... -......HH.HH..... -................` ], - [ duck, bitmap` -1111111111111111 -1000000000000001 -1020200LL0020201 -1000000000000001 -1000LLLLLLLL0001 -1020L111111L0201 -1000L111111L0001 -10L0L111111L0L01 -10L0L111111L0L01 -1000L111111L0001 -1020L111111L0201 -1000LLLLLLLL0001 -1000000000000001 -1020200LL0020201 -1000000000000001 -1111111111111111` ], - [ bg_street, bitmap` -7777777777777777 -7777777777722277 -7777777772222227 -7222277772222222 -2222222277112227 -1222222277777777 -7112221777777777 -7777777777777777 -7777777777777777 -7777777777777777 -CCCCCCCCCCCCCCCC -CCCCCCCCCCCCCCCC -1111111111111111 -LLLLLLLLLLLLLLLL -L66LLL66LL66LL66 -LLLLLLLLLLLLLLLL` ], - [ bg_op, bitmap` -................ -................ -................ -................ -.............2.. -.....00000...2.. -....00LLL00..... -....0221220..... -....0321320..... -.00LLL111LLL00.. -.0LLLLL1LLLLL0.. -.0L000LLL000L0.. -.0L0.00000.0L0.. -.000.00.00.000.. -.....11.11...... -....000.000.....` ], - [ building, bitmap` -22227772222277DD -22277777227777DD -2227L0LLLL0L77DD -77771L1717L1777C -77771L1515L17D7C -77771L1717L1DDDC -77771L1515L1DDDC -7L771L1717L1DDDC -11171L1515L17C7C -70771L1717L17C7C -CCCCCCCCCCCCDDDD -CCCCCCCCCCCCCCDD -4444444444444444 -0000000000000000 -0606060606060606 -0000000000000000` ], -[ bg_sky, bitmap` -7777777777777777 -7777777777722277 -7777777772222227 -7222277772222222 -2222222277112227 -1222222277777777 -7112221777777777 -7777777777777777 -7777777777777777 -7777777777777777 -7777777777777777 -7777772222277777 -7777222222222777 -7777122222222777 -7777711122217777 -7777777777777777` ],) -/* end sprite assignment */ - -/* setting the solid objects */ -setSolids([player, bg_op, duck]) -/*end solid objects*/ - -/* setting maps */ -let level = 0 -const levels = [ - map` -pxxxxxxx -xoxoxoxo -sdsdsdsd -dsdsdsds -sdsdsdsd -dsdsdsds -sssssssb` -] -setBackground(bg_sky) -setMap(levels[level]) -/* end setting maps */ - -/* objects that can be pushed */ -setPushables({ - [ player ]: [bg_op, duck] -}) -/* end pushables */ - -/* adjust key setting */ -onInput("s", () => { - getFirst(player).y += 1 -}) -onInput("w", () => { - getFirst(player).y -= 1 -}) -onInput("a", () => { - getFirst(player).x -= 1 -}) -onInput("d", () => { - getFirst(player).x += 1 -}) -onInput("j", () => { - setMap(levels[level]) -}) -/* end adjusting key settings */ - -/* reset button text */ -addText("Press J to reset", { x: 2, y: 7, color: '9' }) -/* reset button text end */ - -/*rest is for winning the game */ -afterInput(() => { - clearText() - if (tilesWith(player, building).length >= 1) { - addText("Game won", { x: 2, y: 7, color: '9' }) - } -}) - From 4f16a15056193bf589492d1a98cd6568de253013 Mon Sep 17 00:00:00 2001 From: Brickbloke <106596322+Brickbloke@users.noreply.github.com> Date: Thu, 14 Nov 2024 16:59:46 +0400 Subject: [PATCH 8/8] Delete games/purp_vs_opp.js --- games/purp_vs_opp.js | 296 ------------------------------------------- 1 file changed, 296 deletions(-) delete mode 100644 games/purp_vs_opp.js diff --git a/games/purp_vs_opp.js b/games/purp_vs_opp.js deleted file mode 100644 index 34a08c7b21..0000000000 --- a/games/purp_vs_opp.js +++ /dev/null @@ -1,296 +0,0 @@ -/* Setting constants for sprites */ -const player = "p" -const duck = "d" -const bg_street = "s" -const bg_op = "o" -const building = "b" -const bg_sky = "x" - -/* Tune for background music */ -const melody = tune` -500: F4/500 + B4/500, -500: D4~500, -500: D4~500 + F4^500, -500: D4~500, -500: E4^500, -500: E4^500, -500: D4~500, -500: D4~500 + F4^500, -500: D4~500, -500: E4^500, -500: E4^500, -500: D4~500, -500: D4~500 + F4^500, -500: D4~500, -500: D4/500, -500: D4/500, -500: D4~500 + F4~500, -500: D4~500 + F4~500 + G4^500 + E4^500, -500: D4~500 + F4~500, -500: E4^500 + G4^500, -500: E4^500 + G4^500, -500: F4~500 + D4~500, -500: F4~500 + D4~500 + G4^500 + E4^500, -500: F4~500 + D4~500, -500: G4^500 + E4^500, -500: G4^500 + E4^500, -500: D4~500 + F4~500, -500: D4~500 + F4~500 + G4^500 + E4^500, -500: D4~500 + F4~500, -500, -500: F4~500 + D4~500 + A4~500 + C5~500 + E5~500, -500` - -playTune(melody, Infinity) - -/* Assigning sprites */ -setLegend( - [player, bitmap` -................ -......HHHHH..... -......H2H2H..... -......HHHHH..... -......HHHHH..... -....888HHH888... -....H88HHH888... -....HH8HHH8H8... -....HH88H88H8... -....HH88888HH... -....2.88888..... -......88.8H..... -......88.8H..... -......H8.8H..... -......HH.HH..... -................`], - [duck, bitmap` -1111111111111111 -1000000000000001 -1020200LL0020201 -1000000000000001 -1000LLLLLLLL0001 -1020L111111L0201 -1000L111111L0001 -10L0L111111L0L01 -10L0L111111L0L01 -1000L111111L0001 -1020L111111L0201 -1000LLLLLLLL0001 -1000000000000001 -1020200LL0020201 -1000000000000001 -1111111111111111`], - [bg_street, bitmap` -7777777777777777 -7777777777722277 -7777777772222227 -7222277772222222 -2222222277112227 -1222222277777777 -7112221777777777 -7777777777777777 -7777777777777777 -7777777777777777 -CCCCCCCCCCCCCCCC -CCCCCCCCCCCCCCCC -1111111111111111 -LLLLLLLLLLLLLLLL -L66LLL66LL66LL66 -LLLLLLLLLLLLLLLL`], - [bg_op, bitmap` -................ -................ -................ -................ -.............2.. -.....00000...2.. -....00LLL00..... -....0221220..... -....0321320..... -.00LLL111LLL00.. -.0LLLLL1LLLLL0.. -.0L000LLL000L0.. -.0L0.00000.0L0.. -.000.00.00.000.. -.....11.11...... -....000.000.....`], - [building, bitmap` -22227772222277DD -22277777227777DD -2227L0LLLL0L77DD -77771L1717L1777C -77771L1515L17D7C -77771L1717L1DDDC -77771L1515L1DDDC -7L771L1717L1DDDC -11171L1515L17C7C -70771L1717L17C7C -CCCCCCCCCCCCDDDD -CCCCCCCCCCCCCCDD -4444444444444444 -0000000000000000 -0606060606060606 -0000000000000000`], - [bg_sky, bitmap` -7777777777777777 -7777777777722277 -7777777772222227 -7222277772222222 -2222222277112227 -1222222277777777 -7112221777777777 -7777777777777777 -7777777777777777 -7777777777777777 -7777777777777777 -7777772222277777 -7777222222222777 -7777122222222777 -7777711122217777 -7777777777777777`] -) - -/* Set solid objects */ -setSolids([player, bg_op, duck]) - -/* Setting maps */ -let level = 0; - -const levels = [ - map` -pxxxxxxx -xoxoxoxo -sdsdsdsd -dsdsdsds -sdsdsdsd -dsdsdsds -sssssssb`, - - map` -bsssssxss -ddddddxdd -ddxdssssd -dsxsddddd -ddxddddxd -dsdssssxd -dddddddxd -xsssssdxd -xdddddddd -sossssssp`, - - map` -ddddddddd -dpdsxsdod -ddddxdddd -dsssxsssd -ddddxdddd -dxxdxdxxd -dosdddsod -ddddxdddd -doodssxbd -ddddddsdd`, - - map` -ddddddddd -dddddddxd -dxsssssxd -dsdddddxd -ddsssbdxd -dxdddddxd -doooooddd -dddddddsp`, - - map` -dpddodxdd -dxddxdxbd -dxddxdxdd -dxddxdxsd -dxddxdddd -dxddxdxod -dxddddddd -dxdxxdxxd -dxdssdood -ddddddddd`, - - map` -posososox -ddddddddx -xsoxsxoss -xddsdxddd -sxsdxsoss -dxddxdddd -sssssssss -ddddddddd -sxsxxxxxx -dsdsssssb`, - - map` -sssssssss -ddddddddd -ddxxxxxdd -dxxxxoxxd -doxdbdxod -ddxdddxdd -ddddxdddd -dsssxsssd -ddddddddd -sssspssss`, -]; - -/* Set the background and load the first level */ -setBackground(bg_sky) -setMap(levels[level]) - -/* Set pushable objects */ -setPushables({ - [player]: [bg_op, duck] -}) - -/* Control player movement */ -onInput("s", () => { - getFirst(player).y += 1 -}) -onInput("w", () => { - getFirst(player).y -= 1 -}) -onInput("a", () => { - getFirst(player).x -= 1 -}) -onInput("d", () => { - getFirst(player).x += 1 -}) - -/* Reset level */ -onInput("j", () => { - setMap(levels[level]) -}) - -/* Text for reset button */ -addText("Press J to reset", { x: 1, y: 1, color: color`8` }) - -/* Check for win condition */ -afterInput(() => { - if (tilesWith(player, building).length > 0) { - if (level < levels.length - 1) { - level++; - setMap(levels[level]); - addText("Level Complete!", { x: 2, y: 7, color: color`9` }); - } else { - addText("GAME WON!!!!!!!!!!!!!!", { x: 2, y: 7, color: color`4` }); - } - } -}) -let timeLeft = 300; - -function startTimer() { - const timerId = setInterval(() => { - timeLeft--; - addText(`Time: ${timeLeft}`, { x: 1, y: 3, color: color`2` }); - if (timeLeft <= 0) { - clearInterval(timerId); - addText("Time's Up! Game Over!", { x: 2, y: 7, color: color`2` }); - // Reset the game or level - } - }, 1000); // Countdown every second -} - -startTimer();