Main Menu

hi

Started by Dark Flare Knight, July 07, 2005, 05:18:44 PM

Previous topic - Next topic

Dark Flare Knight

hello everyone. i just came to this site, looking for a gaming compiler and saw this. I download it and i have absolutely no idea how to use it and start programming. I currently know a little java and a little c. I am in grade 9, only 15 years-old, going to grade 10 in September so i don't really know much about programming but i still am interested. is there any tutorial for playbasic cause i couldn't find anything on the site.

kevin

Howdy and welcome.

PlayBasic is pretty young, as such, there's isn't a great deal of tutorial information published about it as yet.   There's a few tidbits on the forums here, but all in all, the built in help files are the biggest collection of info. (mostly info about commands though, but there's a few tutorials well wort reading regarding programming).   But when in doubt. Ask a question and somebody well hopefully try and help out.

PB is based upon the BASIC language.  It's a lot more 'open' than languages like Java/C.  


for starters, it' good idea  to mess around with commands that have a visible result.  So you can see what effect these comands actually have, then slowly exand upon that.

I.e



; CLear the screen to red
   Cls  Rgb(255,0,0)
 
; raw a line

   line 100,100,200,200

; Show the screen to the user
   Sync

; Wait for use the press a key before ending
  Waitkey


Dark Flare Knight

How can i input in playbasic?

kevin

OK, but what kind of input ?     Mouse  or  Keyboard  ?

The mouse has a few commands to get it's position and the state of the mouse buttons



Do
 Cls rgb(0,0,0)

 print "Mouse X position:"+str$(Mousex())
 print "Mouse Y position:"+str$(Mousey())
 print "Mouse Buttons:"+str$(MouseButton())

Sync
loop




The keyboard has various commands also

Check out  "inKey$()"  and "Scancode".   These tell you what key was actually pressed.

Some other functions deal with reading certain keys directly, like  LeftKey(), RightKey(), UPkey(),DownKey()   which read the state of the Arrow keys.  


There's various examples in the Projects/Examples/Input folder


I'm guessing though that you might want an "Input String" styled command.  While there is no such command in PB atm, there is an example/function in the  Examples/Input folder also Called "Scancode Input" that does this.