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

feat: Add Help Command to CLI #64

Merged
merged 12 commits into from Oct 15, 2020
23 changes: 22 additions & 1 deletion dist/cli.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cli.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 23 additions & 1 deletion src/cli.ts
Expand Up @@ -81,13 +81,35 @@ export default class CLI {
process.exit(1);
},
});

this.keyListener.bindEvent({
keyName: 'h',
handler: function () {
console.log(`
Start => Earth(0, 0)
Goal => Moon(0, 250)

Once Launched, the Ship moves Forward

W -> Increase Forward Speed
S -> Decrease Forward Speed
A -> Move Left
D -> Move Right
Max Speed - 5 speedunit
Min Speed - 1 speedunit (after leaving (0, 0))

Press H -> Show the Ship Reference Manual
Press CTRL + C to Exit
`);
}
});
Comment on lines +85 to +105
Copy link
Owner

@pyymenta pyymenta Oct 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 🥇 🥇 🥇

}

start(): void {
console.log(Welcome);
console.log(Rocket);

this.output.write('(0, 0) ready for launch\n');
this.output.write('(0, 0) ready for launch\nPress H to Show Help\n');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 🚀 🚀

}

launch(): void {
Expand Down