Author Topic: Pascal  (Read 6381 times)

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
    • View Profile
    • Home of EGSL
Re: Pascal
« Reply #30 on: 07. December 2012, 09:52:12 »
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.
Best regards,
Cybermonkey

Tomaaz

  • Guest
Re: Pascal
« Reply #31 on: 12. December 2012, 12:36:21 »
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: 12. December 2012, 12:38:13 by Tomaaz »

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
    • View Profile
    • Home of EGSL
Re: Pascal
« Reply #32 on: 12. December 2012, 13:48:39 »
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.
Best regards,
Cybermonkey

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
    • View Profile
    • Home of EGSL
Re: Pascal
« Reply #33 on: 13. December 2012, 13:56:21 »
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.
Best regards,
Cybermonkey

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
    • View Profile
    • Home of EGSL
Re: Pascal
« Reply #34 on: 13. December 2012, 16:18:47 »
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
Best regards,
Cybermonkey

Tomaaz

  • Guest
Re: Pascal
« Reply #35 on: 18. December 2012, 00:39:01 »
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: 18. December 2012, 00:40:45 by Tomaaz »

Aurel

  • Regular Member
  • Sr. Member
  • *
  • Posts: 272
    • View Profile
Re: Pascal
« Reply #36 on: 18. December 2012, 07:50:02 »
...xHarbour,Haskel,Erlang.... ;D
new basic pro forum on;
http://basicpro.spacefor.site/smf/
GUEST posting enabled

Tomaaz

  • Guest
Re: Pascal
« Reply #37 on: 20. December 2012, 19:57:51 »
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
  • Hero Member
  • *****
  • Posts: 574
    • View Profile
    • Home of EGSL
Re: Pascal
« Reply #38 on: 20. December 2012, 21:36:29 »
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
Best regards,
Cybermonkey

Tomaaz

  • Guest
Re: Pascal
« Reply #39 on: 20. December 2012, 21:55:50 »
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.