Home Page Downloads Order Community Support







PlayBasic Tutorials

     New to programming and need some help getting started ? - Well, then our tutorial section will help kick start your programming adventure. If you're looking for more Source Code / Tutorials & Media ? - Then remember to visit the PlayBasic Resource board on our forums.

Found #19 items

 PlayBasic Tutorial: From Variables To Arrays

By: Kevin Picone Added: September 20th, 2017

Category: All,Video,Beginner,Arrays,Variables,Getting Started

    Welcome PlayBasic programmers, in this tutorial we're going to introduce the concept of arrays starting out from variables. So first we build a simple game loop that controls two characters using only variables. The characters are represented on screen as filled circles.

     After we get up to speed with the variable version we then move onto how we can use parallel integer arrays to store the various properties of the characters. The array version can control as many or as few characters as you like, which is the benefit of Arrays over Variables

Example #1 Variables

PlayBasic Code:
  Xpos1  = 400
   Ypos1  = 300
   Xpos2  = 100
   Ypos2  = 100

   setfps 20   

    cls rgb(10,20,40)

   ; Draw circle 1        
     Circle Xpos1,Ypos1, 32, true
     Xpos1 = Xpos1 + 2
     Ypos1 = Ypos1 - 4
      Xpos1 = WrapValue(Xpos1,0,800)     
       Ypos1 = WrapValue(Ypos1,0,600)     

   ; Draw circle 2      
     Circle Xpos2,Ypos2, 64, true
     Xpos2 = Xpos2 + 2
     Ypos2 = Ypos2 + 2
       Xpos2 = WrapValue(Xpos2,0,800)     
       Ypos2 = WrapValue(Ypos2,0,600)     
Example #2 Array Version

PlayBasic Code:
 Setfps 20

   Number_Of_Characters = 50 

   dim Xpos( Number_Of_Characters  )
   dim Ypos( Number_Of_Characters  )
   dim size( Number_Of_Characters  )
   dim Xspeed( Number_Of_Characters )
   dim Yspeed( Number_Of_Characters )
   dim Colour( Number_Of_Characters )
   for lp = 1 to Number_Of_Characters
         Xpos(lp)  = rnd(800)
         Ypos(lp)  = rnd(600)
         Size(lp)  = rndrange(16,50)
         Xspeed(lp) = rndrange(-5, 5)
       Yspeed(lp) = rndrange(-5,5)
       Colour(lp) = rndrgb()
        Cls rgb(0,400,20)
        for lp=1 to Number_Of_Characters
           Radius = Size(lp)

           circlec xpos(lp),ypos(lp),Radius,true,Colour(lp)
         //  xpos(lp) = Xpos(lp) + Xspeed(lp)
         //  ypos(lp) = ypos(lp) + Yspeed(lp)
           xpos(lp) = wrapvalue(xpos(lp) + Xspeed(lp) , -Radius, 800 + Radius)
           ypos(lp) = wrapvalue(ypos(lp) + Yspeed(lp) , -Radius, 600 + Radius)


 PlayBasic Tutorial: Intro to GOTO & GOSUB statements

By: Kevin Picone Added: April 8th, 2017

Category: All,Video,Beginner

PlayBasic Tutorial: Intro to GOTO & GOSUB statements

     Welcome, in this tutorial we take a look at some none conditional control change statements, or otherwise known as Goto and Gosub statements in PlayBasic.

    Commands used in this tutorial. Goto / Gosub / Return / For / Next / If / EndIf / Mousex() / MouseY() / MouseButton() / Print / Circle / Sync and possibly a few others.

Watch On YouTube


 PlayBasic Tutorial: Into to IF / Then and IF /ENDIF statements

By: Kevin Picone Added: March 21st, 2017

Category: All,Comparisons,If

PlayBasic Tutorial: Into to IF / Then and IF / ENDIF statements ( 2017/03/21)

    This #tutorial walks the new coder through the IF / THEN and IF / ENDIF statement pairs which are used to selectively execute sections of the code, based upon the result of the comparison operators. IF statements actually allow changes in execution control, so they act upon the comparison, but it's just easier to think of them as part of the comparisons landscape when learning programming.


#coding #learntocode #programming #basic #makegames #howto #programmer #code

