News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

PlayBasic IDE - Getting Started Tutorial

Started by kevin, February 29, 2008, 08:59:08 AM

Previous topic - Next topic

kevin




PlayBasic IDE - Getting Started Tutorial:

Document Revision: V0.06  -  Last Updated: 25th, Jan, 2015




Q. What is this ?  


      A.  This tutorial (in the form of an FAQ) is to help people new to PlayBasic, find their way around the PlayBasic IDE (The editor) so they can start  testing the included projects, or start experimenting with their own projects.


      Please Note:  Users should view this tutorial as a guide, the PlayBasic / Project packs/ PlayBasic IDE etc may have been updated/changed since this tutorials was original written. None the less, the processes explained here should be pretty much the same regardless of any cosmetic differences between versions.




Q. Where can I download PlayBasic  ?  


      A.  From the downloads section www.PlayBasic.com home page.   Once you've downloaded the program, you'll then need to execute the installer (just click on it).  This will launch  the installation procedure.





Q. Launching PlayBasic  ?  


      A.  Assuming you've already been able to download and install PlayBasic,  how do we start it ? -  You can start PlayBasic via the icon on your desk top, or through the WINDOWS START menu.  

          To launch the from the ICON    - just click the icon on your desk top.   The PlayBasic IDE should now appear.

           To launch the from the START MENU -  Go To My Programs/ All Programs, you'll find PlayBasic installs under the UWDESIGN label (The publisher).  Inside this Label will be the PlayBasic folder, inside that you'll find the PlayBasic program (The one with the dolphin icon)-  So if you select that, the PlayBasic IDE should now appear.






Q. What does the PlayBasic IDE look like ?  


      A.  Once you've launched PlayBasic, the program starts up PlayBasic IDE.   The IDE is our program code editor.  You can think of it much like a Word Processor /Text editor, as it works much the same way as windows accessory programs such as NotePad / WordPad do.  In the way it lets the users type text, cut / paste, search / replace text etc etc.   The difference being, is that IDE is specialized for writing programming code for PlayBasic, rather than a letter, a movie script or a shopping list perhaps :).  


 

 
 
     

   Note  - You'll notice that we start PlayBASIC IDE, it automatically creates a blank Project Window called  Project1  - If you click this window, you'll notice you can start typing whatever you want into it.    You might even notice that certain words are highlighted (coloured),  these words are commands/functions in the PlayBASIC language.   Remember, PlayBASIC is a programming language.  The commands it uses are English like,  but it can't understand English sentences.


    For a kick start on leaning some BASIC programming with PlayBASIC check out Beginners Guide To Basic Game Programming (Index)





Q. Cut and Pasting code into PlayBasic IDE  ?  

   
    A.  If you've browsed around the forums, you've no doubt noticed people often include snippets of PlayBASIC source code in their posts.   People do it for all sorts of reasons, the main one is that's a quick and easy way to show somebody (like you the reader) how a particular effect / method can be achieved.   But how do readers use it ? - Well, to try any snippet out,  we cut and paste the code into a blank project (like the default Project1) and then execute it.


    Ok, so here's some example PlayBASIC code (bellow).  First select this in your browser. To do so, left click on the upper left hand corner of the CODE box, then drag the mouse down & to the right to select all of the code.    Once selected, press CTRL-C  to copy the highlighted text to Clipboard.

  Sample Program Code.

PlayBASIC Code: [Select]
    // display the message HELLO WORLD on the screen in the top left corner.
Print "Hello World"

// Show the screen to the user
Sync

