Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprout Slipvector game #2

Open
wants to merge 1 commit into
base: 0.X
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions slipvector/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"deno.enable": true
}
20 changes: 20 additions & 0 deletions slipvector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Slipvector

The Slipdrive brought the stars within reach. Catalog the universe as the pilot
of an exploration Slipship. Survey star systems rich with resources. Engineer
and assemble our new homes among the stars. Govern the systems and earn your
legacy in the annals of interstellar democracy.

## How To Play

1. [Install Deno](https://deno.land/#installation)
2. Run `deno run slipvector.js`
3. Play!

## Contributing

See [the Zinc Contributor Guide](https://www.zinc.coop/).

## Product Roadmap

See [the Slipvector Roadmap](https://github.com/orgs/zinc-collective/projects/6)
48 changes: 48 additions & 0 deletions slipvector/slipvector.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { readLines } from "https://deno.land/std/io/bufio.ts"

class SlipCommand {
execute() {
console.log('The slipdrive pulses.')
}
}

class HelpCommand {
execute() {
console.log('The unscanned vastness surrounds you. You consider slipping to another system.')
}
}
class ScanCommand {
execute() {
console.log('There are nine-ish significant bodies orbiting a yellow star.')
}
}
const commands = {
"scan": new ScanCommand(),
"slip": new SlipCommand(),
help: new HelpCommand()
}


const endGame = () => {
console.log('Goodbye, Explorer!')
}

const beginGame = async () => {
console.log('Welcome, Explorer!')
for await (const line of readLines(Deno.stdin)) {
if (commands[line]) {
commands[line].execute();
} else if (line == 'exit') {
return;
} else {
commands.help.execute();
}
}
}




window.addEventListener("load", beginGame);
window.addEventListener("unload", endGame);