Gabriel Uribe

How to make your first visionOS game πŸ₯½

β€’

Last month, I decided that I wanted to ship my first visionOS app:

Considering that I didn't have any experience with visionOS going into my solo hackathon, as long as you're able to code, you can do this too.

Link to this headingHow to start

Before you start doing anything, I'd recommend a few steps:

  1. Imagine what you'd like to build.
  2. Cut the scope in half, because it's going to be more difficult than you expect for your 1st thing.
  3. Watch a few videos about spatial computing on visionOS from Apple.
  4. Download the most relevant reference projects from the Apple docs to you. Project list:
  5. Check out example projects on GitHub to reference.
    • There's a decent chance someone has built some aspect of what you're trying to build.
  6. Start building!

Link to this headingActually building the game

Now that you have a rough idea and sense of what you can do with visionOS APIs, you can get going.

I personally recommend skimming my hackathon thread, as it gives you a good sense of how to peel back the onion to get where you want.

These are the steps I took:

  • programmatically adding a red cube at 0,0,0 and had it move in a fixed direction at a fixed speed.
  • made it so that if the player pinched, blue cubes would appear and move away from the player.
  • added collision detection so red cubes would disappear when blue cubes collided with them
  • continuously spawn more red enemy cubes
  • added game over state if red enemy cube makes it to player
  • added game over window
  • added 3D, animated dragon model to replace red enemy cube
  • added a skybox so it felt like we were in a game-like environment
  • added a basic particle emitter so the pinch to cast spell would look and feel like a fireball
  • now with core game loop in place, started actually tuning for game difficulty
  • added high score tracking (# of dragons slain)
  • added music and SFX
  • Final QoL improvements to eg particles, enemy placement, menu cleanup
  • Use AI to generate app icon and other App Store assets

By the end of it, I had a game called Moros: Academy that I was able to upload to the visionOS App Store. Simple, but effective. And it's all open-source on GitHub.

My advice to you: think about what the above list might look like for your idea. You can either reverse engineer from the end result, or imagine it at 0 like I did.

And generally, I highly recommend placing constraints on yourself for this first app or game so that you finish with something. I found that necessary for myself here.

Finally, if you got something out of this and/or would like to see additional detail, I'd love to hear from you on X (formerly Twitter) or LinkedIn.

Link to this headingRelated

Link to this headingLooking for more posts?

Looking for a full-stack Next.js/iOS/visionOS developer for your project? Email us at hello@skyporch.co.