News

Pascal-Flavoured AGK

by Jim Hawkins

AGK for Pascal is a big step forward for programmers familiar with Pascal and Delphi. I’ve used a whole range of programming languages over almost twenty-five years, but the most productive has always been Pascal, particularly since Delphi arrived on the scene. Where Visual C++ was a labyrinth of intertwined .h, .cpp and countless other files, Delphi’s easy ability to have a range of visual components that could be dragged onto a form and just work remains far superior to any other programming system I’ve come across. But the language has evolved too, with classes and inheritance. It’s a nice, clean way of working, full of power but at the same time, easy to write and read.

Erik van Bilsen’s port of the AGK libraries is excellent. You can either code directly with the AGK-based language itself, or use the very neat scene-based system. A Scene is like a level; it can have its own resources or share them with other scenes. When you leave a Scene and go to another, the resources are automatically freed (unless you choose to preserve them).  In this way you can easily have a Menu “scene” plus two, three, or one thousand and three levels, moving transparently and smoothly between them. All of the AGK demos have been ported to the scene system, so there’s no shortage of example code.

People are almost religious in their adherence to their favourite programming languages, but it’s always worth having a look at something else. I learned to program using Basic on an Apple ][ but abandoned it, never to return, when Pascal arrived. I’ve used Forth, Lisp, C/C++, APL, Modula-2, Oberon  and a host of other flavours, but to get the job done quickly and efficiently Pascal is hard to beat while being easy to learn. Once you discover how powerful Sets are, you’ll be hooked.

All of this comes for nothing if you already own AGK. You can use the free Lazarus IDE, the Free Pascal compiler, and the free AGK for Pascal system which you’ll find in your Order History. Lots of errors you might have made in Basic will be pointed out by the compiler before you even get to the crash and burn stage. Add to this the vast amounts of powerful functions you can include with ease. Want to sort your data as fast as theoretically possible? No problem.  Want to find a word in a list of 100,000 very quickly? No problem. There’s a universe of great stuff available.

AGK for Pascal is now updated to version 1076 of AGK, and adds Android support. Due to the limitations of the Free Pascal compiler, ARMv7 on Android is not yet supported, but is due to be available soon.

We’ll be producing a load of useful tools and goodies, and some tutorials; a beginner’s guide to programming in Pascal; visual project management; and eventually a visual level designer. There will also be some powerful server-side stuff for online games. Get on board!

  • AGK for Pascal wraps all AGK commands into a class model. All you need to use is the AGK unit.
  • AGK for Pascal is scene based. The idea is that your application consists of multiple scenes.
  • AGK for Pascal is very lightweight. It achieves this by using code inlining and static methods wherever possible, so that this wrapper has very little impact on performance.
  • AGK for Pascal has some utilities not found in the AGK library. For example, the TAgkPoint structure simplifies working with 2D points and vectors.
  • AGK for Pascal comes with Pascal versions of almost all sample applications in the original SDK
  • AGK for Pascal currently supports Windows, Mac OS X, iOS and Android (using Delphi or Free Pascal with Lazarus or Xcode).

Share this Article