From 8e439ae655d462921ceaee0fdfcd1d6d5423eaad Mon Sep 17 00:00:00 2001 From: GodlyAngel1614 Date: Tue, 8 Oct 2024 23:28:11 -0500 Subject: [PATCH 01/13] Add files via upload Avoid the poodles and endermen, use WASD to move and your goal Is to get the box In the goal without being trapped by the poodle or the endermen! --- games/KittyPity.js | 550 ++++++++++++++++++++++++++++++++++++++++++++ games/KittyPity.png | Bin 0 -> 2125 bytes 2 files changed, 550 insertions(+) create mode 100644 games/KittyPity.js create mode 100644 games/KittyPity.png diff --git a/games/KittyPity.js b/games/KittyPity.js new file mode 100644 index 0000000000..cc26835bb1 --- /dev/null +++ b/games/KittyPity.js @@ -0,0 +1,550 @@ +/* +First time? Check out the tutorial game: +https://sprig.hackclub.com/gallery/getting_started + +@title: KittyPity +@author: +@tags: [] +@addedOn: 2024-00-00 +*/ + +// Sprites +const player = "p" +const Goal = "t" +const box = "B" +const Maze = "G" +const Enemy = "E" +const Poodle = "R" + +//Tunes And General + +const level3 = tune` +410.958904109589: B5^410.958904109589, +410.958904109589: B5^410.958904109589, +410.958904109589: B5^410.958904109589, +410.958904109589: E5~410.958904109589, +410.958904109589: F5~410.958904109589, +410.958904109589: G5~410.958904109589, +410.958904109589: F5~410.958904109589 + B5~410.958904109589, +410.958904109589: A5~410.958904109589 + C5^410.958904109589, +410.958904109589: G5~410.958904109589 + B4^410.958904109589, +410.958904109589: F5~410.958904109589 + B5~410.958904109589 + C5^410.958904109589 + A4^410.958904109589, +410.958904109589: G5-410.958904109589, +410.958904109589: A5-410.958904109589 + B4^410.958904109589, +410.958904109589: G5-410.958904109589 + C5^410.958904109589 + A4^410.958904109589, +410.958904109589: E5~410.958904109589 + B4^410.958904109589, +410.958904109589: D5~410.958904109589 + A5-410.958904109589, +410.958904109589: E5~410.958904109589 + C5^410.958904109589, +410.958904109589: F5-410.958904109589 + B4^410.958904109589, +410.958904109589: G5-410.958904109589 + F5^410.958904109589 + C5^410.958904109589 + A4^410.958904109589, +410.958904109589: F5-410.958904109589 + A5~410.958904109589, +410.958904109589: E5-410.958904109589 + B5-410.958904109589 + G5-410.958904109589, +410.958904109589: C5-410.958904109589 + A5~410.958904109589, +410.958904109589: E5~410.958904109589, +410.958904109589: F5~410.958904109589 + A4^410.958904109589, +410.958904109589: G5~410.958904109589 + B4^410.958904109589, +410.958904109589: E5~410.958904109589 + A4^410.958904109589 + C5^410.958904109589, +410.958904109589: E5-410.958904109589 + B4^410.958904109589, +410.958904109589: D5-410.958904109589 + A4^410.958904109589 + F4-410.958904109589, +410.958904109589: C5-410.958904109589 + F5~410.958904109589 + D5^410.958904109589 + G4-410.958904109589 + E4-410.958904109589, +410.958904109589: D5-410.958904109589 + B4^410.958904109589 + A5~410.958904109589 + F4-410.958904109589, +410.958904109589: G5-410.958904109589 + C5^410.958904109589 + A4^410.958904109589 + B5^410.958904109589 + E4~410.958904109589, +410.958904109589: B4^410.958904109589 + G5~410.958904109589 + B5~410.958904109589, +410.958904109589: A5^410.958904109589` +const Undo = tune` +160.42780748663102, +160.42780748663102: D4^160.42780748663102 + A5~160.42780748663102, +160.42780748663102: E4^160.42780748663102 + G5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, +160.42780748663102: F4^160.42780748663102 + F5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, +160.42780748663102: G4^160.42780748663102 + E5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, +160.42780748663102: A4^160.42780748663102 + D5~160.42780748663102 + A5-160.42780748663102, +160.42780748663102: B4^160.42780748663102 + C5~160.42780748663102, +160.42780748663102: A4-160.42780748663102 + D5/160.42780748663102 + D4~160.42780748663102, +160.42780748663102: G4-160.42780748663102 + E5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, +160.42780748663102: F4-160.42780748663102 + F5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, +160.42780748663102: E4-160.42780748663102 + G5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, +160.42780748663102: D4-160.42780748663102 + A5/160.42780748663102, +160.42780748663102: A5^160.42780748663102 + G5~160.42780748663102 + F5~160.42780748663102 + E5~160.42780748663102 + C5~160.42780748663102, +160.42780748663102: G5^160.42780748663102 + A5-160.42780748663102 + E5~160.42780748663102 + D5~160.42780748663102 + C5~160.42780748663102, +160.42780748663102: F5^160.42780748663102 + G5-160.42780748663102 + A4^160.42780748663102 + B4^160.42780748663102 + G4^160.42780748663102, +160.42780748663102: E5^160.42780748663102 + F5-160.42780748663102 + F4^160.42780748663102 + D4^160.42780748663102, +160.42780748663102: D5^160.42780748663102 + E5-160.42780748663102 + F4^160.42780748663102 + E4^160.42780748663102 + D4^160.42780748663102, +160.42780748663102: C5^160.42780748663102 + D5-160.42780748663102 + A4-160.42780748663102 + B4-160.42780748663102, +160.42780748663102: A4-160.42780748663102 + C5-160.42780748663102 + G4~160.42780748663102 + F4~160.42780748663102 + B5~160.42780748663102, +160.42780748663102: B4~160.42780748663102 + C5~160.42780748663102 + A4~160.42780748663102, +160.42780748663102: D5^160.42780748663102 + C5-160.42780748663102, +160.42780748663102: E5^160.42780748663102 + B4-160.42780748663102 + E4-160.42780748663102, +160.42780748663102: F5^160.42780748663102 + A4-160.42780748663102, +160.42780748663102: E5^160.42780748663102 + A4-160.42780748663102 + D4-160.42780748663102, +160.42780748663102: D5^160.42780748663102 + B4-160.42780748663102, +160.42780748663102: C5^160.42780748663102 + B4-160.42780748663102 + B5~160.42780748663102 + C4~160.42780748663102, +160.42780748663102: D5^160.42780748663102 + A4-160.42780748663102, +160.42780748663102: E5^160.42780748663102 + E4-160.42780748663102 + B4-160.42780748663102, +160.42780748663102: F5^160.42780748663102 + B4-160.42780748663102 + C4~160.42780748663102 + G4~160.42780748663102, +160.42780748663102: G5^160.42780748663102 + E4-160.42780748663102 + B4-160.42780748663102 + A4-160.42780748663102, +320.85561497326205` +const BattleRoyale = tune` +500: F4~500 + E5~500, +500: D4^500 + G4~500 + E5-500 + D5-500, +500: E4^500 + A4~500, +500: F4^500 + G5/500, +500: G4^500 + A5/500 + F5/500, +500: A4^500 + G5/500, +500: B4^500 + D4-500, +500: C5^500 + E4-500 + C4-500 + E5-500, +500: B4^500 + D4-500 + A5~500 + F5-500 + D5-500, +500: A4^500 + B5~500 + G5~500 + E5-500, +500: G4^500 + A5~500, +500: F4^500 + E5/500, +500: E4^500 + F5/500 + D5/500, +500: D4^500 + E5/500 + G5^500, +500: A4-500 + A5^500 + F5^500, +500: B4-500 + G4-500 + D5~500 + G5^500, +500: A4-500 + E5~500 + C5~500, +500: A5-500 + D5~500, +500: D4~500 + B5-500 + G5-500, +500: E4~500 + C4~500 + A5-500, +500: D4~500, +5500` +const Knockout = tune` +160.42780748663102, +160.42780748663102: D4^160.42780748663102 + A5~160.42780748663102, +160.42780748663102: E4^160.42780748663102 + G5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, +160.42780748663102: F4^160.42780748663102 + F5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, +160.42780748663102: G4^160.42780748663102 + E5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, +160.42780748663102: A4^160.42780748663102 + D5~160.42780748663102 + A5-160.42780748663102, +160.42780748663102: B4^160.42780748663102 + C5~160.42780748663102, +160.42780748663102: A4-160.42780748663102 + D5/160.42780748663102 + D4~160.42780748663102, +160.42780748663102: G4-160.42780748663102 + E5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, +160.42780748663102: F4-160.42780748663102 + F5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, +160.42780748663102: E4-160.42780748663102 + G5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, +160.42780748663102: D4-160.42780748663102 + A5/160.42780748663102, +160.42780748663102: A5^160.42780748663102 + G5~160.42780748663102 + F5~160.42780748663102 + E5~160.42780748663102 + C5~160.42780748663102, +160.42780748663102: G5^160.42780748663102 + A5-160.42780748663102 + E5~160.42780748663102 + D5~160.42780748663102 + C5~160.42780748663102, +160.42780748663102: F5^160.42780748663102 + G5-160.42780748663102 + A4^160.42780748663102 + B4^160.42780748663102 + G4^160.42780748663102, +160.42780748663102: E5^160.42780748663102 + F5-160.42780748663102 + F4^160.42780748663102 + D4^160.42780748663102, +160.42780748663102: D5^160.42780748663102 + E5-160.42780748663102 + F4^160.42780748663102 + E4^160.42780748663102 + D4^160.42780748663102, +160.42780748663102: C5^160.42780748663102 + D5-160.42780748663102 + A4-160.42780748663102 + B4-160.42780748663102, +160.42780748663102: A4-160.42780748663102 + C5-160.42780748663102 + G4~160.42780748663102 + F4~160.42780748663102 + B5~160.42780748663102, +160.42780748663102: B4~160.42780748663102 + C5~160.42780748663102 + A4~160.42780748663102, +160.42780748663102: D5^160.42780748663102 + C5-160.42780748663102, +160.42780748663102: E5^160.42780748663102 + B4-160.42780748663102 + E4-160.42780748663102, +160.42780748663102: F5^160.42780748663102 + A4-160.42780748663102, +160.42780748663102: E5^160.42780748663102 + A4-160.42780748663102 + D4-160.42780748663102, +160.42780748663102: D5^160.42780748663102 + B4-160.42780748663102, +160.42780748663102: C5^160.42780748663102 + B4-160.42780748663102 + B5~160.42780748663102 + C4~160.42780748663102, +160.42780748663102: D5^160.42780748663102 + A4-160.42780748663102, +160.42780748663102: E5^160.42780748663102 + E4-160.42780748663102 + B4-160.42780748663102, +160.42780748663102: F5^160.42780748663102 + B4-160.42780748663102 + C4~160.42780748663102 + G4~160.42780748663102, +160.42780748663102: G5^160.42780748663102 + E4-160.42780748663102 + B4-160.42780748663102 + A4-160.42780748663102, +320.85561497326205` +const Wall = 'W' + +// Walks + +const step1 = tune` +192.30769230769232: C4~192.30769230769232, +5961.538461538462` +const step2 = tune` +192.30769230769232: B5~192.30769230769232, +5961.538461538462` +const step3 = tune` +200: B5^200, +6200` +const step4 = tune` +185.1851851851852: B5^185.1851851851852, +5740.740740740741` + +//Level 3 +const Sun = "s" +const nighttime = "n" +const grass = "g" + + + +// ImportantVariable +var current = 0 + +setLegend( + [ player, bitmap` +................ +................ +....LL000000.... +....LL064640.... +....LL064640.... +....LL066660.... +....LL000000.... +.....L00660..... +.....L00660..... +.....L00000..... +.....LLLLL...... +................ +................ +................ +................ +................`], + [box, bitmap` +................ +................ +................ +........000..... +.....000000..... +....00000000.... +....00003030.... +....00003030.... +....00003000.... +....00003000.... +....00000000.... +....00000000.... +................ +................ +................ +................`], + [Goal, bitmap` +................ +...00000........ +...93390........ +...93390........ +...90090........ +...00000........ +...00000........ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................`], + [Wall, bitmap` +0007077070000007 +0000000000000777 +0000070000007700 +0000070077770707 +0000077770000077 +0000000000000007 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000777000 +0000007770777000 +0000777770777000 +0000077770000000 +0000000000000000 +0000000000000000 +0000000000000000`], + + [Sun, bitmap` +..........000000 +..........062260 +..........062260 +..........001100 +............13.. +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................`], + [nighttime, bitmap` +0555555555555577 +0555555555555555 +0577757775555757 +0777777777777777 +0555555555555555 +0555555555555555 +0777555555555555 +0777777777777777 +0777777777777777 +0555555555555555 +0775777777777777 +0777777777755557 +0777777555555555 +0555557555555555 +0777755577777777 +0555555555555555`], + [grass, bitmap` +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +FFDDFDDDFFDDDFFF +FFFFFFFFFDDFFFDF`], + [Enemy, bitmap` +................ +................ +................ +................ +.....000000..... +.....0L2L00..... +.....0L2L00..... +...0002220000... +...0222222200... +...0222222200... +...0202220200... +...0202220200... +...0000000000... +.....020200..... +.....020200..... +.....000000.....`], + [Maze, bitmap` +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000`], + [Poodle, bitmap` +.........2...... +........222.222. +........281.182. +........2811182. +........2112112. +........2112112. +........2182812. +........2218112. +.......LL222222. +......L3L030302. +.....L33L030302. +.....LLLL000002. +...............2 +................ +................ +................`], +); + +let level = 0; + +const levels = [ + map` +.... +.... +....`, + map` +GGGGG +G.t.R +G.B.G +G...G +GGpGG`, + map` +WWWWW +BBp.W +tB..W +BWWWW`, + map` +nnns +ngBp +nnng`, + map` +GG...t +G..B.. +p..... +.....G +EG.GEG +GGGGGG`, + map` +GGGGGG +GR..tG +G...BG +G....G +GR..pG +GGGGGG`, + map` +GGGGGG +GG...G +G.G..G +G..G.G +G...GG +GGGGGG`, + ]; + +// Main Menu + + addText("Press K to play!", {x:4, y:4, color: color`1`}); + +//// + +const currentLevel = levels[level]; +setMap(currentLevel); + +setSolids([ player, box, nighttime, Sun, Wall, Maze, Enemy]); + +setPushables({ + [ player ]: [box] +}); + +function StartGame() { +if (level == 0 ) { + playTune(level3) + } + + else { + return false; + } +} + +function EnemyMove() { + let playerSprite = getFirst(player); + let Enemies = getAll(Enemy); + + Enemies.forEach(Enemy => { + // Calculate distance between enemy and player + let dx = playerSprite.x - Enemy.x; + let dy = playerSprite.y - Enemy.y; + + // Move towards player in the direction with the highest change + if (Math.abs(dx) > Math.abs(dy)) { + // Move horizontally + Enemy.x += Math.sign(dx); + } else { + // Move vertically + Enemy.y += Math.sign(dy); + } + }); +} + +function PoodleMove() { + let playerSprite = getFirst(player); + let Poodles = getAll(Poodle); + + Poodles.forEach(Poodle => { + // Calculate distance between enemy and player + let dx = playerSprite.x - Poodle.x; + let dy = playerSprite.y - Poodle.y; + + // Move towards player in the direction with the highest change + if (Math.abs(dx) > Math.abs(dy)) { + // Move horizontally + Poodle.x += Math.sign(dx); + } else { + // Move vertically + Poodle.y += Math.sign(dy); + } + if (playerSprite.y - Poodle.y == 0 && playerSprite.x - Poodle.x == 0) { + addText("Your dead!", {x:4, y:4, color: color`7`}); + + setMap(currentLevel); + } + }); +} + +// Main Menu + + setTimeout(() => { + onInput("k", () => { + StartGame() + }); + clearText() + }, 1000) +//// + +onInput("s", () => { + getFirst(player).y +=1 +}); + +onInput("w", () => { + getFirst(player).y -= 1 + playTune(step2, 1) +}); + +onInput("a", () => { + getFirst(player).x -= 1 + +}); + +onInput("d", () => { + getFirst(player).x +=1 + playTune(step4, 1) +}); + +onInput("j", () => { + const currentLevel = levels[level]; + + if (currentLevel !== undefined) { + clearText(""); + setMap(currentLevel); + } +}); + + + +afterInput(() => { + +const targetfound = tilesWith(Goal).length; +const NumberCovered = tilesWith(Goal, box).length; +const grassfall = tilesWith(box).length; +const Covered = tilesWith(box, grass).length; +const currentLevel = levels[level]; + + let iterationCount = 0; + const maxIte = 10; + const max2 = 2; + + // Starting the game! + + while (level == 5 && iterationCount < maxIte) { + // do stuff + EnemyMove(); + + iterationCount++; + } + + while (level <= 6 && iterationCount < max2) { + PoodleMove(); + iterationCount++; + + } + + + + if (NumberCovered == targetfound) { + level += 1 + current += 1; + + + if (currentLevel !== undefined) { + setMap(currentLevel); + } + + if (level == 8) { + addText("Thats the end!", {x:4, y:4, color: color`3`}); + } + + } + + + + + + setTimeout(() => { + clearText(); + }, 3000) + +}); \ No newline at end of file diff --git a/games/KittyPity.png b/games/KittyPity.png new file mode 100644 index 0000000000000000000000000000000000000000..2aceebe3c1b7537d1aefbf5035bdb95e1f1e865c GIT binary patch literal 2125 zcmeAS@N?(olHy`uVBq!ia0y~yV4MoXt{iMY5tY;e5g^4_9OUlAuanCF{C2y?Op$DnNpeKAAJrk(_qwR z{b;E1gJVzUmgV2B*tNzK2{_3)pKv^(>hI`Z71ZVLv~?eFltyY|NK z-uM4^Z*&*q4Gpj{3>|`S1Ki#|JS{%=@GGcsZXqDagpyOsAEy`3O|6&7@8DuET*Tzi zvw}fDS&QKagxllyvr^+V&s`Km7=O1v#uu7NJ; zJqQCrzWj4Wd7ow}B1JL6T@qVgzq^xFw>DcW_WM>t0eB=rl7_wfzFe`= z+6Q6R|1H|~-f;FpA!G%xNMGQ5{qo1y-@tfu1V-zbYpzS*DlW>MrC=?20b}rQaPkR;&AJODEs9mbb5sTYvA{=l=WGSNANu zS9QuD_qFcoFUQ|~tSjAPVY8x76>i$4g0IhyfByNWU;p{#t?_&e*i#tL%90;%o9{or zeC1C3AE^U3I$`P1mm_ws7O(gK=%l7xrHm`a1-({0!_o?#%GkFi(unfi; zqk>cUa{bRwXLc}$#yBX7uP%O2t-k!~v8NX!OW&+6ogY*G=S$_@T{A=Hooct!?phRg z@a!9mNHyMdI{rYmUj0VB>H8V5DqSv_$#a5{k^32KThYf-KpJs zrhQEKUbi>u?56kY`O6RWp2QO0Owo(>JTaZU`%=w{jh3ggs^8{Fuwl<_f}$^G+TF3* z)AQ-&kDEHHf6fYxJN^wNmBSJ-u;^>#)wGXzwe8uqlDm9&?(EM4W(m`6li~g^Si9|X z?o*T4?~T#1zq@bkJDzhx4jyR8={h^x?#PZG3dz^)4x{ADI~x~iu$enw`DVAh_S)5N zPkvh+Ho#gIqGS%NRv;Ce1FCp)X`p6TQUIg?P4BpM@A)?V^7Auc84J09A5eE9>KP)P zAp)#mGk4ywwp?q*kRU4F&i?fj&{vM1jYSzErUMD5va)~7D>=>-+HShK7T5$}@O1Ta JS?83{1OQf^9JBxc literal 0 HcmV?d00001 From ae0bec5ff1bbf65fc3e3b2d56bc0bf0cdf794032 Mon Sep 17 00:00:00 2001 From: GodlyAngel1614 Date: Tue, 8 Oct 2024 23:46:37 -0500 Subject: [PATCH 02/13] KittyPity.js --- games/KittyPity.js | 52 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/games/KittyPity.js b/games/KittyPity.js index cc26835bb1..d3170bedd6 100644 --- a/games/KittyPity.js +++ b/games/KittyPity.js @@ -16,6 +16,9 @@ const Maze = "G" const Enemy = "E" const Poodle = "R" + + + //Tunes And General const level3 = tune` @@ -455,6 +458,23 @@ function PoodleMove() { }); } +function resetLevel() { + // Clear any text on the screen + clearText(); + + // Reset the level variable to the initial level (e.g., level 0) + level = 0; + + // Get the current level map based on the reset level + const currentLevel = levels[level]; + + // Reset the game map to the initial level map + setMap(currentLevel); + + // Additional reset logic for any other game elements if needed +} + + // Main Menu setTimeout(() => { @@ -484,14 +504,9 @@ onInput("d", () => { playTune(step4, 1) }); -onInput("j", () => { - const currentLevel = levels[level]; - - if (currentLevel !== undefined) { - clearText(""); - setMap(currentLevel); - } -}); +onInput("j", resetLevel); + + @@ -506,7 +521,9 @@ const currentLevel = levels[level]; let iterationCount = 0; const maxIte = 10; const max2 = 2; - + let LevelText = 0; + const LevelTextNumber = LevelText.toString(); + // Starting the game! while (level == 5 && iterationCount < maxIte) { @@ -522,10 +539,16 @@ const currentLevel = levels[level]; } + setTimeout(() => { + clearText(); + }, 3000) + + if (NumberCovered == targetfound) { - level += 1 + level += 1 ; + LevelText += 1; current += 1; @@ -542,9 +565,6 @@ const currentLevel = levels[level]; - - setTimeout(() => { - clearText(); - }, 3000) - -}); \ No newline at end of file + + +}); From ee3ec39545c96fcc5da1dac0f83fb9f61c9a077a Mon Sep 17 00:00:00 2001 From: Alex Park Date: Thu, 10 Oct 2024 16:30:54 -0500 Subject: [PATCH 03/13] Fix metadata --- games/KittyPity.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/games/KittyPity.js b/games/KittyPity.js index d3170bedd6..9072ff0da7 100644 --- a/games/KittyPity.js +++ b/games/KittyPity.js @@ -3,9 +3,9 @@ First time? Check out the tutorial game: https://sprig.hackclub.com/gallery/getting_started @title: KittyPity -@author: -@tags: [] -@addedOn: 2024-00-00 +@author: GodlyAngel1613 +@tags: ['puzzle', 'music', 'strategy'] +@addedOn: 2024-10-10 */ // Sprites From a756e9ef4ca5ebfab873ca587c62ffb04a801c4f Mon Sep 17 00:00:00 2001 From: Alex Park Date: Thu, 10 Oct 2024 16:32:17 -0500 Subject: [PATCH 04/13] Move image to correct place --- games/{ => img}/KittyPity.png | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename games/{ => img}/KittyPity.png (100%) diff --git a/games/KittyPity.png b/games/img/KittyPity.png similarity index 100% rename from games/KittyPity.png rename to games/img/KittyPity.png From 4679ca192fff40fb39770f2ce95e80c7fe401540 Mon Sep 17 00:00:00 2001 From: GodlyAngel1614 Date: Thu, 10 Oct 2024 20:06:09 -0500 Subject: [PATCH 05/13] Update KittyPity.js --- games/KittyPity.js | 245 +++++++++++++++++++++++---------------------- 1 file changed, 127 insertions(+), 118 deletions(-) diff --git a/games/KittyPity.js b/games/KittyPity.js index 9072ff0da7..4dc1b13133 100644 --- a/games/KittyPity.js +++ b/games/KittyPity.js @@ -3,9 +3,9 @@ First time? Check out the tutorial game: https://sprig.hackclub.com/gallery/getting_started @title: KittyPity -@author: GodlyAngel1613 -@tags: ['puzzle', 'music', 'strategy'] -@addedOn: 2024-10-10 +@author: +@tags: [] +@addedOn: 2024-00-00 */ // Sprites @@ -28,10 +28,10 @@ const level3 = tune` 410.958904109589: E5~410.958904109589, 410.958904109589: F5~410.958904109589, 410.958904109589: G5~410.958904109589, -410.958904109589: F5~410.958904109589 + B5~410.958904109589, +410.958904109589: F5~410.9589041095.. . B5.4.0......4109589, 410.958904109589: A5~410.958904109589 + C5^410.958904109589, -410.958904109589: G5~410.958904109589 + B4^410.958904109589, -410.958904109589: F5~410.958904109589 + B5~410.958904109589 + C5^410.958904109589 + A4^410.958904109589, +410.958904109589: G5~410.958904109589 + B4^410..58904109589, +410.958904109589: F5~410.958904109589 + B5~410..58904109589 + C5^410.958904109589 + A4^410.958904109589, 410.958904109589: G5-410.958904109589, 410.958904109589: A5-410.958904109589 + B4^410.958904109589, 410.958904109589: G5-410.958904109589 + C5^410.958904109589 + A4^410.958904109589, @@ -163,13 +163,10 @@ const Sun = "s" const nighttime = "n" const grass = "g" - - // ImportantVariable -var current = 0 setLegend( - [ player, bitmap` + [player, bitmap` ................ ................ ....LL000000.... @@ -307,7 +304,7 @@ FFFFFFFFFDDFFFDF`], .....020200..... .....020200..... .....000000.....`], - [Maze, bitmap` + [Maze, bitmap` 0000000000000000 0000000000000000 0000000000000000 @@ -324,7 +321,7 @@ FFFFFFFFFDDFFFDF`], 0000000000000000 0000000000000000 0000000000000000`], - [Poodle, bitmap` + [Poodle, bitmap` .........2...... ........222.222. ........281.182. @@ -346,147 +343,152 @@ FFFFFFFFFDDFFFDF`], let level = 0; const levels = [ - map` -.... -.... -....`, - map` + map` +........ +........ +........ +........ +........ +........ +........`, + map` GGGGG G.t.R G.B.G G...G GGpGG`, - map` + map` WWWWW BBp.W tB..W BWWWW`, - map` + map` nnns ngBp nnng`, - map` + map` GG...t G..B.. p..... .....G EG.GEG GGGGGG`, - map` + map` GGGGGG GR..tG G...BG G....G GR..pG GGGGGG`, - map` + map` GGGGGG GG...G G.G..G G..G.G G...GG GGGGGG`, - ]; +]; // Main Menu - addText("Press K to play!", {x:4, y:4, color: color`1`}); +addText("Press K to start", { x: 2, y: 4, color: color`1` }); //// const currentLevel = levels[level]; setMap(currentLevel); -setSolids([ player, box, nighttime, Sun, Wall, Maze, Enemy]); +setSolids([player, box, nighttime, Sun, Wall, Maze, Enemy]); setPushables({ - [ player ]: [box] + [player]: [box] }); function StartGame() { -if (level == 0 ) { - playTune(level3) - } - - else { + if (level == 0) { + playTune(level3) + } else { return false; } } function EnemyMove() { - let playerSprite = getFirst(player); - let Enemies = getAll(Enemy); - - Enemies.forEach(Enemy => { - // Calculate distance between enemy and player - let dx = playerSprite.x - Enemy.x; - let dy = playerSprite.y - Enemy.y; - - // Move towards player in the direction with the highest change - if (Math.abs(dx) > Math.abs(dy)) { - // Move horizontally - Enemy.x += Math.sign(dx); - } else { - // Move vertically - Enemy.y += Math.sign(dy); - } - }); + let playerSprite = getFirst(player); + let Enemies = getAll(Enemy); + + Enemies.forEach(Enemy => { + // Calculate distance between enemy and player + let dx = playerSprite.x - Enemy.x; + let dy = playerSprite.y - Enemy.y; + + // Move towards player in the direction with the highest change + if (Math.abs(dx) > Math.abs(dy)) { + // Move horizontally + Enemy.x += Math.sign(dx); + } else { + // Move vertically + Enemy.y += Math.sign(dy); + } + }); } function PoodleMove() { - let playerSprite = getFirst(player); - let Poodles = getAll(Poodle); - - Poodles.forEach(Poodle => { - // Calculate distance between enemy and player - let dx = playerSprite.x - Poodle.x; - let dy = playerSprite.y - Poodle.y; - - // Move towards player in the direction with the highest change - if (Math.abs(dx) > Math.abs(dy)) { - // Move horizontally - Poodle.x += Math.sign(dx); - } else { - // Move vertically - Poodle.y += Math.sign(dy); - } - if (playerSprite.y - Poodle.y == 0 && playerSprite.x - Poodle.x == 0) { - addText("Your dead!", {x:4, y:4, color: color`7`}); + let playerSprite = getFirst(player); + let Poodles = getAll(Poodle); + + Poodles.forEach(Poodle => { + // Calculate distance between enemy and player + let dx = playerSprite.x - Poodle.x; + let dy = playerSprite.y - Poodle.y; + + // Move towards player in the direction with the highest change + if (Math.abs(dx) > Math.abs(dy)) { + // Move horizontally + Poodle.x += Math.sign(dx); + } else { + // Move vertically + Poodle.y += Math.sign(dy); + } + if (playerSprite.y - Poodle.y == 0 && playerSprite.x - Poodle.x == 0) { - setMap(currentLevel); + + setTimeout(() => { + if (level < 7) { + addText("Your dead!", { x: 4, y: 4, color: color`7` }); } - }); + }, 2000) + + clearText() + + setMap(currentLevel); + } + }); } function resetLevel() { - // Clear any text on the screen - clearText(); - - // Reset the level variable to the initial level (e.g., level 0) - level = 0; - - // Get the current level map based on the reset level - const currentLevel = levels[level]; - - // Reset the game map to the initial level map - setMap(currentLevel); - - // Additional reset logic for any other game elements if needed + // Clear any text on the screen + clearText(); + + // Reset the level variable to the initial level (e.g., level 0) + level = 0; + + // Get the current level map based on the reset level + const currentLevel = levels[level]; + + // Reset the game map to the initial level map + setMap(currentLevel); + } +let LevelTextNumber = level.toString(); // the int turned Into a string -// Main Menu +function LevelSystem() { + addText(LevelTextNumber, { x: 1, y: 1, color: color`6` }); +} - setTimeout(() => { - onInput("k", () => { - StartGame() - }); - clearText() - }, 1000) -//// onInput("s", () => { - getFirst(player).y +=1 + getFirst(player).y += 1 }); onInput("w", () => { @@ -496,72 +498,79 @@ onInput("w", () => { onInput("a", () => { getFirst(player).x -= 1 - + }); onInput("d", () => { - getFirst(player).x +=1 + getAll(player).x += 1 playTune(step4, 1) }); +setTimeout(() => { + onInput("k", () => { + StartGame() + }); + clearText() +}, 200) + onInput("j", resetLevel); - + afterInput(() => { - -const targetfound = tilesWith(Goal).length; -const NumberCovered = tilesWith(Goal, box).length; -const grassfall = tilesWith(box).length; -const Covered = tilesWith(box, grass).length; -const currentLevel = levels[level]; + + const targetfound = tilesWith(Goal).length; + const NumberCovered = tilesWith(Goal, box).length; + const grassfall = tilesWith(box).length; + const Covered = tilesWith(box, grass).length; + const currentLevel = levels[level]; let iterationCount = 0; const maxIte = 10; const max2 = 2; - let LevelText = 0; - const LevelTextNumber = LevelText.toString(); + LevelSystem(); +LevelTextNumber = `${level}`; + + console.log(LevelTextNumber) // Starting the game! - + while (level == 5 && iterationCount < maxIte) { - // do stuff + // do stuff EnemyMove(); iterationCount++; - } + } while (level <= 6 && iterationCount < max2) { PoodleMove(); iterationCount++; - - } - - setTimeout(() => { - clearText(); - }, 3000) - + } - if (NumberCovered == targetfound) { - level += 1 ; - LevelText += 1; - current += 1; + level += 1; + if (currentLevel !== undefined) { setMap(currentLevel); } - if (level == 8) { - addText("Thats the end!", {x:4, y:4, color: color`3`}); + if (level == 7) { + setTimeout(() => { + addText("Thats the end!", { x: 4, y: 4, color: color`3` }); + }, 1000) + } - + } + setTimeout(() => {}, 2500) + + clearText(); From ff077c499921212709efa9dc36880f1e168b4183 Mon Sep 17 00:00:00 2001 From: GodlyAngel1614 Date: Fri, 11 Oct 2024 20:35:14 -0500 Subject: [PATCH 06/13] Update KittyPity.js --- games/KittyPity.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/games/KittyPity.js b/games/KittyPity.js index 4dc1b13133..b0f756f84e 100644 --- a/games/KittyPity.js +++ b/games/KittyPity.js @@ -574,6 +574,3 @@ LevelTextNumber = `${level}`; - - -}); From e56efd0d346cd47baef86fa87ff117633a042c7a Mon Sep 17 00:00:00 2001 From: GodlyAngel1614 Date: Fri, 11 Oct 2024 20:38:08 -0500 Subject: [PATCH 07/13] KityPity --- games/KittyPity.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/games/KittyPity.js b/games/KittyPity.js index b0f756f84e..25a13688ad 100644 --- a/games/KittyPity.js +++ b/games/KittyPity.js @@ -574,3 +574,6 @@ LevelTextNumber = `${level}`; + + +}); \ No newline at end of file From b9620507069ed3ce769a7b3b72a891cc070e8312 Mon Sep 17 00:00:00 2001 From: GodlyAngel1614 Date: Fri, 11 Oct 2024 20:45:15 -0500 Subject: [PATCH 08/13] Update KittyPity.js --- games/KittyPity.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/games/KittyPity.js b/games/KittyPity.js index 25a13688ad..e6644098f2 100644 --- a/games/KittyPity.js +++ b/games/KittyPity.js @@ -576,4 +576,5 @@ LevelTextNumber = `${level}`; -}); \ No newline at end of file + +}); From 4074ea7da31560e579e24c58545e5759a7ce44f5 Mon Sep 17 00:00:00 2001 From: GodlyAngel1614 Date: Fri, 11 Oct 2024 20:48:27 -0500 Subject: [PATCH 09/13] Update KittyPity.js --- games/KittyPity.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/games/KittyPity.js b/games/KittyPity.js index e6644098f2..b67c44f39b 100644 --- a/games/KittyPity.js +++ b/games/KittyPity.js @@ -1,4 +1,5 @@ /* +/* First time? Check out the tutorial game: https://sprig.hackclub.com/gallery/getting_started @@ -502,7 +503,7 @@ onInput("a", () => { }); onInput("d", () => { - getAll(player).x += 1 + getFirst(player).x += 1 playTune(step4, 1) }); @@ -530,11 +531,6 @@ afterInput(() => { let iterationCount = 0; const maxIte = 10; const max2 = 2; - - LevelSystem(); -LevelTextNumber = `${level}`; - - console.log(LevelTextNumber) // Starting the game! while (level == 5 && iterationCount < maxIte) { @@ -571,10 +567,4 @@ LevelTextNumber = `${level}`; setTimeout(() => {}, 2500) clearText(); - - - - - - }); From 3fd6bc43878e41ee0cfc5008ead6b8ab88187bc4 Mon Sep 17 00:00:00 2001 From: GodlyAngel1614 Date: Mon, 14 Oct 2024 18:13:17 -0500 Subject: [PATCH 10/13] Delete games/KittyPity.js --- games/KittyPity.js | 570 --------------------------------------------- 1 file changed, 570 deletions(-) delete mode 100644 games/KittyPity.js diff --git a/games/KittyPity.js b/games/KittyPity.js deleted file mode 100644 index b67c44f39b..0000000000 --- a/games/KittyPity.js +++ /dev/null @@ -1,570 +0,0 @@ -/* -/* -First time? Check out the tutorial game: -https://sprig.hackclub.com/gallery/getting_started - -@title: KittyPity -@author: -@tags: [] -@addedOn: 2024-00-00 -*/ - -// Sprites -const player = "p" -const Goal = "t" -const box = "B" -const Maze = "G" -const Enemy = "E" -const Poodle = "R" - - - - -//Tunes And General - -const level3 = tune` -410.958904109589: B5^410.958904109589, -410.958904109589: B5^410.958904109589, -410.958904109589: B5^410.958904109589, -410.958904109589: E5~410.958904109589, -410.958904109589: F5~410.958904109589, -410.958904109589: G5~410.958904109589, -410.958904109589: F5~410.9589041095.. . B5.4.0......4109589, -410.958904109589: A5~410.958904109589 + C5^410.958904109589, -410.958904109589: G5~410.958904109589 + B4^410..58904109589, -410.958904109589: F5~410.958904109589 + B5~410..58904109589 + C5^410.958904109589 + A4^410.958904109589, -410.958904109589: G5-410.958904109589, -410.958904109589: A5-410.958904109589 + B4^410.958904109589, -410.958904109589: G5-410.958904109589 + C5^410.958904109589 + A4^410.958904109589, -410.958904109589: E5~410.958904109589 + B4^410.958904109589, -410.958904109589: D5~410.958904109589 + A5-410.958904109589, -410.958904109589: E5~410.958904109589 + C5^410.958904109589, -410.958904109589: F5-410.958904109589 + B4^410.958904109589, -410.958904109589: G5-410.958904109589 + F5^410.958904109589 + C5^410.958904109589 + A4^410.958904109589, -410.958904109589: F5-410.958904109589 + A5~410.958904109589, -410.958904109589: E5-410.958904109589 + B5-410.958904109589 + G5-410.958904109589, -410.958904109589: C5-410.958904109589 + A5~410.958904109589, -410.958904109589: E5~410.958904109589, -410.958904109589: F5~410.958904109589 + A4^410.958904109589, -410.958904109589: G5~410.958904109589 + B4^410.958904109589, -410.958904109589: E5~410.958904109589 + A4^410.958904109589 + C5^410.958904109589, -410.958904109589: E5-410.958904109589 + B4^410.958904109589, -410.958904109589: D5-410.958904109589 + A4^410.958904109589 + F4-410.958904109589, -410.958904109589: C5-410.958904109589 + F5~410.958904109589 + D5^410.958904109589 + G4-410.958904109589 + E4-410.958904109589, -410.958904109589: D5-410.958904109589 + B4^410.958904109589 + A5~410.958904109589 + F4-410.958904109589, -410.958904109589: G5-410.958904109589 + C5^410.958904109589 + A4^410.958904109589 + B5^410.958904109589 + E4~410.958904109589, -410.958904109589: B4^410.958904109589 + G5~410.958904109589 + B5~410.958904109589, -410.958904109589: A5^410.958904109589` -const Undo = tune` -160.42780748663102, -160.42780748663102: D4^160.42780748663102 + A5~160.42780748663102, -160.42780748663102: E4^160.42780748663102 + G5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, -160.42780748663102: F4^160.42780748663102 + F5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, -160.42780748663102: G4^160.42780748663102 + E5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, -160.42780748663102: A4^160.42780748663102 + D5~160.42780748663102 + A5-160.42780748663102, -160.42780748663102: B4^160.42780748663102 + C5~160.42780748663102, -160.42780748663102: A4-160.42780748663102 + D5/160.42780748663102 + D4~160.42780748663102, -160.42780748663102: G4-160.42780748663102 + E5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, -160.42780748663102: F4-160.42780748663102 + F5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, -160.42780748663102: E4-160.42780748663102 + G5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, -160.42780748663102: D4-160.42780748663102 + A5/160.42780748663102, -160.42780748663102: A5^160.42780748663102 + G5~160.42780748663102 + F5~160.42780748663102 + E5~160.42780748663102 + C5~160.42780748663102, -160.42780748663102: G5^160.42780748663102 + A5-160.42780748663102 + E5~160.42780748663102 + D5~160.42780748663102 + C5~160.42780748663102, -160.42780748663102: F5^160.42780748663102 + G5-160.42780748663102 + A4^160.42780748663102 + B4^160.42780748663102 + G4^160.42780748663102, -160.42780748663102: E5^160.42780748663102 + F5-160.42780748663102 + F4^160.42780748663102 + D4^160.42780748663102, -160.42780748663102: D5^160.42780748663102 + E5-160.42780748663102 + F4^160.42780748663102 + E4^160.42780748663102 + D4^160.42780748663102, -160.42780748663102: C5^160.42780748663102 + D5-160.42780748663102 + A4-160.42780748663102 + B4-160.42780748663102, -160.42780748663102: A4-160.42780748663102 + C5-160.42780748663102 + G4~160.42780748663102 + F4~160.42780748663102 + B5~160.42780748663102, -160.42780748663102: B4~160.42780748663102 + C5~160.42780748663102 + A4~160.42780748663102, -160.42780748663102: D5^160.42780748663102 + C5-160.42780748663102, -160.42780748663102: E5^160.42780748663102 + B4-160.42780748663102 + E4-160.42780748663102, -160.42780748663102: F5^160.42780748663102 + A4-160.42780748663102, -160.42780748663102: E5^160.42780748663102 + A4-160.42780748663102 + D4-160.42780748663102, -160.42780748663102: D5^160.42780748663102 + B4-160.42780748663102, -160.42780748663102: C5^160.42780748663102 + B4-160.42780748663102 + B5~160.42780748663102 + C4~160.42780748663102, -160.42780748663102: D5^160.42780748663102 + A4-160.42780748663102, -160.42780748663102: E5^160.42780748663102 + E4-160.42780748663102 + B4-160.42780748663102, -160.42780748663102: F5^160.42780748663102 + B4-160.42780748663102 + C4~160.42780748663102 + G4~160.42780748663102, -160.42780748663102: G5^160.42780748663102 + E4-160.42780748663102 + B4-160.42780748663102 + A4-160.42780748663102, -320.85561497326205` -const BattleRoyale = tune` -500: F4~500 + E5~500, -500: D4^500 + G4~500 + E5-500 + D5-500, -500: E4^500 + A4~500, -500: F4^500 + G5/500, -500: G4^500 + A5/500 + F5/500, -500: A4^500 + G5/500, -500: B4^500 + D4-500, -500: C5^500 + E4-500 + C4-500 + E5-500, -500: B4^500 + D4-500 + A5~500 + F5-500 + D5-500, -500: A4^500 + B5~500 + G5~500 + E5-500, -500: G4^500 + A5~500, -500: F4^500 + E5/500, -500: E4^500 + F5/500 + D5/500, -500: D4^500 + E5/500 + G5^500, -500: A4-500 + A5^500 + F5^500, -500: B4-500 + G4-500 + D5~500 + G5^500, -500: A4-500 + E5~500 + C5~500, -500: A5-500 + D5~500, -500: D4~500 + B5-500 + G5-500, -500: E4~500 + C4~500 + A5-500, -500: D4~500, -5500` -const Knockout = tune` -160.42780748663102, -160.42780748663102: D4^160.42780748663102 + A5~160.42780748663102, -160.42780748663102: E4^160.42780748663102 + G5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, -160.42780748663102: F4^160.42780748663102 + F5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, -160.42780748663102: G4^160.42780748663102 + E5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, -160.42780748663102: A4^160.42780748663102 + D5~160.42780748663102 + A5-160.42780748663102, -160.42780748663102: B4^160.42780748663102 + C5~160.42780748663102, -160.42780748663102: A4-160.42780748663102 + D5/160.42780748663102 + D4~160.42780748663102, -160.42780748663102: G4-160.42780748663102 + E5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, -160.42780748663102: F4-160.42780748663102 + F5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, -160.42780748663102: E4-160.42780748663102 + G5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, -160.42780748663102: D4-160.42780748663102 + A5/160.42780748663102, -160.42780748663102: A5^160.42780748663102 + G5~160.42780748663102 + F5~160.42780748663102 + E5~160.42780748663102 + C5~160.42780748663102, -160.42780748663102: G5^160.42780748663102 + A5-160.42780748663102 + E5~160.42780748663102 + D5~160.42780748663102 + C5~160.42780748663102, -160.42780748663102: F5^160.42780748663102 + G5-160.42780748663102 + A4^160.42780748663102 + B4^160.42780748663102 + G4^160.42780748663102, -160.42780748663102: E5^160.42780748663102 + F5-160.42780748663102 + F4^160.42780748663102 + D4^160.42780748663102, -160.42780748663102: D5^160.42780748663102 + E5-160.42780748663102 + F4^160.42780748663102 + E4^160.42780748663102 + D4^160.42780748663102, -160.42780748663102: C5^160.42780748663102 + D5-160.42780748663102 + A4-160.42780748663102 + B4-160.42780748663102, -160.42780748663102: A4-160.42780748663102 + C5-160.42780748663102 + G4~160.42780748663102 + F4~160.42780748663102 + B5~160.42780748663102, -160.42780748663102: B4~160.42780748663102 + C5~160.42780748663102 + A4~160.42780748663102, -160.42780748663102: D5^160.42780748663102 + C5-160.42780748663102, -160.42780748663102: E5^160.42780748663102 + B4-160.42780748663102 + E4-160.42780748663102, -160.42780748663102: F5^160.42780748663102 + A4-160.42780748663102, -160.42780748663102: E5^160.42780748663102 + A4-160.42780748663102 + D4-160.42780748663102, -160.42780748663102: D5^160.42780748663102 + B4-160.42780748663102, -160.42780748663102: C5^160.42780748663102 + B4-160.42780748663102 + B5~160.42780748663102 + C4~160.42780748663102, -160.42780748663102: D5^160.42780748663102 + A4-160.42780748663102, -160.42780748663102: E5^160.42780748663102 + E4-160.42780748663102 + B4-160.42780748663102, -160.42780748663102: F5^160.42780748663102 + B4-160.42780748663102 + C4~160.42780748663102 + G4~160.42780748663102, -160.42780748663102: G5^160.42780748663102 + E4-160.42780748663102 + B4-160.42780748663102 + A4-160.42780748663102, -320.85561497326205` -const Wall = 'W' - -// Walks - -const step1 = tune` -192.30769230769232: C4~192.30769230769232, -5961.538461538462` -const step2 = tune` -192.30769230769232: B5~192.30769230769232, -5961.538461538462` -const step3 = tune` -200: B5^200, -6200` -const step4 = tune` -185.1851851851852: B5^185.1851851851852, -5740.740740740741` - -//Level 3 -const Sun = "s" -const nighttime = "n" -const grass = "g" - -// ImportantVariable - -setLegend( - [player, bitmap` -................ -................ -....LL000000.... -....LL064640.... -....LL064640.... -....LL066660.... -....LL000000.... -.....L00660..... -.....L00660..... -.....L00000..... -.....LLLLL...... -................ -................ -................ -................ -................`], - [box, bitmap` -................ -................ -................ -........000..... -.....000000..... -....00000000.... -....00003030.... -....00003030.... -....00003000.... -....00003000.... -....00000000.... -....00000000.... -................ -................ -................ -................`], - [Goal, bitmap` -................ -...00000........ -...93390........ -...93390........ -...90090........ -...00000........ -...00000........ -................ -................ -................ -................ -................ -................ -................ -................ -................ -................`], - [Wall, bitmap` -0007077070000007 -0000000000000777 -0000070000007700 -0000070077770707 -0000077770000077 -0000000000000007 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000777000 -0000007770777000 -0000777770777000 -0000077770000000 -0000000000000000 -0000000000000000 -0000000000000000`], - - [Sun, bitmap` -..........000000 -..........062260 -..........062260 -..........001100 -............13.. -................ -................ -................ -................ -................ -................ -................ -................ -................ -................ -................`], - [nighttime, bitmap` -0555555555555577 -0555555555555555 -0577757775555757 -0777777777777777 -0555555555555555 -0555555555555555 -0777555555555555 -0777777777777777 -0777777777777777 -0555555555555555 -0775777777777777 -0777777777755557 -0777777555555555 -0555557555555555 -0777755577777777 -0555555555555555`], - [grass, bitmap` -................ -................ -................ -................ -................ -................ -................ -................ -................ -................ -................ -................ -................ -................ -FFDDFDDDFFDDDFFF -FFFFFFFFFDDFFFDF`], - [Enemy, bitmap` -................ -................ -................ -................ -.....000000..... -.....0L2L00..... -.....0L2L00..... -...0002220000... -...0222222200... -...0222222200... -...0202220200... -...0202220200... -...0000000000... -.....020200..... -.....020200..... -.....000000.....`], - [Maze, bitmap` -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000 -0000000000000000`], - [Poodle, bitmap` -.........2...... -........222.222. -........281.182. -........2811182. -........2112112. -........2112112. -........2182812. -........2218112. -.......LL222222. -......L3L030302. -.....L33L030302. -.....LLLL000002. -...............2 -................ -................ -................`], -); - -let level = 0; - -const levels = [ - map` -........ -........ -........ -........ -........ -........ -........`, - map` -GGGGG -G.t.R -G.B.G -G...G -GGpGG`, - map` -WWWWW -BBp.W -tB..W -BWWWW`, - map` -nnns -ngBp -nnng`, - map` -GG...t -G..B.. -p..... -.....G -EG.GEG -GGGGGG`, - map` -GGGGGG -GR..tG -G...BG -G....G -GR..pG -GGGGGG`, - map` -GGGGGG -GG...G -G.G..G -G..G.G -G...GG -GGGGGG`, -]; - -// Main Menu - -addText("Press K to start", { x: 2, y: 4, color: color`1` }); - -//// - -const currentLevel = levels[level]; -setMap(currentLevel); - -setSolids([player, box, nighttime, Sun, Wall, Maze, Enemy]); - -setPushables({ - [player]: [box] -}); - -function StartGame() { - if (level == 0) { - playTune(level3) - } else { - return false; - } -} - -function EnemyMove() { - let playerSprite = getFirst(player); - let Enemies = getAll(Enemy); - - Enemies.forEach(Enemy => { - // Calculate distance between enemy and player - let dx = playerSprite.x - Enemy.x; - let dy = playerSprite.y - Enemy.y; - - // Move towards player in the direction with the highest change - if (Math.abs(dx) > Math.abs(dy)) { - // Move horizontally - Enemy.x += Math.sign(dx); - } else { - // Move vertically - Enemy.y += Math.sign(dy); - } - }); -} - -function PoodleMove() { - let playerSprite = getFirst(player); - let Poodles = getAll(Poodle); - - Poodles.forEach(Poodle => { - // Calculate distance between enemy and player - let dx = playerSprite.x - Poodle.x; - let dy = playerSprite.y - Poodle.y; - - // Move towards player in the direction with the highest change - if (Math.abs(dx) > Math.abs(dy)) { - // Move horizontally - Poodle.x += Math.sign(dx); - } else { - // Move vertically - Poodle.y += Math.sign(dy); - } - if (playerSprite.y - Poodle.y == 0 && playerSprite.x - Poodle.x == 0) { - - - setTimeout(() => { - if (level < 7) { - addText("Your dead!", { x: 4, y: 4, color: color`7` }); - } - }, 2000) - - clearText() - - setMap(currentLevel); - } - }); -} - -function resetLevel() { - // Clear any text on the screen - clearText(); - - // Reset the level variable to the initial level (e.g., level 0) - level = 0; - - // Get the current level map based on the reset level - const currentLevel = levels[level]; - - // Reset the game map to the initial level map - setMap(currentLevel); - -} - -let LevelTextNumber = level.toString(); // the int turned Into a string - -function LevelSystem() { - addText(LevelTextNumber, { x: 1, y: 1, color: color`6` }); -} - - -onInput("s", () => { - getFirst(player).y += 1 -}); - -onInput("w", () => { - getFirst(player).y -= 1 - playTune(step2, 1) -}); - -onInput("a", () => { - getFirst(player).x -= 1 - -}); - -onInput("d", () => { - getFirst(player).x += 1 - playTune(step4, 1) -}); - -setTimeout(() => { - onInput("k", () => { - StartGame() - }); - clearText() -}, 200) - -onInput("j", resetLevel); - - - - - -afterInput(() => { - - const targetfound = tilesWith(Goal).length; - const NumberCovered = tilesWith(Goal, box).length; - const grassfall = tilesWith(box).length; - const Covered = tilesWith(box, grass).length; - const currentLevel = levels[level]; - - let iterationCount = 0; - const maxIte = 10; - const max2 = 2; - // Starting the game! - - while (level == 5 && iterationCount < maxIte) { - // do stuff - EnemyMove(); - - iterationCount++; - } - - while (level <= 6 && iterationCount < max2) { - PoodleMove(); - iterationCount++; - - } - - if (NumberCovered == targetfound) { - level += 1; - - - - if (currentLevel !== undefined) { - setMap(currentLevel); - } - - if (level == 7) { - setTimeout(() => { - addText("Thats the end!", { x: 4, y: 4, color: color`3` }); - }, 1000) - - } - - } - - setTimeout(() => {}, 2500) - - clearText(); -}); From a4ca4fbc55a62e69cf47cee2e9b3fe8870160d91 Mon Sep 17 00:00:00 2001 From: GodlyAngel1614 Date: Mon, 14 Oct 2024 18:16:42 -0500 Subject: [PATCH 11/13] Add files via upload --- games/KittyPity.js | 569 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 569 insertions(+) create mode 100644 games/KittyPity.js diff --git a/games/KittyPity.js b/games/KittyPity.js new file mode 100644 index 0000000000..2d8647fc13 --- /dev/null +++ b/games/KittyPity.js @@ -0,0 +1,569 @@ +/* +First time? Check out the tutorial game: +https://sprig.hackclub.com/gallery/getting_started + +@title: KittyPity +@author: +@tags: [] +@addedOn: 2024-00-00 +*/ + +// Sprites +const player = "p" +const Goal = "t" +const box = "B" +const Maze = "G" +const Enemy = "E" +const Poodle = "R" + + + + +//Tunes And General + +const level3 = tune` +410.958904109589: B5^410.958904109589, +410.958904109589: B5^410.958904109589, +410.958904109589: B5^410.958904109589, +410.958904109589: E5~410.958904109589, +410.958904109589: F5~410.958904109589, +410.958904109589: G5~410.958904109589, +410.958904109589: F5~410.9589041095.. . B5.4.0......4109589, +410.958904109589: A5~410.958904109589 + C5^410.958904109589, +410.958904109589: G5~410.958904109589 + B4^410..58904109589, +410.958904109589: F5~410.958904109589 + B5~410..58904109589 + C5^410.958904109589 + A4^410.958904109589, +410.958904109589: G5-410.958904109589, +410.958904109589: A5-410.958904109589 + B4^410.958904109589, +410.958904109589: G5-410.958904109589 + C5^410.958904109589 + A4^410.958904109589, +410.958904109589: E5~410.958904109589 + B4^410.958904109589, +410.958904109589: D5~410.958904109589 + A5-410.958904109589, +410.958904109589: E5~410.958904109589 + C5^410.958904109589, +410.958904109589: F5-410.958904109589 + B4^410.958904109589, +410.958904109589: G5-410.958904109589 + F5^410.958904109589 + C5^410.958904109589 + A4^410.958904109589, +410.958904109589: F5-410.958904109589 + A5~410.958904109589, +410.958904109589: E5-410.958904109589 + B5-410.958904109589 + G5-410.958904109589, +410.958904109589: C5-410.958904109589 + A5~410.958904109589, +410.958904109589: E5~410.958904109589, +410.958904109589: F5~410.958904109589 + A4^410.958904109589, +410.958904109589: G5~410.958904109589 + B4^410.958904109589, +410.958904109589: E5~410.958904109589 + A4^410.958904109589 + C5^410.958904109589, +410.958904109589: E5-410.958904109589 + B4^410.958904109589, +410.958904109589: D5-410.958904109589 + A4^410.958904109589 + F4-410.958904109589, +410.958904109589: C5-410.958904109589 + F5~410.958904109589 + D5^410.958904109589 + G4-410.958904109589 + E4-410.958904109589, +410.958904109589: D5-410.958904109589 + B4^410.958904109589 + A5~410.958904109589 + F4-410.958904109589, +410.958904109589: G5-410.958904109589 + C5^410.958904109589 + A4^410.958904109589 + B5^410.958904109589 + E4~410.958904109589, +410.958904109589: B4^410.958904109589 + G5~410.958904109589 + B5~410.958904109589, +410.958904109589: A5^410.958904109589` +const Undo = tune` +160.42780748663102, +160.42780748663102: D4^160.42780748663102 + A5~160.42780748663102, +160.42780748663102: E4^160.42780748663102 + G5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, +160.42780748663102: F4^160.42780748663102 + F5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, +160.42780748663102: G4^160.42780748663102 + E5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, +160.42780748663102: A4^160.42780748663102 + D5~160.42780748663102 + A5-160.42780748663102, +160.42780748663102: B4^160.42780748663102 + C5~160.42780748663102, +160.42780748663102: A4-160.42780748663102 + D5/160.42780748663102 + D4~160.42780748663102, +160.42780748663102: G4-160.42780748663102 + E5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, +160.42780748663102: F4-160.42780748663102 + F5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, +160.42780748663102: E4-160.42780748663102 + G5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, +160.42780748663102: D4-160.42780748663102 + A5/160.42780748663102, +160.42780748663102: A5^160.42780748663102 + G5~160.42780748663102 + F5~160.42780748663102 + E5~160.42780748663102 + C5~160.42780748663102, +160.42780748663102: G5^160.42780748663102 + A5-160.42780748663102 + E5~160.42780748663102 + D5~160.42780748663102 + C5~160.42780748663102, +160.42780748663102: F5^160.42780748663102 + G5-160.42780748663102 + A4^160.42780748663102 + B4^160.42780748663102 + G4^160.42780748663102, +160.42780748663102: E5^160.42780748663102 + F5-160.42780748663102 + F4^160.42780748663102 + D4^160.42780748663102, +160.42780748663102: D5^160.42780748663102 + E5-160.42780748663102 + F4^160.42780748663102 + E4^160.42780748663102 + D4^160.42780748663102, +160.42780748663102: C5^160.42780748663102 + D5-160.42780748663102 + A4-160.42780748663102 + B4-160.42780748663102, +160.42780748663102: A4-160.42780748663102 + C5-160.42780748663102 + G4~160.42780748663102 + F4~160.42780748663102 + B5~160.42780748663102, +160.42780748663102: B4~160.42780748663102 + C5~160.42780748663102 + A4~160.42780748663102, +160.42780748663102: D5^160.42780748663102 + C5-160.42780748663102, +160.42780748663102: E5^160.42780748663102 + B4-160.42780748663102 + E4-160.42780748663102, +160.42780748663102: F5^160.42780748663102 + A4-160.42780748663102, +160.42780748663102: E5^160.42780748663102 + A4-160.42780748663102 + D4-160.42780748663102, +160.42780748663102: D5^160.42780748663102 + B4-160.42780748663102, +160.42780748663102: C5^160.42780748663102 + B4-160.42780748663102 + B5~160.42780748663102 + C4~160.42780748663102, +160.42780748663102: D5^160.42780748663102 + A4-160.42780748663102, +160.42780748663102: E5^160.42780748663102 + E4-160.42780748663102 + B4-160.42780748663102, +160.42780748663102: F5^160.42780748663102 + B4-160.42780748663102 + C4~160.42780748663102 + G4~160.42780748663102, +160.42780748663102: G5^160.42780748663102 + E4-160.42780748663102 + B4-160.42780748663102 + A4-160.42780748663102, +320.85561497326205` +const BattleRoyale = tune` +500: F4~500 + E5~500, +500: D4^500 + G4~500 + E5-500 + D5-500, +500: E4^500 + A4~500, +500: F4^500 + G5/500, +500: G4^500 + A5/500 + F5/500, +500: A4^500 + G5/500, +500: B4^500 + D4-500, +500: C5^500 + E4-500 + C4-500 + E5-500, +500: B4^500 + D4-500 + A5~500 + F5-500 + D5-500, +500: A4^500 + B5~500 + G5~500 + E5-500, +500: G4^500 + A5~500, +500: F4^500 + E5/500, +500: E4^500 + F5/500 + D5/500, +500: D4^500 + E5/500 + G5^500, +500: A4-500 + A5^500 + F5^500, +500: B4-500 + G4-500 + D5~500 + G5^500, +500: A4-500 + E5~500 + C5~500, +500: A5-500 + D5~500, +500: D4~500 + B5-500 + G5-500, +500: E4~500 + C4~500 + A5-500, +500: D4~500, +5500` +const Knockout = tune` +160.42780748663102, +160.42780748663102: D4^160.42780748663102 + A5~160.42780748663102, +160.42780748663102: E4^160.42780748663102 + G5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, +160.42780748663102: F4^160.42780748663102 + F5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, +160.42780748663102: G4^160.42780748663102 + E5~160.42780748663102 + A5-160.42780748663102 + D4/160.42780748663102, +160.42780748663102: A4^160.42780748663102 + D5~160.42780748663102 + A5-160.42780748663102, +160.42780748663102: B4^160.42780748663102 + C5~160.42780748663102, +160.42780748663102: A4-160.42780748663102 + D5/160.42780748663102 + D4~160.42780748663102, +160.42780748663102: G4-160.42780748663102 + E5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, +160.42780748663102: F4-160.42780748663102 + F5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, +160.42780748663102: E4-160.42780748663102 + G5/160.42780748663102 + A5^160.42780748663102 + D4~160.42780748663102, +160.42780748663102: D4-160.42780748663102 + A5/160.42780748663102, +160.42780748663102: A5^160.42780748663102 + G5~160.42780748663102 + F5~160.42780748663102 + E5~160.42780748663102 + C5~160.42780748663102, +160.42780748663102: G5^160.42780748663102 + A5-160.42780748663102 + E5~160.42780748663102 + D5~160.42780748663102 + C5~160.42780748663102, +160.42780748663102: F5^160.42780748663102 + G5-160.42780748663102 + A4^160.42780748663102 + B4^160.42780748663102 + G4^160.42780748663102, +160.42780748663102: E5^160.42780748663102 + F5-160.42780748663102 + F4^160.42780748663102 + D4^160.42780748663102, +160.42780748663102: D5^160.42780748663102 + E5-160.42780748663102 + F4^160.42780748663102 + E4^160.42780748663102 + D4^160.42780748663102, +160.42780748663102: C5^160.42780748663102 + D5-160.42780748663102 + A4-160.42780748663102 + B4-160.42780748663102, +160.42780748663102: A4-160.42780748663102 + C5-160.42780748663102 + G4~160.42780748663102 + F4~160.42780748663102 + B5~160.42780748663102, +160.42780748663102: B4~160.42780748663102 + C5~160.42780748663102 + A4~160.42780748663102, +160.42780748663102: D5^160.42780748663102 + C5-160.42780748663102, +160.42780748663102: E5^160.42780748663102 + B4-160.42780748663102 + E4-160.42780748663102, +160.42780748663102: F5^160.42780748663102 + A4-160.42780748663102, +160.42780748663102: E5^160.42780748663102 + A4-160.42780748663102 + D4-160.42780748663102, +160.42780748663102: D5^160.42780748663102 + B4-160.42780748663102, +160.42780748663102: C5^160.42780748663102 + B4-160.42780748663102 + B5~160.42780748663102 + C4~160.42780748663102, +160.42780748663102: D5^160.42780748663102 + A4-160.42780748663102, +160.42780748663102: E5^160.42780748663102 + E4-160.42780748663102 + B4-160.42780748663102, +160.42780748663102: F5^160.42780748663102 + B4-160.42780748663102 + C4~160.42780748663102 + G4~160.42780748663102, +160.42780748663102: G5^160.42780748663102 + E4-160.42780748663102 + B4-160.42780748663102 + A4-160.42780748663102, +320.85561497326205` +const Wall = 'W' + +// Walks + +const step1 = tune` +192.30769230769232: C4~192.30769230769232, +5961.538461538462` +const step2 = tune` +192.30769230769232: B5~192.30769230769232, +5961.538461538462` +const step3 = tune` +200: B5^200, +6200` +const step4 = tune` +185.1851851851852: B5^185.1851851851852, +5740.740740740741` + +//Level 3 +const Sun = "s" +const nighttime = "n" +const grass = "g" + +// ImportantVariable + +setLegend( + [player, bitmap` +................ +................ +....LL000000.... +....LL064640.... +....LL064640.... +....LL066660.... +....LL000000.... +.....L00660..... +.....L00660..... +.....L00000..... +.....LLLLL...... +................ +................ +................ +................ +................`], + [box, bitmap` +................ +................ +................ +........000..... +.....000000..... +....00000000.... +....00003030.... +....00003030.... +....00003000.... +....00003000.... +....00000000.... +....00000000.... +................ +................ +................ +................`], + [Goal, bitmap` +................ +...00000........ +...93390........ +...93390........ +...90090........ +...00000........ +...00000........ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................`], + [Wall, bitmap` +0007077070000007 +0000000000000777 +0000070000007700 +0000070077770707 +0000077770000077 +0000000000000007 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000777000 +0000007770777000 +0000777770777000 +0000077770000000 +0000000000000000 +0000000000000000 +0000000000000000`], + + [Sun, bitmap` +..........000000 +..........062260 +..........062260 +..........001100 +............13.. +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................`], + [nighttime, bitmap` +0555555555555577 +0555555555555555 +0577757775555757 +0777777777777777 +0555555555555555 +0555555555555555 +0777555555555555 +0777777777777777 +0777777777777777 +0555555555555555 +0775777777777777 +0777777777755557 +0777777555555555 +0555557555555555 +0777755577777777 +0555555555555555`], + [grass, bitmap` +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +FFDDFDDDFFDDDFFF +FFFFFFFFFDDFFFDF`], + [Enemy, bitmap` +................ +................ +................ +................ +.....000000..... +.....0L2L00..... +.....0L2L00..... +...0002220000... +...0222222200... +...0222222200... +...0202220200... +...0202220200... +...0000000000... +.....020200..... +.....020200..... +.....000000.....`], + [Maze, bitmap` +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000`], + [Poodle, bitmap` +.........2...... +........222.222. +........281.182. +........2811182. +........2112112. +........2112112. +........2182812. +........2218112. +.......LL222222. +......L3L030302. +.....L33L030302. +.....LLLL000002. +...............2 +................ +................ +................`], +); + +let level = 0; + +const levels = [ + map` +........ +........ +........ +........ +........ +........ +........`, + map` +GGGGG +G.t.R +G.B.G +G...G +GGpGG`, + map` +WWWWW +BBp.W +tB..W +BWWWW`, + map` +nnns +ngBp +nnng`, + map` +GG...t +G..B.. +p..... +.....G +EG.GEG +GGGGGG`, + map` +GGGGGG +GR..tG +G...BG +G....G +GR..pG +GGGGGG`, + map` +GGGGGG +GG...G +G.G..G +G..G.G +G...GG +GGGGGG`, +]; + +// Main Menu + +addText("Press K to start", { x: 2, y: 4, color: color`1` }); + +//// + +const currentLevel = levels[level]; +setMap(currentLevel); + +setSolids([player, box, nighttime, Sun, Wall, Maze, Enemy]); + +setPushables({ + [player]: [box] +}); + +function StartGame() { + if (level == 0) { + playTune(level3) + } else { + return false; + } +} + +function EnemyMove() { + let playerSprite = getFirst(player); + let Enemies = getAll(Enemy); + + Enemies.forEach(Enemy => { + // Calculate distance between enemy and player + let dx = playerSprite.x - Enemy.x; + let dy = playerSprite.y - Enemy.y; + + // Move towards player in the direction with the highest change + if (Math.abs(dx) > Math.abs(dy)) { + // Move horizontally + Enemy.x += Math.sign(dx); + } else { + // Move vertically + Enemy.y += Math.sign(dy); + } + }); +} + +function PoodleMove() { + let playerSprite = getFirst(player); + let Poodles = getAll(Poodle); + + Poodles.forEach(Poodle => { + // Calculate distance between enemy and player + let dx = playerSprite.x - Poodle.x; + let dy = playerSprite.y - Poodle.y; + + // Move towards player in the direction with the highest change + if (Math.abs(dx) > Math.abs(dy)) { + // Move horizontally + Poodle.x += Math.sign(dx); + } else { + // Move vertically + Poodle.y += Math.sign(dy); + } + if (playerSprite.y - Poodle.y == 0 && playerSprite.x - Poodle.x == 0) { + + + setTimeout(() => { + if (level < 7) { + addText("Your dead!", { x: 4, y: 4, color: color`7` }); + } + }, 2000) + + clearText() + + setMap(currentLevel); + } + }); +} + +function resetLevel() { + // Clear any text on the screen + clearText(); + + // Reset the level variable to the initial level (e.g., level 0) + level = 0; + + // Get the current level map based on the reset level + const currentLevel = levels[level]; + + // Reset the game map to the initial level map + setMap(currentLevel); + +} + +let LevelTextNumber = level.toString(); // the int turned Into a string + +function LevelSystem() { + addText(LevelTextNumber, { x: 1, y: 1, color: color`6` }); +} + + +onInput("s", () => { + getFirst(player).y += 1 +}); + +onInput("w", () => { + getFirst(player).y -= 1 + playTune(step2, 1) +}); + +onInput("a", () => { + getFirst(player).x -= 1 + +}); + +onInput("d", () => { + getFirst(player).x += 1 + playTune(step4, 1) +}); + +setTimeout(() => { + onInput("k", () => { + StartGame() + }); + clearText() +}, 200) + +onInput("j", resetLevel); + + + + + +afterInput(() => { + + const targetfound = tilesWith(Goal).length; + const NumberCovered = tilesWith(Goal, box).length; + const grassfall = tilesWith(box).length; + const Covered = tilesWith(box, grass).length; + const currentLevel = levels[level]; + + let iterationCount = 0; + const maxIte = 10; + const max2 = 2; + // Starting the game! + + while (level == 5 && iterationCount < maxIte) { + // do stuff + EnemyMove(); + + iterationCount++; + } + + while (level <= 6 && iterationCount < max2) { + PoodleMove(); + iterationCount++; + + } + + if (NumberCovered == targetfound) { + level += 1; + + + + if (currentLevel !== undefined) { + setMap(currentLevel); + } + + if (level == 7) { + setTimeout(() => { + addText("Thats the end!", { x: 4, y: 4, color: color`3` }); + }, 1000) + + } + + } + + setTimeout(() => {}, 2500) + + clearText(); +}); \ No newline at end of file From a2b6186c4412202b4227baf716b225c677c68e81 Mon Sep 17 00:00:00 2001 From: GodlyAngel1614 Date: Mon, 21 Oct 2024 19:50:13 -0500 Subject: [PATCH 12/13] Update KittyPity.js --- games/KittyPity.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/games/KittyPity.js b/games/KittyPity.js index 2d8647fc13..a28eb51133 100644 --- a/games/KittyPity.js +++ b/games/KittyPity.js @@ -454,7 +454,7 @@ function PoodleMove() { setTimeout(() => { if (level < 7) { - addText("Your dead!", { x: 4, y: 4, color: color`7` }); + addText("Your dead!", { x: 4, y: 4, color: color`7` }); } }, 2000) @@ -548,7 +548,7 @@ afterInput(() => { if (NumberCovered == targetfound) { level += 1; - + if (currentLevel !== undefined) { setMap(currentLevel); @@ -566,4 +566,6 @@ afterInput(() => { setTimeout(() => {}, 2500) clearText(); -}); \ No newline at end of file + + console.log(); +}); From fcf215a64691e56cf73358dc5d42e2b459f1b541 Mon Sep 17 00:00:00 2001 From: GodlyAngel1614 Date: Mon, 21 Oct 2024 19:56:06 -0500 Subject: [PATCH 13/13] Update KittyPity.js --- games/KittyPity.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/games/KittyPity.js b/games/KittyPity.js index a28eb51133..72fbb80c60 100644 --- a/games/KittyPity.js +++ b/games/KittyPity.js @@ -567,5 +567,7 @@ afterInput(() => { clearText(); - console.log(); + console.debug(App[Symbol.metadata]) + + console.log(context.metadata); });