From dfb7d7a1e7aedf17cb08bda602f7b888c7f8b3db Mon Sep 17 00:00:00 2001 From: waitwhat653 Date: Sat, 15 Jun 2024 08:29:01 -0400 Subject: [PATCH 1/9] Add files via upload --- games/Mr.Man!.js | 371 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 371 insertions(+) create mode 100644 games/Mr.Man!.js diff --git a/games/Mr.Man!.js b/games/Mr.Man!.js new file mode 100644 index 0000000000..8ccf4dc32e --- /dev/null +++ b/games/Mr.Man!.js @@ -0,0 +1,371 @@ +//controls are I, J, K, L, and W for reset + +// define the sprites in our game + +const box = "b" +const goal = "g" +const wall = "w" +const MrMan = "p" +const player2 = "2" +const player3 = "3" +const player4 = "4" +const player5 = "5" +const player6 = "6" +const decorate = "d" +const trophie = "t" +const block = "l" +// assign bitmap art to each sprite +setLegend( + + [ box, bitmap` +8888888888888888 +8HHHHHHHHHHHHHHH +8H9999999999999H +8H9LLLLLLLLLLL9H +8H9L3333L5555L9H +8H9L3333L5555L9H +8H9L3333L5555L9H +8H9L3333L5555L9H +8H9LLLLLLLLLLL9H +8H9L4444L6666L9H +8H9L4444L6666L9H +8H9L4444L6666L9H +8H9L4444L6666L9H +8H9LLLLLLLLLLL9H +8H9999999999999H +8HHHHHHHHHHHHHHH`], + [ goal, bitmap` +.00000000000000. +.07777777777770. +.07777000077770. +.07777770077770. +.07777700077770. +.07777707777770. +.07777777777770. +.07777707777770. +.07777777777770. +.00000000000000. +.0L0L0L0L0L0LL0. +.00000000000000. +.0L0000000L0LL0. +.0L0LLLLL0L0LL0. +..000000000000.. +................`], + [ wall, bitmap` +..055555777770.. +..055557777770.. +..055555777770.. +..055557777770.. +..055555777770.. +..0595536747H0.. +..0903306000H0.. +..0900306040H0.. +..0909006040H0.. +..0909906000H0.. +..099999HHHHH0.. +..09999H9HHHH0.. +..099999HHHHH0.. +..0999HH8HHHH0.. +..09988888H8H0.. +..0988888888H0..`], + [ MrMan, bitmap` +................ +.....00000...... +....0CCCCC0..... +....0C0C0C0..... +....0CCCCC0..... +....0CCCCC0..... +....0C0C0C0..... +....0C000C0..... +....0CCCCC0..... +.C...00000...C.. +..0.0476190.0... +...00H383H00.... +....0916740..... +....0000000..... +.....0...0...... +.....00..00.....`], + [ player2, bitmap` +...000000000.... +..06666666660... +..06606660660... +..06666666660... +..06666666660... +..06606660660... +..03360006330... +6.03366666330.6. +0..000000000..0. +0...090D070...0. +0000990D0770000. +...0090D0700.... +..0440H030880... +.04440HH008880.. +..00000000000... +...0.......0....`], + [ player3, bitmap ` +................ +................ +...000000000.... +...0.......0.... +...0.0...0.0.... +...0.......0.... +...0..000..0.... +...0.......0.... +...000000000.... +.......0........ +..0000.0.0000... +.....00000...... +.......0........ +......000....... +.....00.00...... +....00...00.....`], + [ player4, bitmap ` +................ +......00000..... +...0000CCC00.... +...0330C0CC0.... +...0C3CCCCC0.... +...00C000330.... +....00CCCC00.... +.C...000000..C.. +.00..00660..00.. +..00.00660.00... +....00066000.... +......0000...... +......0.00...... +......0..CCCC... +......CCC....... +................`], + [ player5, bitmap ` +....00000000.... +...00......00... +...0.20.20..0... +...0.00.00..0... +...0...0....0... +...00......00... +....00000000.... +.......0........ +....00.0.00..... +......000....... +.......0........ +.......0........ +......000....... +.....0...0...... +...00.....00.... +..0.........0...`], + [ player6, bitmap ` +.....CCCCCC..... +....CCCCCCCC.... +...CCCCCCCCCC... +...CCC02C02CC... +...CCC00C00CC... +...CCCCCCCCCC... +...CCCC000CCC... +....CCCCCCCC.... +.C...CCCCCC...C. +CC44..4444..44CC +.C.4..4444..4.C. +...4444444444... +......5555...... +......5..5...... +......5..5...... +....CCC..CCC....`], + [ decorate, bitmap ` +..7.1.1.0...D... +....1..1.22.F... +.FHHF99FFFFFD... +.6F998..L.3LL0.. +...9H4.44.LLC8.. +0.D.46D69LL87F7. +055.366HHL684... +15F99H..HLL8LD4D +.1.D988.FHLDC.9. +.F188.4.7H3DD9.. +.F588L.8.HHH1... +.6.8...9.HH.H.44 +99994.59D.H8.4.. +..FL77CLHH84400. +..D.H..66.44...6 +..DCH..5.4......`], + [ trophie, bitmap ` +................ +......6666...... +...666FFFF666... +..66.66FF66.66.. +.66..666666..66. +.66..666666..66. +.66..6666F6..66. +.66..6666F6..66. +..66.6666F6.66.. +...666666F666... +....6666FF66.... +......6666...... +.......66....... +.......66....... +......6666...... +.....666666.....`], + [ block, bitmap ` +0000000000000000 +0222222222222220 +0222222222222220 +0222222222222220 +0222222222222220 +077444262332HHH0 +0722426663232H20 +0772426263232H20 +0272426663322H20 +0772426263232H20 +0222222222222220 +0222222222222220 +0222222222222220 +0222222222222220 +0222222222222220 +0000000000000000`] +); + +// create game levels +let level = 0; // this tracks the level we are on +const levels = [ + map` +............................... +..llll.lllll..l...llll..lllll.. +..l......l....l...l...l...l.... +..l......l...lll..l...l...l.... +..ll.....l...l.l..llll....l.... +....ll...l...lll..ll......l.... +.....l...l..ll.ll.l.l.....l.... +.....l...l..l...l.l..l....l.... +..llll...l..l...l.l...l...l.... +............................... +............................... +............................... +............pb.....g........... +............................... +............................... +............................... +...............................`, + map` +pw.g +.b.. +....`, + map` +w.pwg +.b... +..... +.g..b +w....`, + map` +pw.. +.b.. +...g +....`, + map` +pb.g +w.b. +g.b. +..g.`, + map` +....g +.g..b +..p.. +.b.b. +....g`, + map` +p.wg +b.w. +..b. +g...`, + map` +wwwwwwwwwtwdwwdt5wwwdw4 +g..bpww.wwdw.ww4tdw.wdw +wbwwwww.w.wd.wdt3ww.dw. +wwwdddw.w.dw.ww2tdw.wd. +w3wdtdwbw.wd.wdt6ww.dw. +wwwdtdwww.dw.ww5tdw.wd. +wwwdddw4w.wd.wdt4ww.dw. +wwwwwwwww.dwwww3tdwwwd. +w2wb...wwwwd2wdt2ww3dww`, + map` +23456dtlbw2 +23456dtlbw3 +23......bw4 +23......bw5 +wwwwwwwwwww +p.b.......g +wwwwwwwwwww +23456dtlbw6 +23456dtlbwd +23456dtlbwt +23456dtlbwl` + + ]; + + + +// set the map displayed to the current level +const currentLevel = levels[level]; +setMap(currentLevel); + +setSolids([ MrMan, box, wall ]); // other sprites cannot go inside of these sprites + +// allow certain sprites to push certain other sprites +setPushables({ + [MrMan]: [ box ], + [box]: [ box ] +}); + +// inputs for player movement control + + +onInput("k", () => { + getFirst(MrMan).y += 1; // positive y is downwards +}); + +onInput("l", () => { + getFirst(MrMan).x += 1; +}); + +onInput("i", () => { + getFirst(MrMan).y -= 1; +}); + +onInput("j", () => { + getFirst(MrMan).x -= 1; +}); +// input to reset level +onInput("w", () => { +const currentLevel = levels[level]; // get the original map of the level + + // make sure the level exists before we load it + if (currentLevel !== undefined) { + clearText(""); + setMap(currentLevel); + } +}); + +// these get run after every input +afterInput(() => { + // count the number of tiles with goals + const targetNumber = tilesWith(goal).length; + + // count the number of tiles with goals and boxes + const numberCovered = tilesWith(goal, box).length; + + // if the number of goals is the same as the number of goals covered + // all goals are covered and we can go to the next level + if (numberCovered === targetNumber) { + // increase the current level number + level = level + 1; + + const currentLevel = levels[level]; + + // make sure the level exists and if so set the map + // otherwise, we have finished the last level, there is no level + // after the last level + if (currentLevel !== undefined) { + setMap(currentLevel); + } else { + addText("you win!", { y: 4, color: color`0` }); + } + } +}); From 0924d7d6f08915386de384bd3b495910e08d5111 Mon Sep 17 00:00:00 2001 From: waitwhat653 Date: Sat, 15 Jun 2024 08:29:58 -0400 Subject: [PATCH 2/9] Add files via upload From c9413a26d80ba44687703f4724cb95b24a54f786 Mon Sep 17 00:00:00 2001 From: waitwhat653 Date: Sat, 15 Jun 2024 08:50:20 -0400 Subject: [PATCH 3/9] Add files via upload --- games/Mister Man!.js | 371 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 371 insertions(+) create mode 100644 games/Mister Man!.js diff --git a/games/Mister Man!.js b/games/Mister Man!.js new file mode 100644 index 0000000000..42fd549866 --- /dev/null +++ b/games/Mister Man!.js @@ -0,0 +1,371 @@ +//controls are I, J, K, L, and W for reset + +//define the sprites in our game + +const box = "b" +const goal = "g" +const wall = "w" +const MrMan = "p" +const player2 = "2" +const player3 = "3" +const player4 = "4" +const player5 = "5" +const player6 = "6" +const decorate = "d" +const trophie = "t" +const block = "l" +// assign bitmap art to each sprite +setLegend( + + [ box, bitmap` +8888888888888888 +8HHHHHHHHHHHHHHH +8H9999999999999H +8H9LLLLLLLLLLL9H +8H9L3333L5555L9H +8H9L3333L5555L9H +8H9L3333L5555L9H +8H9L3333L5555L9H +8H9LLLLLLLLLLL9H +8H9L4444L6666L9H +8H9L4444L6666L9H +8H9L4444L6666L9H +8H9L4444L6666L9H +8H9LLLLLLLLLLL9H +8H9999999999999H +8HHHHHHHHHHHHHHH`], + [ goal, bitmap` +.00000000000000. +.07777777777770. +.07777000077770. +.07777770077770. +.07777700077770. +.07777707777770. +.07777777777770. +.07777707777770. +.07777777777770. +.00000000000000. +.0L0L0L0L0L0LL0. +.00000000000000. +.0L0000000L0LL0. +.0L0LLLLL0L0LL0. +..000000000000.. +................`], + [ wall, bitmap` +..055555777770.. +..055557777770.. +..055555777770.. +..055557777770.. +..055555777770.. +..0595536747H0.. +..0903306000H0.. +..0900306040H0.. +..0909006040H0.. +..0909906000H0.. +..099999HHHHH0.. +..09999H9HHHH0.. +..099999HHHHH0.. +..0999HH8HHHH0.. +..09988888H8H0.. +..0988888888H0..`], + [ MrMan, bitmap` +................ +.....00000...... +....0CCCCC0..... +....0C0C0C0..... +....0CCCCC0..... +....0CCCCC0..... +....0C0C0C0..... +....0C000C0..... +....0CCCCC0..... +.C...00000...C.. +..0.0476190.0... +...00H383H00.... +....0916740..... +....0000000..... +.....0...0...... +.....00..00.....`], + [ player2, bitmap` +...000000000.... +..06666666660... +..06606660660... +..06666666660... +..06666666660... +..06606660660... +..03360006330... +6.03366666330.6. +0..000000000..0. +0...090D070...0. +0000990D0770000. +...0090D0700.... +..0440H030880... +.04440HH008880.. +..00000000000... +...0.......0....`], + [ player3, bitmap ` +................ +................ +...000000000.... +...0.......0.... +...0.0...0.0.... +...0.......0.... +...0..000..0.... +...0.......0.... +...000000000.... +.......0........ +..0000.0.0000... +.....00000...... +.......0........ +......000....... +.....00.00...... +....00...00.....`], + [ player4, bitmap ` +................ +......00000..... +...0000CCC00.... +...0330C0CC0.... +...0C3CCCCC0.... +...00C000330.... +....00CCCC00.... +.C...000000..C.. +.00..00660..00.. +..00.00660.00... +....00066000.... +......0000...... +......0.00...... +......0..CCCC... +......CCC....... +................`], + [ player5, bitmap ` +....00000000.... +...00......00... +...0.20.20..0... +...0.00.00..0... +...0...0....0... +...00......00... +....00000000.... +.......0........ +....00.0.00..... +......000....... +.......0........ +.......0........ +......000....... +.....0...0...... +...00.....00.... +..0.........0...`], + [ player6, bitmap ` +.....CCCCCC..... +....CCCCCCCC.... +...CCCCCCCCCC... +...CCC02C02CC... +...CCC00C00CC... +...CCCCCCCCCC... +...CCCC000CCC... +....CCCCCCCC.... +.C...CCCCCC...C. +CC44..4444..44CC +.C.4..4444..4.C. +...4444444444... +......5555...... +......5..5...... +......5..5...... +....CCC..CCC....`], + [ decorate, bitmap ` +..7.1.1.0...D... +....1..1.22.F... +.FHHF99FFFFFD... +.6F998..L.3LL0.. +...9H4.44.LLC8.. +0.D.46D69LL87F7. +055.366HHL684... +15F99H..HLL8LD4D +.1.D988.FHLDC.9. +.F188.4.7H3DD9.. +.F588L.8.HHH1... +.6.8...9.HH.H.44 +99994.59D.H8.4.. +..FL77CLHH84400. +..D.H..66.44...6 +..DCH..5.4......`], + [ trophie, bitmap ` +................ +......6666...... +...666FFFF666... +..66.66FF66.66.. +.66..666666..66. +.66..666666..66. +.66..6666F6..66. +.66..6666F6..66. +..66.6666F6.66.. +...666666F666... +....6666FF66.... +......6666...... +.......66....... +.......66....... +......6666...... +.....666666.....`], + [ block, bitmap ` +0000000000000000 +0222222222222220 +0222222222222220 +0222222222222220 +0222222222222220 +077444262332HHH0 +0722426663232H20 +0772426263232H20 +0272426663322H20 +0772426263232H20 +0222222222222220 +0222222222222220 +0222222222222220 +0222222222222220 +0222222222222220 +0000000000000000`] +); + +// create game levels +let level = 0; // this tracks the level we are on +const levels = [ + map` +............................... +..llll.lllll..l...llll..lllll.. +..l......l....l...l...l...l.... +..l......l...lll..l...l...l.... +..ll.....l...l.l..llll....l.... +....ll...l...lll..ll......l.... +.....l...l..ll.ll.l.l.....l.... +.....l...l..l...l.l..l....l.... +..llll...l..l...l.l...l...l.... +............................... +............................... +............................... +............pb.....g........... +............................... +............................... +............................... +...............................`, + map` +pw.g +.b.. +....`, + map` +w.pwg +.b... +..... +.g..b +w....`, + map` +pw.. +.b.. +...g +....`, + map` +pb.g +w.b. +g.b. +..g.`, + map` +....g +.g..b +..p.. +.b.b. +....g`, + map` +p.wg +b.w. +..b. +g...`, + map` +wwwwwwwwwtwdwwdt5wwwdw4 +g..bpww.wwdw.ww4tdw.wdw +wbwwwww.w.wd.wdt3ww.dw. +wwwdddw.w.dw.ww2tdw.wd. +w3wdtdwbw.wd.wdt6ww.dw. +wwwdtdwww.dw.ww5tdw.wd. +wwwdddw4w.wd.wdt4ww.dw. +wwwwwwwww.dwwww3tdwwwd. +w2wb...wwwwd2wdt2ww3dww`, + map` +23456dtlbw2 +23456dtlbw3 +23......bw4 +23......bw5 +wwwwwwwwwww +p.b.......g +wwwwwwwwwww +23456dtlbw6 +23456dtlbwd +23456dtlbwt +23456dtlbwl` + + ]; + + + +// set the map displayed to the current level +const currentLevel = levels[level]; +setMap(currentLevel); + +setSolids([ MrMan, box, wall, block ]); // other sprites cannot go inside of these sprites + +// allow certain sprites to push certain other sprites +setPushables({ + [MrMan]: [ box ], + [box]: [ box ] +}); + +// inputs for player movement control + + +onInput("k", () => { + getFirst(MrMan).y += 1; // positive y is downwards +}); + +onInput("l", () => { + getFirst(MrMan).x += 1; +}); + +onInput("i", () => { + getFirst(MrMan).y -= 1; +}); + +onInput("j", () => { + getFirst(MrMan).x -= 1; +}); +// input to reset level +onInput("w", () => { +const currentLevel = levels[level]; // get the original map of the level + + // make sure the level exists before we load it + if (currentLevel !== undefined) { + clearText(""); + setMap(currentLevel); + } +}); + +// these get run after every input +afterInput(() => { + // count the number of tiles with goals + const targetNumber = tilesWith(goal).length; + + // count the number of tiles with goals and boxes + const numberCovered = tilesWith(goal, box).length; + + // if the number of goals is the same as the number of goals covered + // all goals are covered and we can go to the next level + if (numberCovered === targetNumber) { + // increase the current level number + level = level + 1; + + const currentLevel = levels[level]; + + // make sure the level exists and if so set the map + // otherwise, we have finished the last level, there is no level + // after the last level + if (currentLevel !== undefined) { + setMap(currentLevel); + } else { + addText("you win!", { y: 4, color: color`0` }); + } + } +}); From be0193f36a3cbd61936c983b3e6186a00c1bb094 Mon Sep 17 00:00:00 2001 From: waitwhat653 Date: Sat, 15 Jun 2024 11:15:16 -0400 Subject: [PATCH 4/9] Add files via upload --- games/Mister Man! (1).js | 371 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 371 insertions(+) create mode 100644 games/Mister Man! (1).js diff --git a/games/Mister Man! (1).js b/games/Mister Man! (1).js new file mode 100644 index 0000000000..42fd549866 --- /dev/null +++ b/games/Mister Man! (1).js @@ -0,0 +1,371 @@ +//controls are I, J, K, L, and W for reset + +//define the sprites in our game + +const box = "b" +const goal = "g" +const wall = "w" +const MrMan = "p" +const player2 = "2" +const player3 = "3" +const player4 = "4" +const player5 = "5" +const player6 = "6" +const decorate = "d" +const trophie = "t" +const block = "l" +// assign bitmap art to each sprite +setLegend( + + [ box, bitmap` +8888888888888888 +8HHHHHHHHHHHHHHH +8H9999999999999H +8H9LLLLLLLLLLL9H +8H9L3333L5555L9H +8H9L3333L5555L9H +8H9L3333L5555L9H +8H9L3333L5555L9H +8H9LLLLLLLLLLL9H +8H9L4444L6666L9H +8H9L4444L6666L9H +8H9L4444L6666L9H +8H9L4444L6666L9H +8H9LLLLLLLLLLL9H +8H9999999999999H +8HHHHHHHHHHHHHHH`], + [ goal, bitmap` +.00000000000000. +.07777777777770. +.07777000077770. +.07777770077770. +.07777700077770. +.07777707777770. +.07777777777770. +.07777707777770. +.07777777777770. +.00000000000000. +.0L0L0L0L0L0LL0. +.00000000000000. +.0L0000000L0LL0. +.0L0LLLLL0L0LL0. +..000000000000.. +................`], + [ wall, bitmap` +..055555777770.. +..055557777770.. +..055555777770.. +..055557777770.. +..055555777770.. +..0595536747H0.. +..0903306000H0.. +..0900306040H0.. +..0909006040H0.. +..0909906000H0.. +..099999HHHHH0.. +..09999H9HHHH0.. +..099999HHHHH0.. +..0999HH8HHHH0.. +..09988888H8H0.. +..0988888888H0..`], + [ MrMan, bitmap` +................ +.....00000...... +....0CCCCC0..... +....0C0C0C0..... +....0CCCCC0..... +....0CCCCC0..... +....0C0C0C0..... +....0C000C0..... +....0CCCCC0..... +.C...00000...C.. +..0.0476190.0... +...00H383H00.... +....0916740..... +....0000000..... +.....0...0...... +.....00..00.....`], + [ player2, bitmap` +...000000000.... +..06666666660... +..06606660660... +..06666666660... +..06666666660... +..06606660660... +..03360006330... +6.03366666330.6. +0..000000000..0. +0...090D070...0. +0000990D0770000. +...0090D0700.... +..0440H030880... +.04440HH008880.. +..00000000000... +...0.......0....`], + [ player3, bitmap ` +................ +................ +...000000000.... +...0.......0.... +...0.0...0.0.... +...0.......0.... +...0..000..0.... +...0.......0.... +...000000000.... +.......0........ +..0000.0.0000... +.....00000...... +.......0........ +......000....... +.....00.00...... +....00...00.....`], + [ player4, bitmap ` +................ +......00000..... +...0000CCC00.... +...0330C0CC0.... +...0C3CCCCC0.... +...00C000330.... +....00CCCC00.... +.C...000000..C.. +.00..00660..00.. +..00.00660.00... +....00066000.... +......0000...... +......0.00...... +......0..CCCC... +......CCC....... +................`], + [ player5, bitmap ` +....00000000.... +...00......00... +...0.20.20..0... +...0.00.00..0... +...0...0....0... +...00......00... +....00000000.... +.......0........ +....00.0.00..... +......000....... +.......0........ +.......0........ +......000....... +.....0...0...... +...00.....00.... +..0.........0...`], + [ player6, bitmap ` +.....CCCCCC..... +....CCCCCCCC.... +...CCCCCCCCCC... +...CCC02C02CC... +...CCC00C00CC... +...CCCCCCCCCC... +...CCCC000CCC... +....CCCCCCCC.... +.C...CCCCCC...C. +CC44..4444..44CC +.C.4..4444..4.C. +...4444444444... +......5555...... +......5..5...... +......5..5...... +....CCC..CCC....`], + [ decorate, bitmap ` +..7.1.1.0...D... +....1..1.22.F... +.FHHF99FFFFFD... +.6F998..L.3LL0.. +...9H4.44.LLC8.. +0.D.46D69LL87F7. +055.366HHL684... +15F99H..HLL8LD4D +.1.D988.FHLDC.9. +.F188.4.7H3DD9.. +.F588L.8.HHH1... +.6.8...9.HH.H.44 +99994.59D.H8.4.. +..FL77CLHH84400. +..D.H..66.44...6 +..DCH..5.4......`], + [ trophie, bitmap ` +................ +......6666...... +...666FFFF666... +..66.66FF66.66.. +.66..666666..66. +.66..666666..66. +.66..6666F6..66. +.66..6666F6..66. +..66.6666F6.66.. +...666666F666... +....6666FF66.... +......6666...... +.......66....... +.......66....... +......6666...... +.....666666.....`], + [ block, bitmap ` +0000000000000000 +0222222222222220 +0222222222222220 +0222222222222220 +0222222222222220 +077444262332HHH0 +0722426663232H20 +0772426263232H20 +0272426663322H20 +0772426263232H20 +0222222222222220 +0222222222222220 +0222222222222220 +0222222222222220 +0222222222222220 +0000000000000000`] +); + +// create game levels +let level = 0; // this tracks the level we are on +const levels = [ + map` +............................... +..llll.lllll..l...llll..lllll.. +..l......l....l...l...l...l.... +..l......l...lll..l...l...l.... +..ll.....l...l.l..llll....l.... +....ll...l...lll..ll......l.... +.....l...l..ll.ll.l.l.....l.... +.....l...l..l...l.l..l....l.... +..llll...l..l...l.l...l...l.... +............................... +............................... +............................... +............pb.....g........... +............................... +............................... +............................... +...............................`, + map` +pw.g +.b.. +....`, + map` +w.pwg +.b... +..... +.g..b +w....`, + map` +pw.. +.b.. +...g +....`, + map` +pb.g +w.b. +g.b. +..g.`, + map` +....g +.g..b +..p.. +.b.b. +....g`, + map` +p.wg +b.w. +..b. +g...`, + map` +wwwwwwwwwtwdwwdt5wwwdw4 +g..bpww.wwdw.ww4tdw.wdw +wbwwwww.w.wd.wdt3ww.dw. +wwwdddw.w.dw.ww2tdw.wd. +w3wdtdwbw.wd.wdt6ww.dw. +wwwdtdwww.dw.ww5tdw.wd. +wwwdddw4w.wd.wdt4ww.dw. +wwwwwwwww.dwwww3tdwwwd. +w2wb...wwwwd2wdt2ww3dww`, + map` +23456dtlbw2 +23456dtlbw3 +23......bw4 +23......bw5 +wwwwwwwwwww +p.b.......g +wwwwwwwwwww +23456dtlbw6 +23456dtlbwd +23456dtlbwt +23456dtlbwl` + + ]; + + + +// set the map displayed to the current level +const currentLevel = levels[level]; +setMap(currentLevel); + +setSolids([ MrMan, box, wall, block ]); // other sprites cannot go inside of these sprites + +// allow certain sprites to push certain other sprites +setPushables({ + [MrMan]: [ box ], + [box]: [ box ] +}); + +// inputs for player movement control + + +onInput("k", () => { + getFirst(MrMan).y += 1; // positive y is downwards +}); + +onInput("l", () => { + getFirst(MrMan).x += 1; +}); + +onInput("i", () => { + getFirst(MrMan).y -= 1; +}); + +onInput("j", () => { + getFirst(MrMan).x -= 1; +}); +// input to reset level +onInput("w", () => { +const currentLevel = levels[level]; // get the original map of the level + + // make sure the level exists before we load it + if (currentLevel !== undefined) { + clearText(""); + setMap(currentLevel); + } +}); + +// these get run after every input +afterInput(() => { + // count the number of tiles with goals + const targetNumber = tilesWith(goal).length; + + // count the number of tiles with goals and boxes + const numberCovered = tilesWith(goal, box).length; + + // if the number of goals is the same as the number of goals covered + // all goals are covered and we can go to the next level + if (numberCovered === targetNumber) { + // increase the current level number + level = level + 1; + + const currentLevel = levels[level]; + + // make sure the level exists and if so set the map + // otherwise, we have finished the last level, there is no level + // after the last level + if (currentLevel !== undefined) { + setMap(currentLevel); + } else { + addText("you win!", { y: 4, color: color`0` }); + } + } +}); From 240a4ef569b1eb1a3601578e539c97df9ad94496 Mon Sep 17 00:00:00 2001 From: waitwhat653 Date: Mon, 2 Sep 2024 21:19:48 -0400 Subject: [PATCH 5/9] Block on Goal. This game is about pushing some blocks onto some goals. All blocks must be on the goal to proceed and blocks may be pushed of the goal --- games/Mister Man! (4).js | 398 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 398 insertions(+) create mode 100644 games/Mister Man! (4).js diff --git a/games/Mister Man! (4).js b/games/Mister Man! (4).js new file mode 100644 index 0000000000..27c54caaca --- /dev/null +++ b/games/Mister Man! (4).js @@ -0,0 +1,398 @@ +//controls are I, J, K, L, and D for reset + +//define the sprites in our game + +const box = "b" +const MrMan = "p" +const goal = "g" +const wall = "w" +const player2 = "2" +const player3 = "3" +const player4 = "4" +const player5 = "5" +const player6 = "6" +const decorate = "d" +const trophie = "t" +const block = "l" +// assign bitmap art to each sprite +setLegend( + + [ box, bitmap` +8888888888888888 +8HHHHHHHHHHHHHHH +8H9999999999999H +8H9LLLLLLLLLLL9H +8H9L3333L5555L9H +8H9L3333L5555L9H +8H9L3333L5555L9H +8H9L3333L5555L9H +8H9LLLLLLLLLLL9H +8H9L4444L6666L9H +8H9L4444L6666L9H +8H9L4444L6666L9H +8H9L4444L6666L9H +8H9LLLLLLLLLLL9H +8H9999999999999H +8HHHHHHHHHHHHHHH`], + [ MrMan, bitmap` +................ +.....00000...... +....0CCCCC0..... +....0C0C0C0..... +....0CCCCC0..... +....0CCCCC0..... +....0C0C0C0..... +....0C000C0..... +....0CCCCC0..... +.C...00000...C.. +..0.0476190.0... +...00H383H00.... +....0916740..... +....0000000..... +.....0...0...... +.....00..00.....`], + [ goal, bitmap` +.00000000000000. +.07777777777770. +.07777000077770. +.07777770077770. +.07777700077770. +.07777707777770. +.07777777777770. +.07777707777770. +.07777777777770. +.00000000000000. +.0L0L0L0L0L0LL0. +.00000000000000. +.0L0000000L0LL0. +.0L0LLLLL0L0LL0. +..000000000000.. +................`], + [ wall, bitmap` +..055555777770.. +..055557777770.. +..055555777770.. +..055557777770.. +..055555777770.. +..0595536747H0.. +..0903306000H0.. +..0900306040H0.. +..0909006040H0.. +..0909906000H0.. +..099999HHHHH0.. +..09999H9HHHH0.. +..099999HHHHH0.. +..0999HH8HHHH0.. +..09988888H8H0.. +..0988888888H0..`], + [ player2, bitmap` +...000000000.... +..06666666660... +..06606660660... +..06666666660... +..06666666660... +..06606660660... +..03360006330... +6.03366666330.6. +0..000000000..0. +0...090D070...0. +0000990D0770000. +...0090D0700.... +..0440H030880... +.04440HH008880.. +..00000000000... +...0.......0....`], + [ player3, bitmap ` +................ +................ +...000000000.... +...0.......0.... +...0.0...0.0.... +...0.......0.... +...0..000..0.... +...0.......0.... +...000000000.... +.......0........ +..0000.0.0000... +.....00000...... +.......0........ +......000....... +.....00.00...... +....00...00.....`], + [ player4, bitmap ` +................ +......00000..... +...0000CCC00.... +...0330C0CC0.... +...0C3CCCCC0.... +...00C000330.... +....00CCCC00.... +.C...000000..C.. +.00..00660..00.. +..00.00660.00... +....00066000.... +......0000...... +......0.00...... +......0..CCCC... +......CCC....... +................`], + [ player5, bitmap ` +....00000000.... +...00......00... +...0.20.20..0... +...0.00.00..0... +...0...0....0... +...00......00... +....00000000.... +.......0........ +....00.0.00..... +......000....... +.......0........ +.......0........ +......000....... +.....0...0...... +...00.....00.... +..0.........0...`], + [ player6, bitmap ` +.....CCCCCC..... +....CCCCCCCC.... +...CCCCCCCCCC... +...CCC02C02CC... +...CCC00C00CC... +...CCCCCCCCCC... +...CCCC000CCC... +....CCCCCCCC.... +.C...CCCCCC...C. +CC44..4444..44CC +.C.4..4444..4.C. +...4444444444... +......5555...... +......5..5...... +......5..5...... +....CCC..CCC....`], + [ decorate, bitmap ` +..7.1.1.0...D... +....1..1.22.F... +.FHHF99FFFFFD... +.6F998..L.3LL0.. +...9H4.44.LLC8.. +0.D.46D69LL87F7. +055.366HHL684... +15F99H..HLL8LD4D +.1.D988.FHLDC.9. +.F188.4.7H3DD9.. +.F588L.8.HHH1... +.6.8...9.HH.H.44 +99994.59D.H8.4.. +..FL77CLHH84400. +..D.H..66.44...6 +..DCH..5.4......`], + [ trophie, bitmap ` +................ +......6666...... +...666FFFF666... +..66.66FF66.66.. +.66..666666..66. +.66..666666..66. +.66..6666F6..66. +.66..6666F6..66. +..66.6666F6.66.. +...666666F666... +....6666FF66.... +......6666...... +.......66....... +.......66....... +......6666...... +.....666666.....`], + [ block, bitmap ` +0000000000000000 +0222222222222220 +0222222222222220 +0222222222222220 +0222222222222220 +077444262332HHH0 +0722426663232H20 +0772426263232H20 +0272426663322H20 +0772426263232H20 +0222222222222220 +0222222222222220 +0222222222222220 +0222222222222220 +0222222222222220 +0000000000000000`] +); + +// create game levels +let level = 0; // this tracks the level we are on +const levels = [ + map` +............................... +..llll.lllll..l...llll..lllll.. +..l......l....l...l...l...l.... +..l......l...lll..l...l...l.... +..ll.....l...l.l..llll....l.... +....ll...l...lll..ll......l.... +.....l...l..ll.ll.l.l.....l.... +.....l...l..l...l.l..l....l.... +..llll...l..l...l.l...l...l.... +............................... +............................... +............................... +............pb.....g........... +............................... +............................... +............................... +...............................`, + map` +pw.g +.b.. +....`, + map` +w.pwg +.b... +..... +.g..b +w....`, + map` +pw.. +.b.. +...g +....`, + map` +pb.g +w.b. +g.b. +..g.`, + map` +....g +.g..b +..p.. +.b.b. +....g`, + map` +p.wg +b.w. +..b. +g...`, + map` +wwwwwwwwwtwdwwdt5wwwdw4 +g..bpww.wwdw.ww4tdw.wdw +wbwwwww.w.wd.wdt3ww.dw. +wwwdddw.w.dw.ww2tdw.wd. +w3wdtdwbw.wd.wdt6ww.dw. +wwwdtdwww.dw.ww5tdw.wd. +wwwdddw4w.wd.wdt4ww.dw. +wwwwwwwww.dwwww3tdwwwd. +w2wb...wwwwd2wdt2ww3dww`, + map` +23456dtlbw2 +23456dtlbw3 +23......bw4 +23......bw5 +wwwwwwwwwww +p.b.......g +wwwwwwwwwww +23456dtlbw6 +23456dtlbwd +23456dtlbwt +23456dtlbwl` + + ]; + + + +// set the map displayed to the current level +const currentLevel = levels[level]; +setMap(currentLevel); + +setSolids([ MrMan, box, wall, block ]); // other sprites cannot go inside of these sprites + +// allow certain sprites to push certain other sprites +setPushables({ + [MrMan]: [ box ], + [box]: [ box ] +}); +//Background music + +const backgroundMusic = tune``; + +// inputs for player movement control + +//Tune + +const walk = tune` +37.5: B4~37.5 + C5/37.5 + A4~37.5 + G5-37.5 + E4~37.5, +37.5: B4^37.5 + A4-37.5 + C5-37.5 + C4^37.5 + E5/37.5, +1125` + +//Ok now + +onInput("k", () => { + getFirst(MrMan).y += 1; //down + playTune(walk) +}); + +onInput("l", () => { + getFirst(MrMan).x += 1; //right + playTune(walk) +}); + +onInput("i", () => { + getFirst(MrMan).y -= 1; //up + playTune(walk) +}); + +onInput("j", () => { + getFirst(MrMan).x -= 1; //left + playTune(walk) +}); + +// input to reset level + +const reset = tune` +37.5: B4/37.5 + C5~37.5 + A4-37.5, +37.5: A4~37.5 + C5^37.5 + B4-37.5, +37.5: B4^37.5 + C5-37.5 + A4/37.5, +1087.5` + +//Ok now 2.0 + +onInput("d", () => { +const currentLevel = levels[level]; // get the original map of the level +playTune(reset) + + // make sure the level exists before we load it + if (currentLevel !== undefined) { + clearText(""); + setMap(currentLevel); + } +}); + +// these get run after every input +afterInput(() => { + // count the number of tiles with goals + const targetNumber = tilesWith(goal).length; + + // count the number of tiles with goals and boxes + const numberCovered = tilesWith(goal, box).length; + + // if the number of goals is the same as the number of goals covered + // all goals are covered and we can go to the next level + if (numberCovered === targetNumber) { + // increase the current level number + level = level + 1; + + const currentLevel = levels[level]; + + // make sure the level exists and if so set the map + // otherwise, we have finished the last level, there is no level + // after the last level + if (currentLevel !== undefined) { + setMap(currentLevel); + } else { + addText("you win!", { y: 4, color: color`7` }); + + } + } +}); From a2cf70753326887b3d6063d1b929fd8cb00214ca Mon Sep 17 00:00:00 2001 From: Cheru Berhanu Date: Tue, 3 Sep 2024 09:37:58 -0400 Subject: [PATCH 6/9] Update Mister Man! (1).js --- games/Mister Man! (1).js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/games/Mister Man! (1).js b/games/Mister Man! (1).js index 42fd549866..d66ed4bcc1 100644 --- a/games/Mister Man! (1).js +++ b/games/Mister Man! (1).js @@ -1,3 +1,10 @@ +/* +@title: Mr.Man! +@author: Deoteet Ojasavee +@addedOn: 2024-09-03 +@tags: [] +*/ + //controls are I, J, K, L, and W for reset //define the sprites in our game @@ -369,3 +376,4 @@ afterInput(() => { } } }); + From f04f35028980577c68a79d3ac83835621e498c5e Mon Sep 17 00:00:00 2001 From: Graham Darcey Date: Fri, 4 Oct 2024 11:29:49 -0400 Subject: [PATCH 7/9] Deleting the duplicate game submissions --- games/Mister Man! (1).js | 379 --------------------------------------- games/Mister Man!.js | 371 -------------------------------------- games/Mr.Man!.js | 371 -------------------------------------- 3 files changed, 1121 deletions(-) delete mode 100644 games/Mister Man! (1).js delete mode 100644 games/Mister Man!.js delete mode 100644 games/Mr.Man!.js diff --git a/games/Mister Man! (1).js b/games/Mister Man! (1).js deleted file mode 100644 index d66ed4bcc1..0000000000 --- a/games/Mister Man! (1).js +++ /dev/null @@ -1,379 +0,0 @@ -/* -@title: Mr.Man! -@author: Deoteet Ojasavee -@addedOn: 2024-09-03 -@tags: [] -*/ - -//controls are I, J, K, L, and W for reset - -//define the sprites in our game - -const box = "b" -const goal = "g" -const wall = "w" -const MrMan = "p" -const player2 = "2" -const player3 = "3" -const player4 = "4" -const player5 = "5" -const player6 = "6" -const decorate = "d" -const trophie = "t" -const block = "l" -// assign bitmap art to each sprite -setLegend( - - [ box, bitmap` -8888888888888888 -8HHHHHHHHHHHHHHH -8H9999999999999H -8H9LLLLLLLLLLL9H -8H9L3333L5555L9H -8H9L3333L5555L9H -8H9L3333L5555L9H -8H9L3333L5555L9H -8H9LLLLLLLLLLL9H -8H9L4444L6666L9H -8H9L4444L6666L9H -8H9L4444L6666L9H -8H9L4444L6666L9H -8H9LLLLLLLLLLL9H -8H9999999999999H -8HHHHHHHHHHHHHHH`], - [ goal, bitmap` -.00000000000000. -.07777777777770. -.07777000077770. -.07777770077770. -.07777700077770. -.07777707777770. -.07777777777770. -.07777707777770. -.07777777777770. -.00000000000000. -.0L0L0L0L0L0LL0. -.00000000000000. -.0L0000000L0LL0. -.0L0LLLLL0L0LL0. -..000000000000.. -................`], - [ wall, bitmap` -..055555777770.. -..055557777770.. -..055555777770.. -..055557777770.. -..055555777770.. -..0595536747H0.. -..0903306000H0.. -..0900306040H0.. -..0909006040H0.. -..0909906000H0.. -..099999HHHHH0.. -..09999H9HHHH0.. -..099999HHHHH0.. -..0999HH8HHHH0.. -..09988888H8H0.. -..0988888888H0..`], - [ MrMan, bitmap` -................ -.....00000...... -....0CCCCC0..... -....0C0C0C0..... -....0CCCCC0..... -....0CCCCC0..... -....0C0C0C0..... -....0C000C0..... -....0CCCCC0..... -.C...00000...C.. -..0.0476190.0... -...00H383H00.... -....0916740..... -....0000000..... -.....0...0...... -.....00..00.....`], - [ player2, bitmap` -...000000000.... -..06666666660... -..06606660660... -..06666666660... -..06666666660... -..06606660660... -..03360006330... -6.03366666330.6. -0..000000000..0. -0...090D070...0. -0000990D0770000. -...0090D0700.... -..0440H030880... -.04440HH008880.. -..00000000000... -...0.......0....`], - [ player3, bitmap ` -................ -................ -...000000000.... -...0.......0.... -...0.0...0.0.... -...0.......0.... -...0..000..0.... -...0.......0.... -...000000000.... -.......0........ -..0000.0.0000... -.....00000...... -.......0........ -......000....... -.....00.00...... -....00...00.....`], - [ player4, bitmap ` -................ -......00000..... -...0000CCC00.... -...0330C0CC0.... -...0C3CCCCC0.... -...00C000330.... -....00CCCC00.... -.C...000000..C.. -.00..00660..00.. -..00.00660.00... -....00066000.... -......0000...... -......0.00...... -......0..CCCC... -......CCC....... -................`], - [ player5, bitmap ` -....00000000.... -...00......00... -...0.20.20..0... -...0.00.00..0... -...0...0....0... -...00......00... -....00000000.... -.......0........ -....00.0.00..... -......000....... -.......0........ -.......0........ -......000....... -.....0...0...... -...00.....00.... -..0.........0...`], - [ player6, bitmap ` -.....CCCCCC..... -....CCCCCCCC.... -...CCCCCCCCCC... -...CCC02C02CC... -...CCC00C00CC... -...CCCCCCCCCC... -...CCCC000CCC... -....CCCCCCCC.... -.C...CCCCCC...C. -CC44..4444..44CC -.C.4..4444..4.C. -...4444444444... -......5555...... -......5..5...... -......5..5...... -....CCC..CCC....`], - [ decorate, bitmap ` -..7.1.1.0...D... -....1..1.22.F... -.FHHF99FFFFFD... -.6F998..L.3LL0.. -...9H4.44.LLC8.. -0.D.46D69LL87F7. -055.366HHL684... -15F99H..HLL8LD4D -.1.D988.FHLDC.9. -.F188.4.7H3DD9.. -.F588L.8.HHH1... -.6.8...9.HH.H.44 -99994.59D.H8.4.. -..FL77CLHH84400. -..D.H..66.44...6 -..DCH..5.4......`], - [ trophie, bitmap ` -................ -......6666...... -...666FFFF666... -..66.66FF66.66.. -.66..666666..66. -.66..666666..66. -.66..6666F6..66. -.66..6666F6..66. -..66.6666F6.66.. -...666666F666... -....6666FF66.... -......6666...... -.......66....... -.......66....... -......6666...... -.....666666.....`], - [ block, bitmap ` -0000000000000000 -0222222222222220 -0222222222222220 -0222222222222220 -0222222222222220 -077444262332HHH0 -0722426663232H20 -0772426263232H20 -0272426663322H20 -0772426263232H20 -0222222222222220 -0222222222222220 -0222222222222220 -0222222222222220 -0222222222222220 -0000000000000000`] -); - -// create game levels -let level = 0; // this tracks the level we are on -const levels = [ - map` -............................... -..llll.lllll..l...llll..lllll.. -..l......l....l...l...l...l.... -..l......l...lll..l...l...l.... -..ll.....l...l.l..llll....l.... -....ll...l...lll..ll......l.... -.....l...l..ll.ll.l.l.....l.... -.....l...l..l...l.l..l....l.... -..llll...l..l...l.l...l...l.... -............................... -............................... -............................... -............pb.....g........... -............................... -............................... -............................... -...............................`, - map` -pw.g -.b.. -....`, - map` -w.pwg -.b... -..... -.g..b -w....`, - map` -pw.. -.b.. -...g -....`, - map` -pb.g -w.b. -g.b. -..g.`, - map` -....g -.g..b -..p.. -.b.b. -....g`, - map` -p.wg -b.w. -..b. -g...`, - map` -wwwwwwwwwtwdwwdt5wwwdw4 -g..bpww.wwdw.ww4tdw.wdw -wbwwwww.w.wd.wdt3ww.dw. -wwwdddw.w.dw.ww2tdw.wd. -w3wdtdwbw.wd.wdt6ww.dw. -wwwdtdwww.dw.ww5tdw.wd. -wwwdddw4w.wd.wdt4ww.dw. -wwwwwwwww.dwwww3tdwwwd. -w2wb...wwwwd2wdt2ww3dww`, - map` -23456dtlbw2 -23456dtlbw3 -23......bw4 -23......bw5 -wwwwwwwwwww -p.b.......g -wwwwwwwwwww -23456dtlbw6 -23456dtlbwd -23456dtlbwt -23456dtlbwl` - - ]; - - - -// set the map displayed to the current level -const currentLevel = levels[level]; -setMap(currentLevel); - -setSolids([ MrMan, box, wall, block ]); // other sprites cannot go inside of these sprites - -// allow certain sprites to push certain other sprites -setPushables({ - [MrMan]: [ box ], - [box]: [ box ] -}); - -// inputs for player movement control - - -onInput("k", () => { - getFirst(MrMan).y += 1; // positive y is downwards -}); - -onInput("l", () => { - getFirst(MrMan).x += 1; -}); - -onInput("i", () => { - getFirst(MrMan).y -= 1; -}); - -onInput("j", () => { - getFirst(MrMan).x -= 1; -}); -// input to reset level -onInput("w", () => { -const currentLevel = levels[level]; // get the original map of the level - - // make sure the level exists before we load it - if (currentLevel !== undefined) { - clearText(""); - setMap(currentLevel); - } -}); - -// these get run after every input -afterInput(() => { - // count the number of tiles with goals - const targetNumber = tilesWith(goal).length; - - // count the number of tiles with goals and boxes - const numberCovered = tilesWith(goal, box).length; - - // if the number of goals is the same as the number of goals covered - // all goals are covered and we can go to the next level - if (numberCovered === targetNumber) { - // increase the current level number - level = level + 1; - - const currentLevel = levels[level]; - - // make sure the level exists and if so set the map - // otherwise, we have finished the last level, there is no level - // after the last level - if (currentLevel !== undefined) { - setMap(currentLevel); - } else { - addText("you win!", { y: 4, color: color`0` }); - } - } -}); - diff --git a/games/Mister Man!.js b/games/Mister Man!.js deleted file mode 100644 index 42fd549866..0000000000 --- a/games/Mister Man!.js +++ /dev/null @@ -1,371 +0,0 @@ -//controls are I, J, K, L, and W for reset - -//define the sprites in our game - -const box = "b" -const goal = "g" -const wall = "w" -const MrMan = "p" -const player2 = "2" -const player3 = "3" -const player4 = "4" -const player5 = "5" -const player6 = "6" -const decorate = "d" -const trophie = "t" -const block = "l" -// assign bitmap art to each sprite -setLegend( - - [ box, bitmap` -8888888888888888 -8HHHHHHHHHHHHHHH -8H9999999999999H -8H9LLLLLLLLLLL9H -8H9L3333L5555L9H -8H9L3333L5555L9H -8H9L3333L5555L9H -8H9L3333L5555L9H -8H9LLLLLLLLLLL9H -8H9L4444L6666L9H -8H9L4444L6666L9H -8H9L4444L6666L9H -8H9L4444L6666L9H -8H9LLLLLLLLLLL9H -8H9999999999999H -8HHHHHHHHHHHHHHH`], - [ goal, bitmap` -.00000000000000. -.07777777777770. -.07777000077770. -.07777770077770. -.07777700077770. -.07777707777770. -.07777777777770. -.07777707777770. -.07777777777770. -.00000000000000. -.0L0L0L0L0L0LL0. -.00000000000000. -.0L0000000L0LL0. -.0L0LLLLL0L0LL0. -..000000000000.. -................`], - [ wall, bitmap` -..055555777770.. -..055557777770.. -..055555777770.. -..055557777770.. -..055555777770.. -..0595536747H0.. -..0903306000H0.. -..0900306040H0.. -..0909006040H0.. -..0909906000H0.. -..099999HHHHH0.. -..09999H9HHHH0.. -..099999HHHHH0.. -..0999HH8HHHH0.. -..09988888H8H0.. -..0988888888H0..`], - [ MrMan, bitmap` -................ -.....00000...... -....0CCCCC0..... -....0C0C0C0..... -....0CCCCC0..... -....0CCCCC0..... -....0C0C0C0..... -....0C000C0..... -....0CCCCC0..... -.C...00000...C.. -..0.0476190.0... -...00H383H00.... -....0916740..... -....0000000..... -.....0...0...... -.....00..00.....`], - [ player2, bitmap` -...000000000.... -..06666666660... -..06606660660... -..06666666660... -..06666666660... -..06606660660... -..03360006330... -6.03366666330.6. -0..000000000..0. -0...090D070...0. -0000990D0770000. -...0090D0700.... -..0440H030880... -.04440HH008880.. -..00000000000... -...0.......0....`], - [ player3, bitmap ` -................ -................ -...000000000.... -...0.......0.... -...0.0...0.0.... -...0.......0.... -...0..000..0.... -...0.......0.... -...000000000.... -.......0........ -..0000.0.0000... -.....00000...... -.......0........ -......000....... -.....00.00...... -....00...00.....`], - [ player4, bitmap ` -................ -......00000..... -...0000CCC00.... -...0330C0CC0.... -...0C3CCCCC0.... -...00C000330.... -....00CCCC00.... -.C...000000..C.. -.00..00660..00.. -..00.00660.00... -....00066000.... -......0000...... -......0.00...... -......0..CCCC... -......CCC....... -................`], - [ player5, bitmap ` -....00000000.... -...00......00... -...0.20.20..0... -...0.00.00..0... -...0...0....0... -...00......00... -....00000000.... -.......0........ -....00.0.00..... -......000....... -.......0........ -.......0........ -......000....... -.....0...0...... -...00.....00.... -..0.........0...`], - [ player6, bitmap ` -.....CCCCCC..... -....CCCCCCCC.... -...CCCCCCCCCC... -...CCC02C02CC... -...CCC00C00CC... -...CCCCCCCCCC... -...CCCC000CCC... -....CCCCCCCC.... -.C...CCCCCC...C. -CC44..4444..44CC -.C.4..4444..4.C. -...4444444444... -......5555...... -......5..5...... -......5..5...... -....CCC..CCC....`], - [ decorate, bitmap ` -..7.1.1.0...D... -....1..1.22.F... -.FHHF99FFFFFD... -.6F998..L.3LL0.. -...9H4.44.LLC8.. -0.D.46D69LL87F7. -055.366HHL684... -15F99H..HLL8LD4D -.1.D988.FHLDC.9. -.F188.4.7H3DD9.. -.F588L.8.HHH1... -.6.8...9.HH.H.44 -99994.59D.H8.4.. -..FL77CLHH84400. -..D.H..66.44...6 -..DCH..5.4......`], - [ trophie, bitmap ` -................ -......6666...... -...666FFFF666... -..66.66FF66.66.. -.66..666666..66. -.66..666666..66. -.66..6666F6..66. -.66..6666F6..66. -..66.6666F6.66.. -...666666F666... -....6666FF66.... -......6666...... -.......66....... -.......66....... -......6666...... -.....666666.....`], - [ block, bitmap ` -0000000000000000 -0222222222222220 -0222222222222220 -0222222222222220 -0222222222222220 -077444262332HHH0 -0722426663232H20 -0772426263232H20 -0272426663322H20 -0772426263232H20 -0222222222222220 -0222222222222220 -0222222222222220 -0222222222222220 -0222222222222220 -0000000000000000`] -); - -// create game levels -let level = 0; // this tracks the level we are on -const levels = [ - map` -............................... -..llll.lllll..l...llll..lllll.. -..l......l....l...l...l...l.... -..l......l...lll..l...l...l.... -..ll.....l...l.l..llll....l.... -....ll...l...lll..ll......l.... -.....l...l..ll.ll.l.l.....l.... -.....l...l..l...l.l..l....l.... -..llll...l..l...l.l...l...l.... -............................... -............................... -............................... -............pb.....g........... -............................... -............................... -............................... -...............................`, - map` -pw.g -.b.. -....`, - map` -w.pwg -.b... -..... -.g..b -w....`, - map` -pw.. -.b.. -...g -....`, - map` -pb.g -w.b. -g.b. -..g.`, - map` -....g -.g..b -..p.. -.b.b. -....g`, - map` -p.wg -b.w. -..b. -g...`, - map` -wwwwwwwwwtwdwwdt5wwwdw4 -g..bpww.wwdw.ww4tdw.wdw -wbwwwww.w.wd.wdt3ww.dw. -wwwdddw.w.dw.ww2tdw.wd. -w3wdtdwbw.wd.wdt6ww.dw. -wwwdtdwww.dw.ww5tdw.wd. -wwwdddw4w.wd.wdt4ww.dw. -wwwwwwwww.dwwww3tdwwwd. -w2wb...wwwwd2wdt2ww3dww`, - map` -23456dtlbw2 -23456dtlbw3 -23......bw4 -23......bw5 -wwwwwwwwwww -p.b.......g -wwwwwwwwwww -23456dtlbw6 -23456dtlbwd -23456dtlbwt -23456dtlbwl` - - ]; - - - -// set the map displayed to the current level -const currentLevel = levels[level]; -setMap(currentLevel); - -setSolids([ MrMan, box, wall, block ]); // other sprites cannot go inside of these sprites - -// allow certain sprites to push certain other sprites -setPushables({ - [MrMan]: [ box ], - [box]: [ box ] -}); - -// inputs for player movement control - - -onInput("k", () => { - getFirst(MrMan).y += 1; // positive y is downwards -}); - -onInput("l", () => { - getFirst(MrMan).x += 1; -}); - -onInput("i", () => { - getFirst(MrMan).y -= 1; -}); - -onInput("j", () => { - getFirst(MrMan).x -= 1; -}); -// input to reset level -onInput("w", () => { -const currentLevel = levels[level]; // get the original map of the level - - // make sure the level exists before we load it - if (currentLevel !== undefined) { - clearText(""); - setMap(currentLevel); - } -}); - -// these get run after every input -afterInput(() => { - // count the number of tiles with goals - const targetNumber = tilesWith(goal).length; - - // count the number of tiles with goals and boxes - const numberCovered = tilesWith(goal, box).length; - - // if the number of goals is the same as the number of goals covered - // all goals are covered and we can go to the next level - if (numberCovered === targetNumber) { - // increase the current level number - level = level + 1; - - const currentLevel = levels[level]; - - // make sure the level exists and if so set the map - // otherwise, we have finished the last level, there is no level - // after the last level - if (currentLevel !== undefined) { - setMap(currentLevel); - } else { - addText("you win!", { y: 4, color: color`0` }); - } - } -}); diff --git a/games/Mr.Man!.js b/games/Mr.Man!.js deleted file mode 100644 index 8ccf4dc32e..0000000000 --- a/games/Mr.Man!.js +++ /dev/null @@ -1,371 +0,0 @@ -//controls are I, J, K, L, and W for reset - -// define the sprites in our game - -const box = "b" -const goal = "g" -const wall = "w" -const MrMan = "p" -const player2 = "2" -const player3 = "3" -const player4 = "4" -const player5 = "5" -const player6 = "6" -const decorate = "d" -const trophie = "t" -const block = "l" -// assign bitmap art to each sprite -setLegend( - - [ box, bitmap` -8888888888888888 -8HHHHHHHHHHHHHHH -8H9999999999999H -8H9LLLLLLLLLLL9H -8H9L3333L5555L9H -8H9L3333L5555L9H -8H9L3333L5555L9H -8H9L3333L5555L9H -8H9LLLLLLLLLLL9H -8H9L4444L6666L9H -8H9L4444L6666L9H -8H9L4444L6666L9H -8H9L4444L6666L9H -8H9LLLLLLLLLLL9H -8H9999999999999H -8HHHHHHHHHHHHHHH`], - [ goal, bitmap` -.00000000000000. -.07777777777770. -.07777000077770. -.07777770077770. -.07777700077770. -.07777707777770. -.07777777777770. -.07777707777770. -.07777777777770. -.00000000000000. -.0L0L0L0L0L0LL0. -.00000000000000. -.0L0000000L0LL0. -.0L0LLLLL0L0LL0. -..000000000000.. -................`], - [ wall, bitmap` -..055555777770.. -..055557777770.. -..055555777770.. -..055557777770.. -..055555777770.. -..0595536747H0.. -..0903306000H0.. -..0900306040H0.. -..0909006040H0.. -..0909906000H0.. -..099999HHHHH0.. -..09999H9HHHH0.. -..099999HHHHH0.. -..0999HH8HHHH0.. -..09988888H8H0.. -..0988888888H0..`], - [ MrMan, bitmap` -................ -.....00000...... -....0CCCCC0..... -....0C0C0C0..... -....0CCCCC0..... -....0CCCCC0..... -....0C0C0C0..... -....0C000C0..... -....0CCCCC0..... -.C...00000...C.. -..0.0476190.0... -...00H383H00.... -....0916740..... -....0000000..... -.....0...0...... -.....00..00.....`], - [ player2, bitmap` -...000000000.... -..06666666660... -..06606660660... -..06666666660... -..06666666660... -..06606660660... -..03360006330... -6.03366666330.6. -0..000000000..0. -0...090D070...0. -0000990D0770000. -...0090D0700.... -..0440H030880... -.04440HH008880.. -..00000000000... -...0.......0....`], - [ player3, bitmap ` -................ -................ -...000000000.... -...0.......0.... -...0.0...0.0.... -...0.......0.... -...0..000..0.... -...0.......0.... -...000000000.... -.......0........ -..0000.0.0000... -.....00000...... -.......0........ -......000....... -.....00.00...... -....00...00.....`], - [ player4, bitmap ` -................ -......00000..... -...0000CCC00.... -...0330C0CC0.... -...0C3CCCCC0.... -...00C000330.... -....00CCCC00.... -.C...000000..C.. -.00..00660..00.. -..00.00660.00... -....00066000.... -......0000...... -......0.00...... -......0..CCCC... -......CCC....... -................`], - [ player5, bitmap ` -....00000000.... -...00......00... -...0.20.20..0... -...0.00.00..0... -...0...0....0... -...00......00... -....00000000.... -.......0........ -....00.0.00..... -......000....... -.......0........ -.......0........ -......000....... -.....0...0...... -...00.....00.... -..0.........0...`], - [ player6, bitmap ` -.....CCCCCC..... -....CCCCCCCC.... -...CCCCCCCCCC... -...CCC02C02CC... -...CCC00C00CC... -...CCCCCCCCCC... -...CCCC000CCC... -....CCCCCCCC.... -.C...CCCCCC...C. -CC44..4444..44CC -.C.4..4444..4.C. -...4444444444... -......5555...... -......5..5...... -......5..5...... -....CCC..CCC....`], - [ decorate, bitmap ` -..7.1.1.0...D... -....1..1.22.F... -.FHHF99FFFFFD... -.6F998..L.3LL0.. -...9H4.44.LLC8.. -0.D.46D69LL87F7. -055.366HHL684... -15F99H..HLL8LD4D -.1.D988.FHLDC.9. -.F188.4.7H3DD9.. -.F588L.8.HHH1... -.6.8...9.HH.H.44 -99994.59D.H8.4.. -..FL77CLHH84400. -..D.H..66.44...6 -..DCH..5.4......`], - [ trophie, bitmap ` -................ -......6666...... -...666FFFF666... -..66.66FF66.66.. -.66..666666..66. -.66..666666..66. -.66..6666F6..66. -.66..6666F6..66. -..66.6666F6.66.. -...666666F666... -....6666FF66.... -......6666...... -.......66....... -.......66....... -......6666...... -.....666666.....`], - [ block, bitmap ` -0000000000000000 -0222222222222220 -0222222222222220 -0222222222222220 -0222222222222220 -077444262332HHH0 -0722426663232H20 -0772426263232H20 -0272426663322H20 -0772426263232H20 -0222222222222220 -0222222222222220 -0222222222222220 -0222222222222220 -0222222222222220 -0000000000000000`] -); - -// create game levels -let level = 0; // this tracks the level we are on -const levels = [ - map` -............................... -..llll.lllll..l...llll..lllll.. -..l......l....l...l...l...l.... -..l......l...lll..l...l...l.... -..ll.....l...l.l..llll....l.... -....ll...l...lll..ll......l.... -.....l...l..ll.ll.l.l.....l.... -.....l...l..l...l.l..l....l.... -..llll...l..l...l.l...l...l.... -............................... -............................... -............................... -............pb.....g........... -............................... -............................... -............................... -...............................`, - map` -pw.g -.b.. -....`, - map` -w.pwg -.b... -..... -.g..b -w....`, - map` -pw.. -.b.. -...g -....`, - map` -pb.g -w.b. -g.b. -..g.`, - map` -....g -.g..b -..p.. -.b.b. -....g`, - map` -p.wg -b.w. -..b. -g...`, - map` -wwwwwwwwwtwdwwdt5wwwdw4 -g..bpww.wwdw.ww4tdw.wdw -wbwwwww.w.wd.wdt3ww.dw. -wwwdddw.w.dw.ww2tdw.wd. -w3wdtdwbw.wd.wdt6ww.dw. -wwwdtdwww.dw.ww5tdw.wd. -wwwdddw4w.wd.wdt4ww.dw. -wwwwwwwww.dwwww3tdwwwd. -w2wb...wwwwd2wdt2ww3dww`, - map` -23456dtlbw2 -23456dtlbw3 -23......bw4 -23......bw5 -wwwwwwwwwww -p.b.......g -wwwwwwwwwww -23456dtlbw6 -23456dtlbwd -23456dtlbwt -23456dtlbwl` - - ]; - - - -// set the map displayed to the current level -const currentLevel = levels[level]; -setMap(currentLevel); - -setSolids([ MrMan, box, wall ]); // other sprites cannot go inside of these sprites - -// allow certain sprites to push certain other sprites -setPushables({ - [MrMan]: [ box ], - [box]: [ box ] -}); - -// inputs for player movement control - - -onInput("k", () => { - getFirst(MrMan).y += 1; // positive y is downwards -}); - -onInput("l", () => { - getFirst(MrMan).x += 1; -}); - -onInput("i", () => { - getFirst(MrMan).y -= 1; -}); - -onInput("j", () => { - getFirst(MrMan).x -= 1; -}); -// input to reset level -onInput("w", () => { -const currentLevel = levels[level]; // get the original map of the level - - // make sure the level exists before we load it - if (currentLevel !== undefined) { - clearText(""); - setMap(currentLevel); - } -}); - -// these get run after every input -afterInput(() => { - // count the number of tiles with goals - const targetNumber = tilesWith(goal).length; - - // count the number of tiles with goals and boxes - const numberCovered = tilesWith(goal, box).length; - - // if the number of goals is the same as the number of goals covered - // all goals are covered and we can go to the next level - if (numberCovered === targetNumber) { - // increase the current level number - level = level + 1; - - const currentLevel = levels[level]; - - // make sure the level exists and if so set the map - // otherwise, we have finished the last level, there is no level - // after the last level - if (currentLevel !== undefined) { - setMap(currentLevel); - } else { - addText("you win!", { y: 4, color: color`0` }); - } - } -}); From 3f1b9bbd9dc76ee9606f649d6401981435526175 Mon Sep 17 00:00:00 2001 From: Graham Darcey Date: Fri, 4 Oct 2024 11:30:53 -0400 Subject: [PATCH 8/9] Rename the primary --- games/{Mister Man! (4).js => MisterMan.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename games/{Mister Man! (4).js => MisterMan.js} (100%) diff --git a/games/Mister Man! (4).js b/games/MisterMan.js similarity index 100% rename from games/Mister Man! (4).js rename to games/MisterMan.js From 7cd561ea4e42093566ce4742a1395da89577fd13 Mon Sep 17 00:00:00 2001 From: graham Date: Fri, 4 Oct 2024 11:32:19 -0400 Subject: [PATCH 9/9] Fixing metadata --- games/MisterMan.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/games/MisterMan.js b/games/MisterMan.js index 27c54caaca..cf5c079540 100644 --- a/games/MisterMan.js +++ b/games/MisterMan.js @@ -1,3 +1,9 @@ +/* +@author: waitwhat653 +@title: MisterMan +@tags: [] +@addedOn: 2024-10-04 +*/ //controls are I, J, K, L, and D for reset //define the sprites in our game