From df29021258420a412ad15cc598f623ac7e7f3376 Mon Sep 17 00:00:00 2001 From: Endlessvoid14 Date: Fri, 17 Oct 2025 13:49:32 -0400 Subject: [PATCH] Create PaintEasy.js --- games/PaintEasy.js | 159 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 159 insertions(+) create mode 100644 games/PaintEasy.js diff --git a/games/PaintEasy.js b/games/PaintEasy.js new file mode 100644 index 0000000000..fd040d02b9 --- /dev/null +++ b/games/PaintEasy.js @@ -0,0 +1,159 @@ +/* +First time? Check out the tutorial game: +https://sprig.hackclub.com/gallery/getting_started + +@title: PaintEasy +@author: +@tags: [] +@addedOn: 2025-00-00 +*/ + +const cursor = "c"; + +setLegend( + [ cursor, bitmap` +0000000000000000 +0000000000000000 +0000........0000 +00000......00000 +00.000....000.00 +00..000..000..00 +00...000000...00 +00....0000....00 +00....0000....00 +00...000000...00 +00..000..000..00 +00.000....000.00 +00000......00000 +0000........0000 +0000000000000000 +0000000000000000` ], + [ "r", bitmap` +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333 +3333333333333333` ], + [ "g", bitmap` +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444 +4444444444444444` ], + [ "b", bitmap` +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777 +7777777777777777` ], + [ "v", bitmap` +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000 +0000000000000000` ] +) + +setSolids([]) + +let level = 0 +const levels = [ + map` +............. +............. +............. +............. +......c...... +............. +............. +............. +.............` +] + +setMap(levels[level]) + +setPushables({ + [ cursor ]: [] +}) + +onInput("s", () => { + getFirst(cursor).y += 1 +}) + +onInput("w", () => { + getFirst(cursor).y -= 1 +}) + +onInput("a", () => { + getFirst(cursor).x -= 1 +}) + +onInput("d", () => { + getFirst(cursor).x += 1 +}) + +const cycle = ["r","g","b","v"]; +var ccolv = 3; +var ccol = "v"; + +onInput("i", () => { + addSprite(getFirst(cursor).x, getFirst(cursor).y, ccol); +}); + +onInput("j", () => { + ccolv = ccolv == 0 ? 0 : ccolv - 1; + ccol = cycle[ccolv]; +}); + +onInput("l", () => { + ccolv = ccolv == 3 ? 3 : ccolv + 1; + ccol = cycle[ccolv]; +}); + +afterInput(() => { + +})