To celebrate the holiday season, I thought it would be fun to create a winter themed game using GameZero.jl. It’s a very simple card matching game, in a little over 200 lines of julia. Try it out from here: https://github.com/aviks/Holiday2022
The images in the game have been generated by stable diffusion. The music is a custom composition featuring a simple chord progression. The keen eyed music geek among you will find a clue in the source.
I think GameZero is a great way to teach Julia, so I hope this example is useful in that context.
Please do try it out, and let me know if you find any bugs, in the instructions, or in the code. Enjoy, and wishing everyone a merry christmas and a happy new year.
on my mac and in order to click the cards accurately you have to imagine the grid being stretched out over the whole window and click the corresponding place.
I’ve seen other UIs have issues with the scaling on mac retina displays.
MacOS has some peculiarity where it reports a window’s framebuffer has half the width and height that it really has. Check for example this issue in GLFW MacOS framebuffer size and window content scale incorrect on external display without high dpi · Issue #1857 · glfw/glfw · GitHub, one needs to adjust for that and GLFW seems to have some related flags. I wanted to look into this as well to understand how to make GLMakie look better on Macs, currently it’s just really small because it uses the retina pixels as if they were normal pixels.
Yeah, so I use GameZero/SDL2 on Windows with a HiDPI display, and it works correctly. It even works with fractional scaling (my monitors are set to 175% and 150% scaling).
SO suggests the answer is to set SDL_WINDOW_ALLOW_HIGHDPI when creating windows, which we do use here , and that seems to work correctly on windows.