Being very interested in physics, we thought it would be interesting to provide a way to learn about gravitational mechanics in an easy to understand way. By having a sensitive and realistic game, it makes understanding the concept of gravitation easy.

What it does

We Gravitate is a hyper-realistic game that uses up-to-date information to simulate objects in the gravitational field of others. It also includes a character design tool for the easy addition of other characters by the user.

How we built it

We split the responsibilities of the project among the team surrounding the following elements:

1. Scraping

We used UIPath and its Javascript SDK to scrape real-time data from online regarding information about the different celestial bodies.

2. Pixel art maker

Written in javascript, utilizing HTML tables, the user can color in cells of a table in order to simulate pixel art being made. Things like the bucket tool were implemented using algorithms like flood-fill. The image is then exported as a png for easy use in the game.

3. Game

We used the javascript library "Phaser" in order to create objects using the generated pixel art. Using physics equations, we update the position, velocity, and acceleration of every object several times per second.

4. Website

We uploaded the code to a github repository and linked it to the website using a CNAME DNS configuration

Challenges we ran into

  • Using Phaser was quite difficult. Both of us had limited experience with javascript and no experience with Phaser.

  • Using physics equations that account for more than just basic variables led to some confusion (and apparently some planets that appeared to have negative mass)

Accomplishments that we're proud of

  • Learning how to code in a new language and also learning a library in the span of a couple of days is something that both of us are very proud of.

  • We are also proud of being able to provide a fun and educational resource to the MLH community.

  • Although not coding related, I'm quite proud of the logo I made for this hackathon.

What we learned

  • How to use UIPath to: create tables, create VB variables, scrape data from websites, use conditional statements, and write to a spreadsheet

  • How to use the javascript library Phaser to make games and visual representations of code

What's next for We Gravitate

We want to add more to We Gravitate such that it is even easier to learn from it. We plan on including informational text to show equations and more information about the celestial bodies Submission (This may not work due to slow DNS configuration updates, but usage is shown in the video)

Built With

Share this project: