From 08eab591ccfc3bda06f17bdd465c18dd5932fc36 Mon Sep 17 00:00:00 2001 From: amy?? <93843215+salping@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:31:20 +1300 Subject: [PATCH] [Sprig App] Pixeltron 6000 (#2597) * Sprig App - Pixeltron 6000 * Update metadata --------- Co-authored-by: Alex Park --- games/Pixeltron-6000.js | 491 +++++++++++++++++++++++++++++++++++ games/img/Pixeltron-6000.png | Bin 0 -> 20141 bytes 2 files changed, 491 insertions(+) create mode 100644 games/Pixeltron-6000.js create mode 100644 games/img/Pixeltron-6000.png diff --git a/games/Pixeltron-6000.js b/games/Pixeltron-6000.js new file mode 100644 index 0000000000..d8b1d10d40 --- /dev/null +++ b/games/Pixeltron-6000.js @@ -0,0 +1,491 @@ +/* +First time? Check out the tutorial game: +https://sprig.hackclub.com/gallery/getting_started + +@title: Pixeltron 6000 +@author: salping +@tags: ['sandbox', 'utility'] +@addedOn: 2024-11-12 +*/ + +const player = "w" +const colore = "k" +const lbor = "l" +const cbor1 = "c" +const bbor = "z" +const cbor2 = "d" +const rbor = "x" +const red = "r" +const blue = "b" +const green = "g" +const yellow = "y" +const pink = "p" +const purple = "u" +const orange = "o" +const black = "i" +const grey = "n" +const p = "1" +const i = "2" +const x = "3" +const e = "4" +const l = "5" +const t = "6" +const r = "7" +const o = "8" +const n = "9" + + +setLegend( + [ player, bitmap` +000..........000 +0..............0 +0..............0 +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +0..............0 +0..............0 +000..........000` ], + [ colore, bitmap` +000..........000 +0..............0 +0..............0 +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +0..............0 +0..............0 +000..........000`], + [ lbor, bitmap` +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100 +1111111111111100`], + [ cbor1, bitmap` +1111111111111100 +1111111111111100 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +0000000000000000 +0000000000000000`], + [ bbor, bitmap` +0000000000000000 +0000000000000000 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +0000000000000000 +0000000000000000`], + [ cbor2, bitmap` +0011111111111111 +0011111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +1111111111111111 +0011111111111111 +0011111111111111`], + [ rbor, bitmap` +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111 +0011111111111111`], + [ red, bitmap` +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333`], + [ green, bitmap` +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444`], + [ blue, bitmap` +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555 +5555555555555555`], + [ yellow, bitmap` +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666 +6666666666666666`], + [ orange, bitmap` +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999 +9999999999999999`], + [ purple, bitmap` +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH +HHHHHHHHHHHHHHHH`], + [ pink, bitmap` +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888 +8888888888888888`], + [ black, bitmap` +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000`], + [ grey, bitmap` +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL +LLLLLLLLLLLLLLLL`], + [ p, bitmap` +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +000............. +0.0.00..0....... +000.0..0.0...... +0...0...0.......`], + [ t, bitmap` +................ +................ +....00.......... +....00.......... +....00.......... +....00.......... +..000000........ +..000000........ +....00.......... +....00.......... +....00.......... +....00.......... +....00.......... +....00.......... +......0000...... +......0000......`], + [ i, bitmap` +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +.77...88...66... +7....8..8.6..6.0 +777..8..8.6..6.0 +7..7.8..8.6..6.0 +7..7.8..8.6..6.0 +.77...88...66...`], + [ e, bitmap` +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +00.............. +..0............. +..0............. +..0............. +..0............. +00..............`], + [ x, bitmap` +................ +0000000000000000 +0000000000000000 +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................ +................`], + +) + +setSolids([player, colore, lbor, cbor1, bbor, cbor2, rbor]) + +let level = 0 +const levels = [ + map` +lwk......x +l........x +l........x +l........x +l........x +l........x +l........x +l........x +czzzzzzzzd +roygbupinx` +] + +setMap(levels[level]) + +if(level == 0) { + + addText("WASD to move", { + x: 4, + y: 1 + }) + + addText("JL to change\ncolor", { + x: 4, + y: 3 + }) + + addText("I to draw", { + x: 4, + y: 6 + }) + + addText("K to erase /\ndraw white", { + x: 4, + y: 8 + }) + + colors = [red, orange, yellow, green, blue, purple, pink, black, grey] + + getFirst(colore).x -= 3 + getFirst(colore).y += 9 + + onInput("i", () => { + let x = getFirst(player).x + let y = getFirst(player).y + clearTile(getFirst(player).x, getFirst(player).y) + addSprite(x, y, player) + addSprite(getFirst(player).x, getFirst(player).y, colors[getFirst(colore).x]) + }) + onInput("k", () => { + let x = getFirst(player).x + let y = getFirst(player).y + clearTile(getFirst(player).x, getFirst(player).y) + addSprite(x, y, player) + }) + + onInput("j", () => { + getFirst(colore).x -= 1 + }) + onInput("l", () => { + getFirst(colore).x += 1 + }) + + onInput("w", () => { + getFirst(player).y -= 1 + }) + onInput("s", () => { + getFirst(player).y += 1 + }) + onInput("a", () => { + getFirst(player).x -= 1 + }) + onInput("d", () => { + getFirst(player).x += 1 + }) + + afterInput(() => { + clearText() + + }) +} + +setPushables({ + [ player ]: [] +}) + +afterInput(() => { + +}) diff --git a/games/img/Pixeltron-6000.png b/games/img/Pixeltron-6000.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4d568719399efe040e8c6c0538c24da662d886 GIT binary patch literal 20141 zcmeHPdpK0xzaL}EjLIdX2opuRn3CMbj9d!2lnQSlN%D$u8D?wbGQC|D_4-Mr8M^AO z(v^{>lAnZ-q!@$B-E4_*nK8e$i{AJA&hPwjp68tByuatnJkQ?yyY^b^d-;67Ykk*R z+vBjO`UW~TF6hYc7E7Dg}JH1K9Pi*1F$$i#-)+k1xDud%1@rbc^31_lK? zgvLbf4vhC)iNP#75qrGY^|_~7smJvVZ>$a}YR@w{Z2z`aAuejy5;e!=8|AKhok_%p zCoC}95T)vEG@|Rn^^LrJXk%nlq_Ts&O7mGOqer`7Ue?ABdc3mFVvDmekGDS6@|?S5 z7`v$Jr=pBmXPjfr&fIZ!J%e9$7{F@L{#A1?yZ!{l^b5G)EH? z(YpNhQCBV9mg*}g*_lxR1o;(*?c-9X+|fbRTMM>(ZnH6b zvj`*m{XG_gIT(t8Cfm4!C;B@MF0{{&r|jv^$6da(85T1K5m`_duntr!OVEM z@p3&|1pK{y)|HA@NT=eg4ayf2#TC zo||HVqwT5TKqSrf4|h$9{d47HM;jt)`Ja&Z0rU5_0B2hT8{$u&*(zYRnT`NA&I@($ z*a)5=$k3mR4Y)1(@kD9E9__ZwaPWNS>|nPMmgzmU;_g!G--Ggotz4EAoZ9?LSMfWw zzQt;q`;T4@KA>t5;4+@La-Ri;v`wHZ84Zw#t0k&qEt2tciPp6lzRDvlsv{lbpnQ=; zN1^3645Wt_wd+bo9u`j2r%d#TzO<4T!R8;!8s{TtF>(USl}}`3a81t1OnM%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