Skip to content

Commit

Permalink
chore: Final fixes before demo (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
BURG3R5 authored Jan 21, 2023
2 parents 28d6b50 + b7a2efe commit 17ef41a
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 30 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ Ugh, I'm tired after all this machining and selling and sciencing, aren't you? L

### Game screen

<img src="images/initial-screen.png" width="464" height="404">
<img src="images/initial-screen.png" width="478" height="422">

### Minify your product

<img src="images/minify-your-product.png" width="464" height="404">
<img src="images/minify-your-product.png" width="478" height="422">

### Hire employees to automate tasks

<img src="images/hire-employees-to-automate-tasks.png" width="464" height="404">
<img src="images/hire-employees-to-automate-tasks.png" width="478" height="422">

### See how low you can go

<img src="images/see-how-low-you-can-go.png" width="464" height="404">
<img src="images/see-how-low-you-can-go.png" width="478" height="422">

## Controls

Expand Down
Binary file modified images/hire-employees-to-automate-tasks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/initial-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/minify-your-product.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/see-how-low-you-can-go.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/game/calculate.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import Actions from "./actions";

function sell() {
const numbersSold: number =
globalThis.TRUCK_VOLUME / Math.pow(globalThis.size, 3);
const numbersSold: number = globalThis.TRUCK_VOLUME / globalThis.size;
globalThis.money += numbersSold * globalThis.UNIT_COST;
console.log("Sold!");
}
Expand Down
22 changes: 12 additions & 10 deletions src/game/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export default function initVariables() {
globalThis.TRIM_PERCENT = 0.05;
globalThis.RESEARCH_MULTIPLIER = 0.95;

globalThis.SALESMAN_COST = 25;
globalThis.ENGINEER_COST = 100;
globalThis.RESEARCHER_COST = 1000;
globalThis.SALESMAN_COST = 20;
globalThis.ENGINEER_COST = 200;
globalThis.RESEARCHER_COST = 2000;
globalThis.TRIM_COST = 10;
globalThis.RESEARCH_COST = 100;

Expand All @@ -37,12 +37,13 @@ export default function initVariables() {

//Title ASCII art from https://fsymbols.com/text-art/
globalThis.title =
" ███╗ ███╗ ██╗ ███╗ ██╗ ██╗ ███████╗ ██╗ ██╗ ██╗  █████╗ ███╗ ██╗ ██████╗\n" +
" ████╗ ████║ ██║ ████╗ ██║ ██║ ██╔════╝ ██║ ╚██╗ ██╔╝ ██╔══██╗ ████╗ ██║ ██╔══██╗\n" +
" ██╔████╔██║ ██║ ██╔██╗██║ ██║ █████╗ ██║ ╚████╔╝ ███████║ ██╔██╗██║ ██║ ██║\n" +
" ██║╚██╔╝██║ ██║ ██║╚████║ ██║ ██╔══╝ ██║ ╚██╔╝ ██╔══██║ ██║╚████║ ██║ ██║\n" +
" ██║ ╚═╝ ██║ ██║ ██║ ╚███║ ██║ ██║ ██║ ██║ ██║ ██║ ██║ ╚███║ ██████╔╝\n" +
" ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══╝ ╚═════╝\n" +
"\n" +
" ███╗ ███╗ ██╗ ███╗ ██╗ ██╗ ███████╗ ██╗ ██╗  █████╗ ███╗ ██╗ ██████╗\n" +
" ████╗ ████║ ██║ ████╗ ██║ ██║ ██╔════╝ ╚██╗ ██╔╝ ██╔══██╗ ████╗ ██║ ██╔══██╗\n" +
" ██╔████╔██║ ██║ ██╔██╗██║ ██║ █████╗ ╚████╔╝ ███████║ ██╔██╗██║ ██║ ██║\n" +
" ██║╚██╔╝██║ ██║ ██║╚████║ ██║ ██╔══╝ ╚██╔╝ ██╔══██║ ██║╚████║ ██║ ██║\n" +
" ██║ ╚═╝ ██║ ██║ ██║ ╚███║ ██║ ██║ ██║ ██║ ██║ ██║ ╚███║ ██████╔╝\n" +
" ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══╝ ╚═════╝\n" +
"\n" +
" ███╗ ███╗ ██╗ ██╗ ██╗ ████████╗ ██╗ ██████╗ ██╗ ██╗ ██╗\n" +
" ████╗ ████║ ██║ ██║ ██║ ╚══██╔══╝ ██║ ██╔══██╗ ██║ ╚██╗ ██╔╝\n" +
Expand All @@ -51,5 +52,6 @@ export default function initVariables() {
" ██║ ╚═╝ ██║ ╚██████╔╝ ███████╗ ██║ ██║ ██║ ███████╗ ██║\n" +
" ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═╝\n";
globalThis.instructionLine =
"Press '1' to sell, '2' to trim, '3' to research\n";
"Press '1' to sell, '2' to trim, '3' to research\n" +
"Press '4', '5' or '6' to hire salesmen, engineers or scientists respectively\n";
}
27 changes: 13 additions & 14 deletions src/game/output.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as vscode from "vscode";
var scino = require("scino");
import scientific from "../utils/scino";

function updateLoader(): string {
var scalingFactor =
Expand All @@ -23,15 +23,14 @@ function updateStrings(): {
(globalThis.numberSalesmen.toString() + "]").padEnd(15, " ") +
"| Bank " +
"│\n" +
"│ Qty: " +
scino(globalThis.TRUCK_VOLUME / Math.pow(globalThis.size, 3), 6).padEnd(
23,
" "
) +
"│ Revenue: $" +
scientific(
(globalThis.UNIT_COST * globalThis.TRUCK_VOLUME) / globalThis.size
).padEnd(18, " ") +
"│ Cost: $" +
scino(globalThis.SALESMAN_COST, 6).padEnd(21, " ") +
globalThis.SALESMAN_COST.toString().padEnd(21, " ") +
"| $" +
scino(globalThis.money, 6).padEnd(27, " ") +
scientific(globalThis.money).padEnd(27, " ") +
"│\n";
var trimLine =
"│ 2. Trim " +
Expand All @@ -40,11 +39,11 @@ function updateStrings(): {
"│ Size " +
"│\n" +
"│ Cost: $" +
scino(globalThis.TRIM_COST).padEnd(21, " ") +
globalThis.TRIM_COST.toString().padEnd(21, " ") +
"│ Cost: $" +
scino(globalThis.ENGINEER_COST, 6).padEnd(21, " ") +
globalThis.ENGINEER_COST.toString().padEnd(21, " ") +
"│ " +
scino(globalThis.size, 6).padEnd(28, " ") +
scientific(globalThis.size).padEnd(28, " ") +
"│\n";
var researchLine =
"│ 3. Research " +
Expand All @@ -53,11 +52,11 @@ function updateStrings(): {
"│ Minimum Size " +
"│\n" +
"│ Cost: $" +
scino(globalThis.RESEARCH_COST).padEnd(21, " ") +
globalThis.RESEARCH_COST.toString().padEnd(21, " ") +
"│ Cost: $" +
scino(globalThis.RESEARCHER_COST, 6).padEnd(21, " ") +
globalThis.RESEARCHER_COST.toString().padEnd(21, " ") +
"│ " +
scino(globalThis.minimumSize, 6).padEnd(28, " ") +
scientific(globalThis.minimumSize).padEnd(28, " ") +
"│\n";
return { sellLine, trimLine, researchLine };
}
Expand Down
20 changes: 20 additions & 0 deletions src/utils/scino.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const scino = require("scino");

export default function scientific(num: number): string {
if (num === 0) {
return "0";
}

const result = scino(num, 3);

if (
result.endsWith("10⁰") ||
result.endsWith("10¹") ||
result.endsWith("10⁻¹") ||
result.endsWith("10²")
) {
return num.toFixed(2);
}

return result;
}

0 comments on commit 17ef41a

Please sign in to comment.