Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/Toby222/SharkGame into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
spencers145 committed Nov 19, 2024
2 parents 3290d59 + 8b263c8 commit 96b3958
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 11 deletions.
29 changes: 23 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion js/lib/sharkgame.global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ declare global {
init(): void;
moveLog(): void;
addMessage(message: string | JQuery.Node): JQuery<HTMLLIElement>;
addError(message: string | JQuery.Node): ReturnType<LogModule["addMessage"]>;
addError(message: string | JQuery.Node, sanitizeHtml?: boolean): ReturnType<LogModule["addMessage"]>;
addDiscovery(message: string | JQuery.Node): ReturnType<LogModule["addMessage"]>;
correctLogLength(): void;
clearMessages(logThing?: boolean): void;
Expand Down
11 changes: 8 additions & 3 deletions js/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $("<li>").html(message);
const messageItem = $("<li>");
if (sanitizeHtml) {
messageItem.text(message);
} else {
messageItem.html(message);
}

if (log.isNextMessageEven()) {
messageItem.addClass("evenMessage");
Expand Down Expand Up @@ -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;
},
Expand Down
2 changes: 1 addition & 1 deletion js/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 96b3958

Please sign in to comment.