// Wait for a key press before ending and returning to the IDE.
WaitKey





   Next, switch to the PlayBASIC IDE, then click on the default blank project (project1) to select it (if it's not already).  Once selected, press CTRL-V  to paste whatever text (the code snippet hopefully) we  copied from the this post, into this project1.
 
   When we do this, the PlayBASIC IDE will highlight the code for us. Which should look something like this.

 

 
 


    Now all that's left to do is tell PlayBasic to run it.  We can do this by simply Pressing F5 -  Congratulations you've now executed your very first program in PlayBasic.  As for how it works,  well if you click any of the Highlighted words and press F1,  you'll be shown the HELP on this particular command (    See VIDEO PlayBASIC IDE LESSON - F1 For Command Help).  As for what each command does individually, that's all covered in the HELP and various TUTORIALS here on the boards.



    I should point out, that while posting Code snippets on the board is great of way of sharing code with others, but it has it's limits.   Namely,  if a code fragment is very long or requires media (such as Graphics / Sound) then a better way to share those is via zipping everything up and attaching that to a forum post.  That way, users can download the whole thing, unzip it, load and execute it.




 




Q. How Do I LOAD/OPEN an RUN an Example   ?  


      A.  PlayBasic generally comes with a small to medium selection of Examples included with the package.  This package normally consists of some DEMOS, GAMES , EXAMPLES and TUTORIALS sections.    

      To open a project, first we go to FILE and select the OPEN PROJECT option.   Which should look something like this.

 
 

       This will pop up the OPEN project dialog.  By default this dialog will always show us the PlayBasic Projects folder.    Which should look like this.



 
 
 

      In this version of the project pack you'll see various folders.  The main one's of interest will be the DEMOS, GAMES , EXAMPLES and TUTORIALS folders.    

      DEMOS   - This folder contains generally smaller demonstration projects, which are mostly visual effects, or demo'ing some inbuilt feature.  
      GAMES    - This folder contains some sample Games.  
      EXAMPLES  - This folder contains usage examples of most of the commands in the PlayBasic  language.  
      TUTORIALS  - This folder contains some examples that tend to focus upon game programming basics.



      Ok, lets carry on,  In this example i'm going to click the DEMOS folder and select a demo called FUNGUS.   The selection should look something like this


 
 


      After entering the Demos/Fungus folder, we'll find this examples PROJECT file,  which in this case is called Fungus.pbp.   All PlayBasic Project files have the extension .PBP.   When loading a project, the PlayBasic IDE will filter out all other file types, except .PBP files and FOLDERs.  So they're pretty easy to find.

      So the project file through the open dialog should look something like this.


 
 

      To load project either select the  file Fungus.php then click OPEN or just double click the Fungus.php file.   This will load the project and it's associated source code files into the PlayBasic IDE, ready for you to RUN or Start Editing/Changing it.  


      After the loading the project,  we'll should see something like this.   You'll notice the IDE loaded the Fungus project as completely separate window to the default 'blank' project.   This is to ensure that loading a new project doesn't overwrite what you were currently working on.  As sometimes it's handy to load multiple projects in together and then cut/paste code fragments from one to the other.  



 
 


      This is all well and good, but how to RUN the example ?.  

      You can compile & run any example, using any of the following methods.


      Press F5  - You can run the current example that selected in the IDE by pressing the F5 key.  

      RUN Menu - If you look at the top menu of the ide you'll notice an menu option called RUN,  under which there's a option called RUN.  Select this to compile and run the current example.


 
 


      RUN from the TOOL BAR - Just under the menu's across the top of the PlayBasic IDE, you'll notice there's a row of graphical Tool Bar icons. These icons are arranged into related groups and are basically short cuts for commonly used functions found in the menu.    

      If you look at the row of icons, you'll notice a RUN      (PLAY Button) icon just past the half way point.    If you click this button, the IDE will compile and RUN the current project.


 
 


       And regardless of the whatever method you use to RUN the Project,  here's a picture what the fungus.pbp program creates.  


 
 




   And hey presto you're now up to speed on how we load projects and execute them in PlayBasic IDE


   Still confused ? - Try Watching this VIDEO lesson then on you tube. PlayBASIC IDE LESSON Load And Run Project


   







Q. Where can I find more HELP on using the PlayBasic IDE ?  


     A.  The PlayBasic IDE contains two help systems.  One for the IDE and the other is language reference (it tells you the PlayBasic commands do).   The IDE help us located under the HELP menu and is labeled IDE HELP.  
   
       Which looks something like this.



 
 
   

       Once  you bring up the IDE help, the window looks like this.  From  here you can learn more about the in's and out of using the PlayBasic IDE.



 
 


 

   Also, check out the PlayBasic IDE FAQ