Yes, it's time to reveal the name for my next Lua interpreter and Free Pascal game engione based on SDL2:
Pulsar2DI just finished the Lua bindings with the so far implemented functions. Here you can se the somewhat comprehensive list:
openwindow
setactivewindow
closeapplication
wait
color
redraw
circle
clearwindow
cls
closewindow
backcolor
inkey
dot
line
getkey
fillcircle
mousex
mousey
mousebutton
ellipse
fillellipse
loadimage
mousehide
mouseshow
keystate
timeleft
setframetimer
colorkey
loadsound
playsound
drawtext
mousezone
loadmusic
playmusic
pausemusic
resumemusic
togglefullscreen
spritewidth
spriteheight
nocolorkey
timerticks
ostype
joystickplugged
getjoyx
getjoyy
getjoybutton
numberjoybuttons
setcaption
triangle
filltriangle
boxcoll
rnd
int
chr
asc
val
left
right
mid
insert
len
time
date
uppercase
lowercase
input
resizewindow
arguments
freeimage
windowwidth
windowheight
bmptext
bmpinput
bmpfont
sqrt
abs
cos
sin
exp
floor
ceil
imagecoll
circlecoll
roundcoll
sidecoll
sync
open
close
finput
eof
eoln
fprint
fileexists
directoryexists
makedir
removedir
changedir
deletefile
system
insidetriangle
insiderectangle
insidecircle
drawtile
tileset
warpmouse
bmpfontheight
bmpfontwidth
rectangle
illrectangle
round
createsprite
freesprite
drawsprite
drawspritepart
spritecolor
setvirtualsize
bmpfontsize
bmpinputcolor
bmpinputbackcolor
bmpfontnagle
textsize
textwidth
textheight
textinputcolor
textinputbackcolor
messagebox
setscalequality
seticon
fullscreen
fademusic
haltmusic
freesound
freemusic
A lot of things have changed, a lot have kept the same. Still missing are sprite animations and particles. These are the next things I wil implement, I just wanted to be sure that the rest is working as expected.
Here is the first example code in Lua:
-- first test of Lua bindings to Pulsar2D
require "scancodes"
win=openwindow ("First Test",-1,-1,1024,768)
setactivewindow (win)
setframetimer (250)
image = loadimage ("media/sprite.bmp")
sprite = createsprite (image)
freeimage (image)
x= 150
y= 250
repeat
key=getkey()
cls()
color (255,255,0,255)
fillcircle (612,356,50)
drawtext ("Hello and welcome to Pulsar2D",10,10)
drawsprite (sprite,x,y,2,2,0,false,true)
if keystate (SCANCODE_LEFT) then
x=x-1
end
if keystate (SCANCODE_RIGHT) then
x=x+1
end
if keystate (SCANCODE_UP) then
y=y-1
end
if keystate (SCANCODE_DOWN) then
y=y+1
end
sync()
until key == SCANCODE_ESCAPE
freesprite (sprite)
closewindow (win)
closeapplication()
With the scancodes.lua one needn't to remember all those numbers. If you want to check the escape key just use SCANCODE_ESCAPE (of course you can use the number if you prefer that but since these are now scancodes they are different from the EGSL keycodes).
A nice thing is that all error message are now inside a message box, so if you type the wrong filename for example... see the attachment.