Main Menu

News:

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

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

Shoutbox

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...

GfK

2025-10-15, 21:39:05
I overdosed on jelly babies once and my arse was like the shooty gun bit at the start of James Bond

Amon

2025-10-15, 20:16:38
lol

Jackdaw

2025-10-15, 19:40:48
Never had a Phall or a tinderloo. But I have heard that your backside feels like that map at the start of every episode of Bonanza.

GfK

2025-10-15, 19:22:25
Never confuse phall with phallus

Baggey

2025-10-15, 18:30:58
My mate ate a phall one night. Even that was to hot for me. I bet he suffered in the morning!  :-[

Dabzy

2025-10-15, 18:02:52
I like nice and toasty bit of fire in my bait as well, I used to eat really red hot gear, but nowadays if I do... Heartburn happens! :(

Members
Stats
  • Total Posts: 1,814
  • Total Topics: 224
  • Online today: 17
  • 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