Main Menu

News:

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

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

Shoutbox

GfK

Today at 17:45:33
My mop and bucket was £30. 🤨 It's a Vileda one and you stick it in the bucket and press a pedal with your foot and it spins round and dries the mop out AND IT'S BRILLIANT! 👌

Dabzy

Today at 16:19:35
Oh, I can give you a tip right now, no need to wait... Ahem... Pay someone a fiver to do it, even the bucket was a chew! :D ;)

Jackdaw

Today at 16:04:05
Well if the occasion should ever arise, where I need to gift wrap a mop and bucket. I know where to get tips from ;)

Dabzy

Today at 14:24:38
Has anyone ever tried to wrap up a mop? Never again! :D

Dabzy

Today at 12:17:43
Lol, not the ones from Poundland! :D Anyway, I've got a nice box of chocolates and a Prosecco to go in the bucket! ;)

Jackdaw

Today at 11:18:06
@Dabzy I think they will appreciate it. Have you seen how much it can cost for a good mop and bucket set in this day and age.  I can buy a bottle of Blonde chocolate cream liqueur for less at ASDA.

Dabzy

Today at 10:47:41
Well, I'm off out to buy a 60th birthday pressie... A mam of one of me mates... Gonna get her a mop and bucket, and wrap it up, even wrap the noodly mop bits individually... All in Christmas wrapping paper... Should go down well! :D

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!

Members
Stats
  • Total Posts: 1,826
  • Total Topics: 226
  • Online today: 23
  • Online ever: 232 (Oct 08, 2025, 09:18 AM)
Users Online
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