Easy Peasy Pascal Library.

I’m probably using a new library this time.   It’s not terribly full featured at the moment but what it does have is a simple way to get a nice Fullscreen framebuffer on the OLPC-XO.   I figure If I can write a halfway decent Game during the Ludum Dare then it can be added to the XO’s repertoire.

The source for the library is in here along with a small test program I wrote last week to give it a try.

http://screamingduck.com/Cruft/doodle.tar.gz

I’ll probably be be adding things to the library right up to and most likely during competition time.  If anyone else wants to give the lib a go (Yes, It’s pascal) get in touch and I’ll make sure you’re up to date with the code.

This is how simple a program can be using the Lib.

program demo;
 
 uses
 Drawing,simple16;
 
 var
 pic : tPicture;
 
 procedure Load;
 begin
 ScreenMode(640,480);
 pic := tPicture.loadFromFile('Frog.png');
 end;
 
 var
 X : Single = 320.0;
 Y : Single = 200.0;
 dy : Single =0.0;
 dx : Single =0.0;
 
 procedure Update(ticks : integer);
 begin
 X:=X+dx;
 Y:=Y+dy;
 dx:=dx+ random()*0.2-0.1;
 dy:=dy+ random()*0.2-0.1;
 dx*=0.99;
 dy*=0.99;
 end;
 
 procedure Draw;
 var
 i:integer;
 begin
 ClearScreen;
 DrawImage(pic,X,Y);
 end;
 
 begin
 Run(@load,@update,@draw);
 end.
 

The run procedure calls the Load update and Draw functions at the appropriate times, giving a picture that does an inertial drunkards walk around the screen.

Comments

24. Aug 2009 · 08:52 UTC
Nice lib. I’ll be using my own library still, but it’s nice to see someone else besides me is using Pascal. :)