Inspiration

We started with cuHacking 7's QNX embedded-hardware challenge, but pivoted once we realized none of us had strong embedded/hardware experience. We landed on something more physical and playful instead; What if you could play golf across the entire Carleton campus, using your phone as the club?

What it does

CampusGolf turns your phone into a golf club and Carleton's campus the course. Players get a starting point and a "cup", both real GPS locations, then physically swing their phone to hit the ball. Swing strength is calculated with data taken from the phone's real accelerometer. The ball's distance and direction show up on screen, and you walk to wherever it landed to swing again, repeating until you sink it.

As you walk, the game recognizes real campus buildings by GPS proximity and surfaces facts and 'deep' lore about Carleton history/student life!

CampusGolf supports both solo and two-player modes through private lobby codes. Players see synchronized locations and golf balls, then compete to finish the course in the fewest swings.

How we built it

  • Live positioning: user location is fetched with Geolocation API in the browser, sent to the server through Socket.IO and rendered on a Leaflet/OpenStreetMap campus map
  • Motion swing: DeviceOrientation Event API and DeviceMotion Event API allow us to get phone motion sensor data to estimate swing strength and direction; the formula for swing distance is \(d\) in meters, where \(d=25\sqrt{x}+25\) is the maximum instantaneous acceleration recorded in \(m/s^2\)
  • Multiplayer: private lobby codes, synchronized player and ball locations, shared timers, scoring, and result screens
  • Campus data: 44 Carleton buildings with coordinates and researched facts
  • AI assistance: Claude/Gemini (greatly) helped with implementation, debugging and consulting during development

Challenges we ran into

  • We pivoted from a QNX hardware idea, then from a GPS powerup game, before landing on phone golf
  • Phone sensors and GPS are noisy in the real world, especially under hackathon conditions
  • GPS positional uncertainty turned out to be quite large when inside buildings
  • We had to keep multiplayer, map state, swing counts, timers, and results synchronized
  • Getting historical data (and especially precise location) took quite a lot of time, especially since search continuously ragebaited us with Carleton College, NOT Carleton University

Accomplishments that we're proud of

  • A responsive and accurate swing mechanic
  • Cool golf ball particles and graphics! (<- this one is our favorite)
  • A two-player lobby and synchronized multiplayer game loop
  • A complete playable loop from lobby creation to course results
  • We consulted our 'professional insider' for student life at Carleton and learned stuff!

What's next for CampusGolf

  • Expand to other universities with swappable campus datasets
  • Add building collision physics using real campus geometry
  • Integrate proximity-based trivia deeper into the live interface
  • Improve swing calibration and course design
+ 2 more
Share this project:

Updates