Inspiration
I'm from NYC, which is a very densely populated city. In some parts, automobile traffic can be a huge issue, especially when an ambulance comes along. Heavy traffic can prevent ambulances from getting to their destination on time, and can cost human lives.
What it does
A driver can see if an ambulance is approaching on a map and choose a different route to allow the ambulance to pass by.
In the simulation game on the site, a player can control a blue pointer, representing their car, with the ASDW keys to avoid the ambulances and try to get to the blue square. The game also displays a notification on the right side of the map when an ambulance is in close proximity of the player. This notification is meant to mimic the app's notification system for real world automobile drivers.
How we built it
I used p5.js to create the simulation, and simple frontend HTML/CSS for the demo site.
Challenges I ran into
I was very unfamiliar with JavaScript, as the most I've done with the language was count backwards from 10. I basically learnt the whole implementation during this hackathon. The p5.js window also prevents the site from being mobile-friendly because I don't know how to alter the width without impacting the program itself. (insert joke about how no one likes JavaScript here)
I originally hosted the demo site on Repl.it, but then my p5.js file exceeded their free membership limit and they just stopped showing it all together on the site. This meant I had to migrate my files over to Glitch halfway through the process.
Accomplishments that I'm proud of and What I learned
I learned JavaScript syntax and implementation, and how to use p5.js. Now I can actually make websites that are a bit more fun.
I also learned that p5.js is based on Processing, an open source project, that I've used the Java and Python version of before. This helped me brainstorm ideas that were manageable.
Sometimes the p5.js code would glitch on the demo site and the page would need to be reloaded. I still don't know why this happens.
What's next for Ambulert
For this question, I originally wrote that I wanted to add a stopwatch built into the game so that players knew how long they were able to avoid crossing paths with an ambulance. However, I ended up implementing that lol. If possible, I'd like to find a way to use real maps in the game, rather than a plain grid of squares.
Another future implementation would be to generate random hospitals on the map, and have the ambulances take random routes from one hospital to another. This would add some difficulty as the player would have to account for the location of a hospital. I would also like to add a pause feature for the game.
The following has already been implemented:
I would like to add a stopwatch so that players can see how long they played without losing. I would also like to add start and end points for the player to try reaching so that they aren't just moving around aimlessly.
Built With
- css
- html
- javascript
- p5.js

Log in or sign up for Devpost to join the conversation.