Main Menu

News:

SyntaxBoom, now with pwetty syntax highlighted code boxes! \o/ 

https://www.syntaxboom.com/forum/index.php?topic=96

Shoutbox

Dabzy

2025-10-17, 17:36:22
Well, just have to keep an eyes, even though they said they sorted it like

Jackdaw

2025-10-17, 17:22:26
When I saw it. It was in the very early hours when normal people are fast asleep. Lasted for around half an hour before back to normal.

Dabzy

2025-10-17, 15:02:27
First time I seen it, having me cuppa at work and had a browse... Saw it and I was like "WTF is that!?!", so got on the blower!

Baggey

2025-10-17, 11:22:52
Oh goody. Was getting withdraw symptons!

Jackdaw

2025-10-17, 10:38:44
I saw that the other week, and forgot to query it. Redirects to sedo.parking.

Dabzy

2025-10-17, 10:33:24
Seems we lost the site for a bit there, sorted, basically htaccess went a bit screwy and it was diverting to one of them stupid default search pages... Been on to ionos the host provider and they fixered it! \o/ Had meself a bit of a sweat on there!  ;D

Jackdaw

2025-10-16, 20:00:40
Going to have to try bourbon and beans. That should be an explosive combination.

Baggey

2025-10-16, 13:15:42
I sometimes mix a chicken vindaloo and a Tika Masala together. Awesome  :P

Dabzy

2025-10-16, 05:49:34
And doing the act was the realisation I went for an indian when out... 20mins I was in the thunderbox waiting for me back chaff to cool down!

Dabzy

2025-10-16, 05:48:11
When I was on my "Year On The Blur", aka drinking after getting divorced, I was minging one night, couldnt remember getting home. Anyway, next day, went to work, and needed a poo...

Members
Stats
  • Total Posts: 1,818
  • Total Topics: 226
  • Online today: 19
  • Online ever: 232 (Oct 08, 2025, 09:18 AM)
Users Online
  • Users: 0
  • Guests: 16
  • Total: 16
Welcome to SyntaxBoom. Please login or sign up.

Recent

Game Object Movement and Animation States FPC+Lazarus Version

Started by Jackdaw, Aug 26, 2025, 06:14 PM

Previous topic - Next topic

Jackdaw

A long with the BlitzMax and Cerberus-X version of this example based from a chapter from the book 'Game Programming Patterns'. I've also created a Free Pascal version using SDL2 and the SDL-for-PASCAL bindings, which are listed here.

To compile it you will have to download the Lazarus IDE and SDL2. You can use the tool fpcupdeluxe to build Lazarus IDE from scratch. If using fpcupdeluxe, it's recommended that you build the FIXES-4.0 branch.

Demo video


You will need to download the warpsara-nohelmet-anim-sheet-alpha_1.png file from https://opengameart.org/content/space-sara and place it in a directory called media, and rename it to warpsara-nohelmet-anim-sheet-alpha.png.

If you want to a few simple tutorial on using SDL with PASCAL, then you can find them here.

As this is a multi-platform demo, supporting Windows, Linux and macOS. It will not fit into a single post, so you can download the files from here.

NOTES:
The SDL2 libraries required for Windows and macOS are included, though on macOS you may be better off building your own. On Linux, you can use the SDL2 repositories from your distribution.
On macOS you will also need xcode 16.2 and the command line developer tools installed. If the computer is Apple silicon, then before you extract the zip file. It will need to have the quarantine flag removed by opening a command terminal and executing: xattr -c example_sd2_001.zip.

You can build the dylibs yourself. You will need cmake installed and the SDL2 and SDL2_image. Plus you will need to be familiar with install_name_tool to rename the dylibs @rpath.

Tips for building the libraries on an Apple Mac with CMake GUI, or the command line.
Make sure that the following CMake variables are set.
For SDL2.dylib
CMAKE_BUILD_TYPE: Release
CMAKE_INSTALL_ PREFIX: Set this to the root directory for all the SDL2 libraries to be built. e.g. ~/developer/libraries/SDL2
CMAKE_OSX_ARCHITECTURES: arm64;x86_64
CMAKE_OSX_DEPLOYMENT_TARGET: 11.0.0

For SDL2_image.dylib
All of the above, plus the following.
SDL2_DIR: <path_set_in CMAKE_INSTALL_ PREFIX>/lib/cmake/SDL2
SDL2_MAIN_LIBRARY: <path_set_in CMAKE_INSTALL_ PREFIX>/lib/libSDL2main.a
If you've dug yourself into a hole. Just keep digging. You're bound to come out the other side eventually.

Baggey

Thanks for that. Very interesting Demo. Getting "Game Programming Patterns;)
Running a Pc that just aint. Faster nough. I7-4Ghz, 32Gb Ram, 4Gb Nvidia, 2 x 1Tb SSD's, 2 x 24" LCD's

RETRO everything!

Jesus was only famous because of his Dad