Author Topic: Welcome to the new board for Pulsar2D  (Read 26350 times)

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Welcome to the new board for Pulsar2D
« on: November 16, 2013, 09:55:51 PM »
Yes, it's time to reveal the name for my next Lua interpreter and Free Pascal game engione based on SDL2: Pulsar2D
I just finished the Lua bindings with the so far implemented functions. Here you can se the somewhat comprehensive list:
Quote
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:
Code: [Select]
-- 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.
« Last Edit: November 23, 2013, 08:40:16 PM by Cybermonkey »

Osgeld

  • Guest
Re: Wlecome to the new board for Pulsar2D
« Reply #1 on: November 17, 2013, 05:30:07 AM »
looks interesting, thanks for your efforts

regarding the scancodes, would it be a big deal to just embed them, nothing that EGSL runs on currently requires non pc keyboard scancodes (IE adb based MAC)?
« Last Edit: November 17, 2013, 05:33:40 AM by Osgeld »

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Wlecome to the new board for Pulsar2D
« Reply #2 on: November 17, 2013, 10:14:40 AM »
Well, as I said you don't need to use the scancodes from scancodes.lua. Just use the numbers instead (you don't have to include scancodes.lua then). But the numbers changed, so better look into the file first. For example escape has the number 41 (used to be 27 on EGSL).

GEEK

  • Guest
Re: Wlecome to the new board for Pulsar2D
« Reply #3 on: November 17, 2013, 09:42:46 PM »
looks great  ;D

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Wlecome to the new board for Pulsar2D
« Reply #4 on: November 18, 2013, 08:53:37 AM »
Thanks.
On Windows the messageboxes have a native look btw:

Osgeld

  • Guest
Re: Wlecome to the new board for Pulsar2D
« Reply #5 on: November 19, 2013, 03:14:05 AM »
so when's beta going to be out?  :D

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Wlecome to the new board for Pulsar2D
« Reply #6 on: November 19, 2013, 08:32:07 AM »
I think the first version will be alpha.  ;) But yesterday I implemented sprite animations with some improvements over the EGSL versions. I have to admit that the animation timer in EGSL is just an integer counting to the given value. In Pulsar2D it's a real timer which means if one specifies e.g. 50 the animation frame changes every 50 ms independently from the FPS limiter. Oh and another thing I want to add this evening: animaton loops. Just like in playsound, if one sets the loop to -1 it's looping forver, a 0 loops once, 1 loops twice etc. And another handy thing will be added: a start frame and end frame. So if a sprite consits out of several animations that's no problem anymore. For example like this one

piradyne

  • Guest
Re: Wlecome to the new board for Pulsar2D
« Reply #7 on: November 21, 2013, 07:01:08 PM »
Looking good man. Keep coding!

Respect!

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Wlecome to the new board for Pulsar2D
« Reply #8 on: November 21, 2013, 09:04:34 PM »
Thanks Jarrod. By the way, it came to my mind that my game engine should work theoretically with Game Pascal once both are finished ...  ;)

piradyne

  • Guest
Re: Wlecome to the new board for Pulsar2D
« Reply #9 on: November 22, 2013, 03:09:06 AM »
Hi, yes it should work indeed. I can't want to try it out and test the GP compiler in more complex situations. Cool man.
« Last Edit: November 23, 2013, 08:25:47 PM by piradyne »

GEEK

  • Guest
Re: Wlecome to the new board for Pulsar2D
« Reply #10 on: November 23, 2013, 08:06:07 PM »
Just saw that you misspelled "welcome" (Wlecome) :p
Still busy with the documentation of EGSL, but I have to work now to so please be patient...

I'm doing the best I can ;)

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Welcome to the new board for Pulsar2D
« Reply #11 on: November 23, 2013, 08:41:59 PM »
Just saw that you misspelled "welcome" (Wlecome) :p
Still busy with the documentation of EGSL, but I have to work now to so please be patient...

I'm doing the best I can ;)
Thanks, I corrected the mistake.
BTW, documentation for Pulsar2D will start soon. This time I will be using Markdown language so it's easy to convert it to all formats: odt, docx, pdf, html or even epub.  :D

GEEK

  • Guest
Re: Welcome to the new board for Pulsar2D
« Reply #12 on: November 25, 2013, 07:45:37 AM »
Ok, good to know, unfortunately I don't know a lot off html  :-\ so maybe I can't help...
Today I can work on the 'EGSL' pdf, I've noticed that there are a few shortcuts (mailed you about that) in the IDE
that are undocumented.
« Last Edit: November 26, 2013, 08:32:35 AM by GEEK »

Osgeld

  • Guest
Re: Welcome to the new board for Pulsar2D
« Reply #13 on: November 26, 2013, 12:16:05 AM »
Quote
de 'EGSL' pdf, I've noticed that there are a few chortcuts (mailed you about that) in de IDE

I can't wait to attempt to read that   ;)

GEEK

  • Guest
Re: Welcome to the new board for Pulsar2D
« Reply #14 on: November 26, 2013, 08:30:54 AM »
woops ;D haha, I was tired,
my native language is Dutch, so I apologize for any grammatical mistakes,
I'm going to spellcheck "THE" pdf if i'm done no worries (;