Home | Rules and Guide | Sign In/Create Account | Write a Post | Donate | #ludumdare on irc.afternet.org (Info)

Ludum Dare 23 — April 20th-23rd, 2012 — 10 Year Anniversary!

Ludum Dare 22 :: December 16th-19th, 2011 :: Theme: Alone

[ Results: Top 50 Compo, Jam | Top 25 Categories | View My Entry ]

[ View All (Compo, Jam) | Warmup ]


Easy Peasy Pascal Library.

Posted by
August 23rd, 2009 6:27 pm

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.

2 Responses to “Easy Peasy Pascal Library.”

  1. Stoney says:

    Nice lib. I’ll be using my own library still, but it’s nice to see someone else besides me is using Pascal. :)

Leave a Reply

You must be logged in to post a comment.


All posts, images, and comments are owned by their creators.

[fcache: storing page]