View On YouTube

PlayBasic Code:
	Setfps 20

		Cls rgb(20,30,40)

		Mx = MouseX()
		My = MouseY()

		Circle Mx,My,40,true

		print Mx
		print My

		box 500,300,600,400,false

		if (Mx > 500) and  (Mx < 600) and  My >300 and My<400
						print "Mouse is within zone"



 PlayBasic Tutorial: Intro To FOR NEXT LOOPS

By: Kevin Picone Added: March 20th, 2017

Category: All,Video,Beginner,Getting Started,Variables,Loops

PlayBasic Tutorial: Intro To FOR NEXT LOOPS (2017-03-19)

    This tutorial takes the new basic coder through the bare bones of the FOR / NEXT loop. The tutorial was recorded live and is uploaded virtually as is, warts and all. In this tutorial we use loops to draw simple graphical objects such as boxes moving through to making a grid of scrolling boxes.

     Commands used in this tutorial. For / Next / Step / Exit / Continue / Print / Line / Box / Sync / Ink / RGB() / RND() / RndRGB() and possibly a few others.

Watch On YouTube


 PlayBasic TUTORIAL: Getting Started with the PB IDE

By: Kevin Picone Added: February 24th, 2017

Category: All,I.D.E,Video,Beginner,Getting Started

PlayBasic TUTORIAL: Getting Started with the PlayBasic IDE

Welcome, this tutorials takes the new programmer around the PlayBasic IDE. Focusing mainly the moving around the help files and some basic IDE usage.

Watch On YouTube


 PlayBasic Tutorial: Intro To Integer Variables & Character Movement

By: Kevin Picone Added: February 24th, 2017

Category: All,Video,Beginner,Getting Started,Variables

PlayBasic Tutorial: Intro To Integer Variables & Character Movement

This tutorials starts out with a brief look Intro To Integer Variables, but soon moves on looking at some really basic user controlled/player movement code.

The commands you'll see in this tutorial are Print, Sync, WaitKey, Do / Loop, SetFps, Circle and If/EndIF

Watch On YouTube


 PlayBasic Tutorial: Hello World

By: Kevin Picone Added: February 18th, 2017

Category: All,Video,Beginner,Getting Started

PlayBasic Tutorial: Hello World - 2017-02-19

Hi BASIC programmers in this tutorial we take a quick look at using the PRINT command in PlayBasic. The video shows the new programmer how the classic "Hello World" program would appear in the PlayBasic programming language. Beyond that the video looks into some other commands such as SYNC, WAITKEY, INK, RGB, LOADFONT and SetCURSOR and gives some basic tips on using the HELP and compiling programs.

So after this video, you'll learn enough to do something but most likely get yourself into more trouble fast.. But that's ok.. Learning to program can feel a lot like walking around in a dark room full hammers at times. You'll bang your head more than once and generally over and over and over again..

Well, have fun..

Watch On YouTube


 PlayBasic Tutorial 1- Hello World Lesson

By: Kevin Picone Added: December 28th, 2010

Category: All,Video,Beginner,Getting Started

     This simple 'fly-on-the-wall' tutorial is aimed at those brand new to PlayBasic programming. The lesson introduces the first time programmer to some of the core commands found in the PlayBasic language.

    The objective of this lesson is to demonstrate how to display text messages such as "Hello World" using the PRINT command. Rather than learn about the boring bits such as Variables / Arrays and control loops up front, here we just want to get something on screen quickly. As such, the tutorial focuses solely upon the PRINT, INK, RGB, SYNC and WaitKEY commands.

    The tutorial is captured in 1440x * 900y resolution. So we recommend watching it in the highest resolution you can. As some of the on screen text can get a bit small otherwise.

    Music By: http://www.ardvarc.net

Related PlayBasic Tutorial Videos:
     * PlayBasic IDE LESSON Load And Run Project

    * PlayBasic IDE Lesson: Running Forum Code

    * PlayBasic IDE LESSON - F1 For Command Help


Viewing Page [1] of [3]

Back - Next

Looking for More Tutorials?:




(c) Copyright 2002 / 2018 Kevin Picone, UnderwareDesign.com  - Privacy Policy   Site: V0.59 [Alpha]