1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-17 04:01:51 +00:00

Added different tips based on what the user was doing

This commit is contained in:
Edward Badel 2021-09-02 22:32:38 -04:00
parent f00b8790bc
commit daee665dd5
4 changed files with 49 additions and 7 deletions

View File

@ -38,14 +38,16 @@ export class GameLoadingOverlay {
/**
* Shows a super basic overlay
* @param {string} gameModeId
*/
showBasic() {
showBasic(gameModeId) {
assert(!this.element, "Loading overlay already visible, cant show again");
console.log(gameModeId);
this.element = document.createElement("div");
this.element.classList.add("gameLoadingOverlay");
this.parent.appendChild(this.element);
this.internalAddSpinnerAndText(this.element);
this.internalAddHint(this.element);
this.internalAddHint(this.element, gameModeId);
}
/**
@ -61,10 +63,16 @@ export class GameLoadingOverlay {
/**
* Adds a random hint
* @param {HTMLElement} element
* @param {string} gameModeId
*/
internalAddHint(element) {
internalAddHint(element, gameModeId) {
const hint = document.createElement("span");
hint.innerHTML = randomChoice(T.tips);
let tips;
if (!gameModeId) tips = T.tips;
else if (gameModeId.includes("Edit")) tips = T.createPuzzleTips;
else tips = T.playPuzzleTips;
hint.innerHTML = randomChoice(tips);
hint.classList.add("prefab_GameHint");
element.appendChild(hint);
}

View File

@ -1,6 +1,9 @@
/* typehints:start */
import { PuzzlePlayGameMode } from "../../modes/puzzle_play";
/* typehints:end */
import { makeDiv } from "../../../core/utils";
import { T } from "../../../translations";
import { PuzzlePlayGameMode } from "../../modes/puzzle_play";
import { BaseHUDPart } from "../base_hud_part";
export class HUDPuzzleNextPuzzle extends BaseHUDPart {

View File

@ -371,7 +371,7 @@ export class InGameState extends GameState {
this.gameModeId = payload.gameModeId;
this.loadingOverlay = new GameLoadingOverlay(this.app, this.getDivElement());
this.loadingOverlay.showBasic();
this.loadingOverlay.showBasic(this.gameModeId);
// Remove unneded default element
document.body.querySelector(".modalDialogParent").remove();
@ -418,7 +418,7 @@ export class InGameState extends GameState {
this.loadingOverlay.removeIfAttached();
} else {
if (!this.loadingOverlay.isAttached()) {
this.loadingOverlay.showBasic();
this.loadingOverlay.showBasic(this.gameModeId);
}
}
}

View File

@ -1495,3 +1495,34 @@ tips:
- Press F4 to show your FPS and Tick Rate.
- Press F4 twice to show the tile of your mouse and camera.
- You can click a pinned shape on the left side to unpin it.
- If you belts are too fast, press <b>ALT<b> to bring up the shape tooltip
playPuzzleTips:
- The double painter can be used to combine belts.
- Working through puzzles one part at a time often works.
- When starting a puzzle, find out where different buildings fit.
- In puzzles without belts, pressing <b>ALT</b> will let you see shapes more easily.
- Don't get worked up! Try looking at things from a different angle.
- If a puzzle has a throughput requirement, remember to split belts in a tree like fashion.
- Think about what order you can create your shapes in.
- Don't get scared by big puzzles, try working through them before giving up.
- Play the tutorial puzzles to find some useful and easy-to-use tricks.
- Remember, staring at a puzzle won't help! Place some blocks and see where you end up.
- Don't forget to like a puzzle if you enjoy it.
- If you run into a puzzle you know is 100% not possible, make sure to report it.
- Been playing a lot of puzzles? If so try creating your own for others to enjoy.
- A unwise man once said "It's been so long, this puzzle is not possible".
- Remember, it is not a speedrun. Take your time and solve the puzzle methodically.
- Remember to take a break every once in a while.
- Producers may have more than one purpose, keep that in mind when modifying their output.
- Some puzzles may only have one place that each building fits, use that.
- Make use of all building variants.
createPuzzleTips:
- Be careful, making a big puzzle might scare future players.
- Remember to disable buildings that aren't useful, unless you're trying to be sneaky.
- Most good puzzles have a "trick" to them, try coming up with one when creating your own
- Once you finish you puzzle, don't publish right away. Always playtest.
- Using complex shapes that don't impact the gameplay of your puzzle could be annoying.
- Misdirecting the player is often the best way to increase difficulty.
- An easy puzzle can be fun too!