Skip to content

Commit

Permalink
Fixed grammer, Update Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthroy12 committed Jul 12, 2022
1 parent f2ce50d commit d6b5336
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 13 deletions.
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,28 @@
</div>


![Screenshot](./screenshots/screenshot1.png)
![Screenshot](./screenshots/screenshot.png)

Gravity sandbox is a simple gravity simulator based on Newton's law of universal
gravitation.
Gravity Sandbox is a fun toy/game where you can play with Newtonian Gravity. Place heavy objects in patterns and see interesting results.

It's a web-based simulation so no need to install anything, just visit
It's a web app so no need to install anything, just visit
[the website](https://gravity-sandbox.netlify.app/) to play the game

## Controls

- ![play/pause button](./screenshots/play-pause-btn.png) To play and pause
- ![pan/place button](./screenshots/pan-place-btn.png) To Pan/Place Mode
- ![clear button](./screenshots/clear-btn.png) To clear the canvas
- Click on the body while in pan mode to follow
On the left side, there are 5 buttons for Play/Pause, Place Mode, Pan Mode, Selection Mode, Clear All, and Load Presets.

On the right side, the `Mass` and `Color` properties are for new bodies and `Speed` and `Gravity` are for simulation.

## Shortcuts

- Pause/Play: `space`
- Place Mode: `p`
- Pan Mode: `h`
- Selection Mode: `s`
- Clear `All: c`
- Undo: `CTRL + Z`
- Redo: `CTRL + Y`
- Delete Selection: `delete`
- New File: `CTRL + M`
- Save File: `CTRL + S`
9 changes: 4 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,15 @@
<span class="close-btn">Close</span>
<h2 style="text-align: center;">Gravity Sandbox</h2>
<p>
Gravity Sandbox is a fun toy/game where you can play with Newtonian Gravity
by placing heavy objects in patterns and see intersting results.
Gravity Sandbox is a fun toy/game where you can play with Newtonian Gravity.
Place heavy objects in patterns and see interesting results.
</p>
<h3>Controls</h3>
<p>
On the left side there are 5 buttons for Play/Pause, Place Mode, Pan Mode, Selection Mode,
Clear All, and Load Presets.
On the left side, there are 5 buttons for Play/Pause, Place Mode, Pan Mode, Selection Mode, Clear All, and Load Presets.
</p>
<p>
On the right side the <code>Mass</code> and <code>Color</code> properties are for
On the right side, the <code>Mass</code> and <code>Color</code> properties are for
new bodies and <code>Speed</code> and <code>Gravity</code> are for simulation.
</p>
<h3>Shortcuts</h3>
Expand Down
Binary file removed screenshots/clear-btn.png
Binary file not shown.
Binary file removed screenshots/pan-place-btn.png
Binary file not shown.
Binary file removed screenshots/play-pause-btn.png
Binary file not shown.
Binary file added screenshots/screenshot.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 removed screenshots/screenshot1.png
Binary file not shown.
1 change: 1 addition & 0 deletions src/Universe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export default class Universe {
}

clear() {
this.undoHistory.push({type: "delete", bodies:this.bodies})
this.bodies = [];
this.previousPlacedCoords = {};
}
Expand Down
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ window.addEventListener('load', () => {
switchMode("add");
} else if (e.key === "c" || e.code === "C") {
U.clear();
updateInfoBar();
} else if (e.ctrlKey && (e.key === "z" || e.code === "Z")) {
e.preventDefault();
undo();
Expand Down

0 comments on commit d6b5336

Please sign in to comment.