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

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
    • View Profile
    • Home of EGSL
Welcome to the new board for Pulsar2D
« on: 16. November 2013, 22:55:51 »
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: 23. November 2013, 21:40:16 by Cybermonkey »
Best regards,
Cybermonkey

Osgeld

  • Newcomer
  • *
  • Posts: 33
    • View Profile
Re: Wlecome to the new board for Pulsar2D
« Reply #1 on: 17. November 2013, 06:30:07 »
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: 17. November 2013, 06:33:40 by Osgeld »

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
    • View Profile
    • Home of EGSL
Re: Wlecome to the new board for Pulsar2D
« Reply #2 on: 17. November 2013, 11:14:40 »
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).
Best regards,
Cybermonkey

GEEK

  • Jr. Member
  • **
  • Posts: 83
  • want to learn c++, if you want to teach me, pm me!
    • View Profile
Re: Wlecome to the new board for Pulsar2D
« Reply #3 on: 17. November 2013, 22:42:46 »
looks great  ;D

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
    • View Profile
    • Home of EGSL
Re: Wlecome to the new board for Pulsar2D
« Reply #4 on: 18. November 2013, 09:53:37 »
Thanks.
On Windows the messageboxes have a native look btw:
Best regards,
Cybermonkey

Osgeld

  • Newcomer
  • *
  • Posts: 33
    • View Profile
Re: Wlecome to the new board for Pulsar2D
« Reply #5 on: 19. November 2013, 04:14:05 »
so when's beta going to be out?  :D

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
    • View Profile
    • Home of EGSL
Re: Wlecome to the new board for Pulsar2D
« Reply #6 on: 19. November 2013, 09:32:07 »
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
Best regards,
Cybermonkey

tinyBigGAMES

  • Newcomer
  • *
  • Posts: 28
    • View Profile
    • tinyBig GAMES
Re: Wlecome to the new board for Pulsar2D
« Reply #7 on: 21. November 2013, 20:01:08 »
Looking good man. Keep coding!

Respect!
Jarrod Davis
Owner / Technical Director @ tinyBig GAMES
Facebook | Twitter | Youtube

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
    • View Profile
    • Home of EGSL
Re: Wlecome to the new board for Pulsar2D
« Reply #8 on: 21. November 2013, 22:04:34 »
Thanks Jarrod. By the way, it came to my mind that my game engine should work theoretically with Game Pascal once both are finished ...  ;)
Best regards,
Cybermonkey

tinyBigGAMES

  • Newcomer
  • *
  • Posts: 28
    • View Profile
    • tinyBig GAMES
Re: Wlecome to the new board for Pulsar2D
« Reply #9 on: 22. November 2013, 04:09:06 »
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: 23. November 2013, 21:25:47 by piradyne »
Jarrod Davis
Owner / Technical Director @ tinyBig GAMES
Facebook | Twitter | Youtube

GEEK

  • Jr. Member
  • **
  • Posts: 83
  • want to learn c++, if you want to teach me, pm me!
    • View Profile
Re: Wlecome to the new board for Pulsar2D
« Reply #10 on: 23. November 2013, 21:06:07 »
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
  • Hero Member
  • *****
  • Posts: 574
    • View Profile
    • Home of EGSL
Re: Welcome to the new board for Pulsar2D
« Reply #11 on: 23. November 2013, 21:41:59 »
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
Best regards,
Cybermonkey

GEEK

  • Jr. Member
  • **
  • Posts: 83
  • want to learn c++, if you want to teach me, pm me!
    • View Profile
Re: Welcome to the new board for Pulsar2D
« Reply #12 on: 25. November 2013, 08:45:37 »
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: 26. November 2013, 09:32:35 by GEEK »

Osgeld

  • Newcomer
  • *
  • Posts: 33
    • View Profile
Re: Welcome to the new board for Pulsar2D
« Reply #13 on: 26. November 2013, 01:16:05 »
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

  • Jr. Member
  • **
  • Posts: 83
  • want to learn c++, if you want to teach me, pm me!
    • View Profile
Re: Welcome to the new board for Pulsar2D
« Reply #14 on: 26. November 2013, 09:30:54 »
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 (;