From c15e99cbd05df99530d8d9ae89b925c2f7346ba8 Mon Sep 17 00:00:00 2001 From: spencers145 Date: Wed, 6 Nov 2024 07:28:07 -0500 Subject: [PATCH 1/2] Rewrite README.md --- README.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 45bef58a..09a00e36 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,30 @@ # Shark Game -Shark Game is a web game made entirely in HTML, CSS and JavaScript by Cirrial. It is a game belonging to the "idle" or "incremental" genre. It does not require constant player attention, and can progress while the player does other things before returning to it. This isn't in any way a new or pioneering concept - a lot of people have probably heard of Candy Box or A Dark Room, or the more popular contemporary Cookie Clicker. +Shark Game is a web game made entirely in HTML, CSS and JavaScript. It is a game belonging to the "incremental" genre, though is not an "idle" game. -## Development Plan +It was originally conceived for Seamergency 2014 by Cirrial, who spent a few years working on it before moving on to other projects. In 2020, spencers145 (AKA base4) and Toby222 picked up the project to continue developemnt. spencers145 made a fork, where an older version of the project currently sits. Toby222 forked that to make this repo, which holds the up-to-date game. -Cirrial originally developed this game for Seamergency 2014, but continued to develop it afterward. It quickly became a niche favorite among idle game enthusiasts. After a string of updates, Cirrial dropped development in mid-2015. The final version is v0.71. +The hub branch holds the landing page for the game, which disambiguates the available versions of it, both current and historical. The alpha branch is for stable releases, and the dev branch is for development builds. -While the game is in a more-than-playable state, it remains unfinished. This mod, dubbed New Frontiers, intends to finish what Cirrial started, and then move on to reimagine the game and its world. +The hub, alpha, and dev branches are deployed at https://shark.tobot.dev, https://alpha.shark.tobot.dev, and https://dev.shark.tobot.dev respectively. -This repository holds the second step of development, which is to reimagine each of the worlds as unique places with individually significant and different gameplay elements, along with UI improvements and overhauls to major game mechanics. +## Sprite Packing -Contributions welcome. +We use a free sprite packer at https://free-tex-packer.com/app/ for sprites.js, sprites.png, homemessagesprites.png, and homemessagesprites.js. + +To generate sprites.js and sprites.png, use the following custom Format: +``` +SharkGame.Sprites = { + {{#rects}} + "{{{name}}}": { + frame: { + x: {{frame.x}}, + y: {{frame.y}}, + w: {{frame.w}}, + h: {{frame.h}} + }, + }, + {{/rects}} +} +``` +To generate homemessagesprites.png and homemessagesprites.js, replace `SharkGame.Sprites` with `SharkGame.HomeMessageSprites` above. From d0227959c60cd5ea2628c07363da1d9611e76e98 Mon Sep 17 00:00:00 2001 From: stampyzfanz <34364128+stampyzfanz@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:26:33 +1100 Subject: [PATCH 2/2] Fix formatting in the message log --- js/lib/sharkgame.global.d.ts | 2 +- js/log.js | 11 ++++++++--- js/save.js | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/js/lib/sharkgame.global.d.ts b/js/lib/sharkgame.global.d.ts index 4e7bc891..f47d7b6b 100644 --- a/js/lib/sharkgame.global.d.ts +++ b/js/lib/sharkgame.global.d.ts @@ -402,7 +402,7 @@ declare global { init(): void; moveLog(): void; addMessage(message: string | JQuery.Node): JQuery; - addError(message: string | JQuery.Node): ReturnType; + addError(message: string | JQuery.Node, sanitizeHtml?: boolean): ReturnType; addDiscovery(message: string | JQuery.Node): ReturnType; correctLogLength(): void; clearMessages(logThing?: boolean): void; diff --git a/js/log.js b/js/log.js index 174b5fe5..267ac8a7 100644 --- a/js/log.js +++ b/js/log.js @@ -66,13 +66,18 @@ SharkGame.Log = { return this.totalCount % 2 === 1; }, - addMessage(message) { + addMessage(message, sanitizeHtml = false) { const showAnims = SharkGame.Settings.current.showAnimations; if (!log.initialised) { log.init(); } - const messageItem = $("
  • ").html(message); + const messageItem = $("
  • "); + if (sanitizeHtml) { + messageItem.text(message); + } else { + messageItem.html(message); + } if (log.isNextMessageEven()) { messageItem.addClass("evenMessage"); @@ -120,7 +125,7 @@ SharkGame.Log = { console.error(message); message = message.message; } - const messageItem = log.addMessage("Error: " + message); + const messageItem = log.addMessage("Error: " + message, true); messageItem.addClass("error"); return messageItem; }, diff --git a/js/save.js b/js/save.js index 3c22a104..c9b5310f 100644 --- a/js/save.js +++ b/js/save.js @@ -136,7 +136,7 @@ SharkGame.Save = { saveData.saveVersion = i; } // let player know update went fine - log.addMessage("Updated save data from v " + saveData.version + " to " + SharkGame.VERSION + "."); + log.addMessage("Updated save data from v " + saveData.version + " to " + SharkGame.VERSION + ".", true); } // we're going to assume that everything has already been reset; we assume that we're just loading values into a blank slate