Author Topic: Pascal  (Read 14401 times)

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Pascal
« Reply #30 on: December 07, 2012, 08:52:12 AM »
That's what I thought. I guess it's not so easy on Linux...?
Yes, on Linux all required libraries have to be installed on the destination computer (by the user).
There is however the possibility to deliver the libraries but it's rather complicated with using a shell script to start the application.

Tomaaz

  • Guest
Re: Pascal
« Reply #31 on: December 12, 2012, 11:36:21 AM »
That's probably the next thing I should learn more about, because at the moment I have no idea how could I show Linux examples to someone who doesn't have all required libraries installed. The easiest way is to show... Windows version (it works without problems under Wine), but...

What is the best Pascal forum? Is it that Lazarus one?
« Last Edit: December 12, 2012, 11:38:13 AM by Tomaaz »

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Pascal
« Reply #32 on: December 12, 2012, 12:48:39 PM »
What is the best Pascal forum? Is it that Lazarus one?
That depends. For game development I'd rather recommend www.pascalgamedevelopment.com/ (You can find me there with the nickname Cybermonkey  ;D)
I also ask/discuss on the Lazarus forum but not so much. Most other forums are very Delphi specific.

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Pascal
« Reply #33 on: December 13, 2012, 12:56:21 PM »
For all of you who managed to compile egsl: why not try http://fpbascon.retrogamecoding.org/
It is possible to use all Pascal units with this little translator. (Put it just into you working directory).
Here's a little example:
Code: [Select]
IMPORT egslengine
DIM sprite AS pointer
MAIN
openwindow (640,480,32,"Sprite Test")
colourkey (255,0,255)
sprite = loadimage ("sprite.bmp")
putimage (200,200,sprite)
sync
inkey
closewindow
All keywords must be in uppercase but I recommend to use library functions in lowercase.

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Pascal
« Reply #34 on: December 13, 2012, 03:18:47 PM »
Another one:
Code: [Select]
'ported from my old sdlgraph example

IMPORT egslengine

MAIN
openwindow (640,480,0,"S T A R S")
setframetimer (60)
backcolour (0,0,0)
DIM x [0 TO 500] AS integer
DIM y [0 TO 500] AS integer
DIM z [0 TO 500] AS integer
DIM i, key AS integer

FOR i=0 TO 500
  x[i]=INT (RND*screenwidth())+1
  y[i]=INT (RND*screenheight())+1
  z[i]=INT (RND*8)
NEXT

REPEAT
 clearscreen
  FOR i=0 TO 500
    x[i]=x[i]-z[i]
    IF x[i]<0 THEN
      x[i]=x[i]+screenwidth
    END IF
    colour (255,255,255)
    fillcircle (x[i],y[i],2)
  NEXT 
 
  colour (255,255,0)
  drawtext (INT(screenwidth/2),INT(screenheight/2)-7,"Stars")
  sync
 
  key=getkey
UNTIL key =27
closewindow

You can DIM a variable wherever you want (I hope so: it's alpha software)
Code: [Select]
IMPORT egslengine

MAIN
openwindow (300,200,0,"2D Drawing Test EGSL")
clearscreen
colour (0,0,255)
fillcircle (100,100,50)
colour (0,255,0)
fillbox (150,20,170,40)
colour (255,0,0)
DIM k AS INTEGER
FOR k = 1 TO 20
    line (10,10+k*8,200,0)
NEXT
colour (255,255,255)
drawtext (10,50,"Hello, this is a test")
redraw
inkey
closewindow

Tomaaz

  • Guest
Re: Pascal
« Reply #35 on: December 17, 2012, 11:39:01 PM »
That's a bit to much for me. ;) Lua, Pascal, now BASIC... To be honest, after playing a lot with Lua and Pascal (which, surprisingly, I'm starting to like) I've lost interest in BASIC and, what is even more surprising, it seems... strange to me now (what the hell is NEXT...?  ;D ). :o
« Last Edit: December 17, 2012, 11:40:45 PM by Tomaaz »

Aurel

  • Guest
Re: Pascal
« Reply #36 on: December 18, 2012, 06:50:02 AM »
...xHarbour,Haskel,Erlang.... ;D

Tomaaz

  • Guest
Re: Pascal
« Reply #37 on: December 20, 2012, 06:57:51 PM »
Is it possible to modify egslengine, so it could work with sub-folders. I would like to create one sub-folder for all required libraries to not keep them together with my source codes and egsengine itself (it's a bit messy this way). I'm ready to do it by myself, but need some information and advice.

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Pascal
« Reply #38 on: December 20, 2012, 08:36:29 PM »
Yes, you can add an include path to the compiler.
See the freepascal doc for further information: http://www.freepascal.org/docs-html/user/usersu7.html

Tomaaz

  • Guest
Re: Pascal
« Reply #39 on: December 20, 2012, 08:55:50 PM »
Thanx! It was easier than I thought. :) I just placed egslengine and a new created folder with all required libraries to units folder in FPC directory and now it compiles from any location.