Orbit Clock - a clock with a particle system

Hello everyone, I've just released by first Playdate software, a little clock and particle system.

I've been leaving my Playdate on charge on a phone stand and of course the USB cable is on the bottom so it's at 90 degrees in portrait mode, this clock displays the time correctly whichever way up your Playdate is and looks beautiful with a smooth particle system orbiting a central mass.

There's a few features:

  • Toggle between light and dark theme (press up)
  • Orientation changes in default/landscape, crank at the top, and fully upside down
  • Toggle the central mass visibility (press left)
  • Change the mass amount with the crank
  • Add and remove particles (press A and B)

This is my first Lua project of any kind and it's been a big learning curve (my day job is Kotlin) but I think I have a handle on things now (getting there anyway). I've got a few more things planned for it, mainly persisting settings, before moving on to a proper game.

The learnings from this Orbit Clock will be used to improve Coracle for Playdate, a port of my Kotlin playground to Lua, I had no idea what I was doing with the early development of that, scope and tables have started to make more sense since.



This is very cool!

I left it running in Simulator and got this unexpected error:

coracle/Coracle.lua:180: bad argument #1 to 'abs' (number expected, got nil)
stack traceback:
	[C]: in function 'math.abs'
	coracle/Coracle.lua:180: in function 'isPortrait'
	GravityDrawing.lua:81: in method 'checkOrientation'
	GravityDrawing.lua:73: in method 'draw'
	main.lua:10: in function <main.lua:9>

The orbit code could make a great game like Orbient/Orbital

I'll look into that nil... a lot of this code is going into Calx: Calx by Orllewin which I'll announce here once I've made some more progress, but I'm having far too much fun building it already.

1 Like

That looks fun! Keep up the good work