Coder Social home page Coder Social logo

una-ada / gravity Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.09 MB

A game of gravity assist maneuvers. JavaScript browser game for GA SEI-R 5/17 project 1.

Home Page: https://una-ada.github.io/gravity/

License: MIT License

HTML 1.97% JavaScript 92.30% CSS 5.72%
browser-game game gravity-simulation physics-simulation

gravity's Introduction

Gravity

A game of gravity assist maneuvers built in browsers. This is an experimental game using a custom physics engine to simulate gravity!

Getting Started

To play the game as it's deployed on GitHub pages, just navigate to una-ada.github.io/gravity!

To play the most up-to-date version, clone the repository:

git clone https://github.com/una-ada/gravity

then use your choice of local server to run it! (Due to the use of JavaScript modules, the game must be ran on an HTTP server)

Gameplay

There are two "areas" on the game screen: the red play area and the blue target area. Your goal is to launch a Celestial (or "moon") from the play area into the target area.

To launch a Celestial, click in the play area with your mouse and drag the mouse to set the velocity before releasing. Holding the mouse in place before setting the velocity will increase the mass.

You get a limited amount of attempts to get a Celestial into the target area, if you use them all up you lose! Since they can just orbit around or fly off into space indefinitely, the game only determines you've used all your attempts if the last attempt has gone on for longer than 30 seconds.

But, if you manage to get a Celestial into the target area, you win! Hurray!

Technologies Used

This project is written in vanilla JavaScript, CSS, and HTML. The JS uses modules and classes, so the code is all nicely modular (and almost completely OOP, which is fine, I guess).

Future Plans

There's a lot I want to do to expand on this project! Right now, there's only the extreme basics, so here's a full list of everything I want done in the near (or maybe distant) future:

  • Canvas renderer
  • Dynamic reference frames
  • Zoom and scaling to window
  • Move level data displays into JS (currently in HTML)
  • Info displays
    • Mass / velocity of player input
    • '' of objects in scene
  • Settings menu
    • Dark mode
    • Grid
    • Text size
  • Level loading
    • At least 3 levels
    • Level scores based on time and attempts used
    • Different level tasks (win conditions other than hit the target)
  • Collision handler variety
    • Destroy smaller object completely
    • Merge objects
  • Touch inputs

gravity's People

Contributors

una-ada avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.