Hi everyone,

Last year I was wondering how to build proper desktop applications with Pharo. The best way I found was to start the image headless and open one or multiple windows using the SDL2 binding. Then, it is possible to process SDL2 events in Pharo and to draw using Cairo on the window surfaces.

To do that, I built a small real-time game where each player plays a wizard who can move in 4 direction and cast spells at other players. If a spell (fire-ball like) reaches another player, its character dies and the last wizard alive is the winner.

Here is a video showing the game, and especially how it is started from a script:

I’ve never shared that project as I thought I some point I would look into adding music in the game, but it’s been a year and it seems it’s not going to happen.

One can download a Mac version here (image+VM+ressources):

https://www.dropbox.com/s/oznu4ql95kodfj2/G0.zip?dl=0 => The link is outdated, contact me directly (bera dat clement at gmail dat com) if you are interested.

It worked for me, it could be that it won’t for you due to dependencies (SDL2 may need to be installed or something like that).

There is a Linux start-up script too, but I don’t remember if it is working or just a work in progress.

I hope you enjoyed the contents of this post. Thanks for reading my blog.

Advertisements