List All Pages
2D
2D games are the general focus of PlayBasic. foldunfold Table of Contents 2D Position 2D Position Functions 2D Arrays Related Pages Tutorials 2D Position A 2D game is has in two dimensions : up...
A ActiveX is… ActiveX...
A.I. stands for artificial intelligence. Simple A.I. Behaviors Avoiding Source Code Avoidance A.I. Demo Following Source Code Follow A.I. Demo Related Pages Categories: A.I.
An Alarm is a kind of timer that triggers something else to happen. Alarms are useful for when you want to count down time. These include simple countdown timers, a time limit for the player to...
Ammo is a stat. Clips Clips and Ammo Code This is an example of managing both clips and ammo. SetFPS 60 ammo = 5 clip = 3 message$ = "" messageTimer = 0 Do messageTimer =...
An angle is a measurement of rotation around a central point. Related Pages Degree Direction Math Point Radian Rotation Documentation GetAngle2D() WrapAngle() Categories: Math
The arithmetic operators are the primary way to do math in PlayBasic. In the examples below, the result of the arithmetic operation are directly displayed using Print Addition The addition operator...
Arrays are data structures that can contain more than one piece of data of a single data type. Uses of Arrays Arrays hold multiple pieces of data. They are useful when any data structure is needed...
Backgrounds are graphics that are drawn first so that they appear behind active game objects and foregrounds. Drawing Backgrounds In the example code below, the green square is drawn first so that...
Welcome to our growing beginner's guide. Get PlayBasic To follow along with the tutorials you will find here, you will need to have a copy of the PlayBasic software. You can download the latest...
In this beginner tutorial you will learn beginner programming and the basics of using the PlayBasic software. If you have never programmed a game before, you should read this tutorial first. Part...
Binary relates to numbers in binary notation, as computers actually use them. Binary Notation Binary notation is written using a percent sign % in front of the binary number : %101 ; binary for...
A camera is Camera...
Categories: {$list}
This category that collects pages that relate directly to ActiveX. Subcategories Pages in category 'ActiveX' Categories: PlayBasic
This category that collects pages that relate directly to A.I.. Subcategories Pages in category 'A.I.' Categories: PlayBasic
This category that collects pages that relate to arrays. Subcategories Pages in category 'Data' Categories: Data : Data Structures : PlayBasic
This category that collects pages with source code suitable for beginners. Subcategories Pages in category 'Beginner Source Code' Categories: Source Code
This category that collects pages that are beginner tutorials. Subcategories Pages in category 'Beginner Tutorials' Categories: Tutorials
This category that collects pages that relate to working with binary numbers. This category is dedicated to 10b, the binary madman. Subcategories Pages in category 'Binary' Categories: Data :...
This category that collects pages that relate to using a camera. Subcategories Pages in category 'Camera' Categories: Graphics : PlayBasic
This category that collects pages that relate to collision. Subcategories Pages in category 'Collision' Categories: Physics : PlayBasic
This category that collects pages that relate to color. Subcategories Pages in category 'Color' Categories: Graphics : PlayBasic
This category that collects pages that relate to using the compiler. Subcategories Pages in category 'Compiler' Categories: PlayBasic
This category that collects pages that relate to constants. Subcategories Pages in category 'Constants' Categories: Data : Data Structures : PlayBasic
This category that collects pages that relate to the core commands of the PlayBasic programming language.. Subcategories Pages in category 'Core Commands' Categories: PlayBasic
This category that collects pages that relate to data. Subcategories Pages in category 'Data' Categories: PlayBasic
This category that collects pages that relate to data structures. Subcategories Pages in category 'Data Structures' Categories: Data
This category that collects pages that relate to debugging Playbasic code. Subcategories Pages in category 'Debug' Categories: PlayBasic
This category that collects pages that relate to files. Subcategories Pages in category 'Files' Categories: Data : PlayBasic
This category that collects pages that relate directly to fonts. Subcategories Pages in category 'Fonts' Categories: Graphics : PlayBasic : Text
This category that collects pages that relate to functions. Subcategories Pages in category 'Functions' Categories: PlayBasic
This category that collects pages with source code for games. Subcategories Pages in category 'Game Source Code' Categories: Source Code
This category that collects pages that relate directly to graphics. Subcategories Pages in category 'Graphics' Categories: PlayBasic
This category that collects pages with source code relating to graphics. Subcategories Pages in category 'Graphics Source Code' Categories: Graphics : Source Code
This category that collects pages that are graphics tutorials. Subcategories Pages in category 'Graphics Tutorials' Categories: Tutorials
This category that collects pages that are How To's. Subcategories Pages in category 'How To' Categories: PlayBasic : PlayBasic Wiki : Tutorials
This category that collects pages that are documentation pages of image functions. Subcategories Pages in category 'Image Functions' Categories: Functions : Images
This category that collects pages that are related to images. Subcategories Pages in category 'Images' Categories: Graphics : PlayBasic
This category that collects pages that relate to input. Subcategories Pages in category 'Input' Categories: Data : Playbasic
This category that collects pages that are related to interfaces. Subcategories Pages in category 'Interfaces' Categories: PlayBasic
This category that collects pages that relate to using the keyboard. Subcategories Pages in category 'Keyboard' Categories: Input
This category that collects pages that relate to loops. Subcategories Pages in category 'Loops' Categories: PlayBasic
This category that collects pages that relate to using PlayBasic maps. Subcategories Pages in category 'Maps' Categories: PlayBasic
This category that collects pages that relate directly to math. Subcategories Pages in category 'Math' Categories: PlayBasic
This category that collects tutorials that relate to math and how it is used to create games. Subcategories Pages in category 'Math Tutorials' Categories: Math : Programming Tutorials :...
This category that collects pages that relate to working directly with computer memory. Subcategories Pages in category 'Memory' Categories: Data : PlayBasic
This category that collects pages that relate directly to memory banks. Subcategories Pages in category 'Memory Banks' Categories: Data : PlayBasic
This category that collects pages that are related to using the Mouse. Subcategories Pages in category 'How To' Categories: Input
This category that collects pages that relate to movement. Subcategories Pages in category 'Movement' Categories: Physics
This category that collects pages that relate to music. Subcategories Pages in category 'Music' Categories: PlayBasic : Sound
This category that collects pages that relate to output. Subcategories Pages in category 'Output' Categories: Data : PlayBasic
This category that collects pages that relate to physics. Subcategories Pages in category 'Physics' Categories: PlayBasic
This category that collects pages with physics-related source code. Subcategories Pages in category 'Physics Source Code' Categories: Physics : Source Code
This category that collects pages that relate directly to PlayBasic. Subcategories Pages in category 'PlayBasic' Categories: PlayBasic Wiki
This is the top-level category of PlayBasic Wiki. Subcategories Pages in category 'PlayBasic'
This category that collects pages that relate to position. Subcategories Pages in category 'Position' Categories: Physics
This category that collects pages that relate to program flow. Subcategories Pages in category 'Program Flow' Categories: Core Commands
This category that collects tutorials that focus on beginner and core programming. Subcategories Pages in category 'Programming Tutorials' Categories: Beginner Tutorials : Tutorials
This category that collects pages that relate directly to random-ness. Subcategories Pages in category 'Random' Categories: PlayBasic
This category that collects pages that relate to Scene Buffer management. Subcategories Pages in category 'Scene Buffer' Categories: Graphics : PlayBasic
This category that collects pages that relate to the Game Screen and Window. Subcategories Pages in category 'Screen' Categories: Graphics : PlayBasic
This category that collects pages that relate to sound. Subcategories Pages in category 'Sound' Categories: PlayBasic
This category that collects pages with source code. Subcategories Pages in category 'Source Code' Categories: PlayBasic : PlayBasic Wiki
This category that collects pages that relate to sprites. Subcategories Pages in category 'Sprites' Categories: Graphics : PlayBasic
This category that collects pages that relate to Stats. Subcategories Pages in category 'Stats' Categories: PlayBasic
This category that collects pages that relate to strings. Subcategories Pages in category 'Text' Categories: Data : PlayBasic
This category that collects pages that relate to text. Subcategories Pages in category 'Text' Categories: Data : Graphics
This category that collects pages that relate directly to Timing. Subcategories Pages in category 'Timing' Categories: PlayBasic
This category that collects pages that are tutorials. Subcategories Pages in category 'Tutorials' Categories: PlayBasic Wiki
This category that collects pages that are otherwise uncategorized. Subcategories Pages in category 'Uncategorized Pages' Categories: PlayBasic Wiki
This category that collects pages that are related to Variables. Subcategories Pages in category 'Variables' Categories: Data : Data Structures
This category that collects pages that relate to vector shapes. Subcategories Pages in category 'Vector Shapes' Categories: Graphics : PlayBasic
This category collects pages that are lists of various things. Subcategories Pages in category 'Wiki Lists' Categories: PlayBasic Wiki
This category that collects pages that relate to worlds. Subcategories Pages in category 'Worlds' Categories: PlayBasic
A collision is what happens when two areas, such as the sprites of two game objects, overlap. Circle to Circle Collision Detection You can check if two circles overlap by using this general...
Colors can be represented using a hexadecimal number. These numbers are exactly the same as those used for HTML colors, except # is replaced with $. HTML Blue PlayBasic...
PlayBasic Wiki Complete Community Pages : Projects Community Portal Member Pages Wiki: Admin Wiki: Wanted Pages Categories: PlayBasic Wiki
Community Portal Welcome to the PlayBasic Wiki Complete Community Portal. Here you can find out about all that's going on at PlayBasic Wiki Complete. Bulletin Board Just started...
A constant is a data structure that can hold one piece of data that cannot change once set. Uses For Constants Constants are useful for naming data that doesn't change during the game. Naming data...
Basic Data Concepts Data is information used by a video game. The name or hit points of a game object (game character) is data that must be stored and changed during the course of your...
A data structure is a programming construct that contains data while your game is running. Constant A constant is a named piece of data that does not change during your game. Constants are most...
A data type is a specific kind of data used by a computer language. The reason there are data types is because there are different ways of dealing with different kinds of data. The most commonly...
A something is a Related Pages Backlinks These pages link back to this page. You may find them helpful. module "forum/ForumCommentsModule" title%3D%22Discuss%22 This article is a stub. You can...
DLL
DLL stands for dynamic linking library. DLLs can be used to extend the functions of PlayBasic. DLL...
( PlayBasic 1.61 ) Abs - return the absolute value of a number. Syntax num = Abs ( x ) num - returned absolute value x - number to get the absolute value of Explanation Abs() returns the absolute...
And - logical bitwise operator Syntax operand And operand Explanation And performs a logical operation on two operands. It does this at a bit level. Examples 42 And 42 Short explanation of...
Asc - get the ASCII code of a number, letter, or other character. Syntax asciiCode = Asc ( str ) asciiCode = returned ASCII code, as an integer str = character to get the ASCII code of, as a...
Bin$ - convert a number to a binary string Syntax binaryString = Bin$( number ) binaryString - returned binary string number - number to convert to a binary string Explanation Bin$() converts a...
Box - draw a box / rectangle Syntax Box x1, y1, x2, y2, filled x1,y1 : x/y-coordinates of the top / left corner of box. x2,y2 : x/y-coordinates of the bottom / right corner of box filled : True -...
BoxC - draw a colored box / square / rectangle Syntax BoxC x1, y1, x2, y2, outline, color x1, y1 - x/y coordinates of top/left corner x2, y2 - x/y coordinates of bottom/right corner outline - fill...
CenterSpriteHandle - center the handle of a sprite Syntax CenterSpriteHandle spriteName spriteName - the sprite to center the handle of Explanation CenterSpriteHandle puts the sprite handle of a...
Chr$ - get the character for an ASCII code Syntax char = Chr$( ascii ) char : returned character ascii : ascii code Explanation Chr$() takes an ASCII code (a number) and returns it's character as...
Circle - draw a circle Syntax Circle x, y, radius, fill x/y : the coordinates of the center of the circle radius : the radius of the circle fill : True - filled, False - outline...
CircleC - draw a colored circle Syntax CircleC x, y, radius, fill, color x/y : the coordinates of the center of the circle radius : the radius of the circle fill : True - filled, False - outline...
ClearArray - set all the elements of an array to a value. Syntax ClearArray arrayName, value arrayName - name of the array to fill value - value to set all of the array's elements...
ClearArrayCells - clear array cells in a range or in steps Syntax ClearArrayCells arrayName, startingCell, stepIncrement, noSteps, clearValue arrayName - the array of which to clear...
( PlayBasic 1.71 ) Cls - clear the screen Syntax Cls color color - a color as an integer Explanation Cls clears the screen of text and graphics. It requires a color as it's...
Const - declare a constant Syntax Const constName = value constName - name of constant value - value of constant Explanation Const declares a constant and sets the value. Examples Declare a...
CopyArray - copy an array to another array Syntax CopyArray SourceArray(), DestArray() ) SourceArray() - array to be copied DestArray() - array to copy to Explanation CopyArray copies the data in...
Dec - decrement a variable Syntax Dec varName varName - the variable to decrement Explanation Dec decrements a variable. This is doing the same thing as : var = var - 1 Examples Decrement a...
Dim is used to create arrays and types. Syntax Array Syntax Dim myArray(100) Type Syntax Dim myType As Type Explanation Dim is used to create types. Examples Create an Array SetFPS 60 Dim...
Dot - draw a single pixel to the game screen Syntax Dot x, y x/y - x/y coordinates of dot Explanation Dot draws a dot, or point, as a single pixel. Examples Draw a Dot Dot 100,...
DownKey - check if the down arrow key is pressed down. Syntax pressed = DownKey( ) pressed - True / False, depending on if the down key is pressed down Explanation DownKey() checks if the down...
DrawAllSprites - draw all active sprites Syntax DrawAllSprites Explanation DrawAllSprites draws all active sprites at once. Examples Draw All Active Sprites DrawAllSpritea Related...
DrawSprite - draw a single sprite Syntax DrawSprite spriteIndex spriteIndex - index of the sprite to be drawn Explanation DrawSprite draws a single sprite. Examples Draw a Sprite DrawSprite...
EnterKey - check if the Enter key is pressed down. Syntax pressed = EnterKey( ) pressed - True / False, depending on if the Enter key is pressed down Explanation EnterKey() checks if the Enter...
Even - check if a number is even Syntax evenBool = Even( numb ) evenBool - 1 if the number is even, 0 if not numb - the number to check Explanation Even checks if a number is an even number. If...
FPS - return the actual FPS Syntax actualFPS = FPS ( ) actualFPS - actual FPS returned as integer Explanation FPS() returns the actual FPS drawn. Examples Show the Current FPS The example code...
GetAngle2D - calculate the direction between two points in 2D Syntax direction = GetAngle2D( x1, y1, x2, y2 ) x1, y1 : 2D coordinates of point 1 x2, y2 : 2D coordinates of point...
GetArrayElements - get the number of elements in an array Syntax numElements = GetArrayElements ( array, dimension ) numElements - returned number of elements array - the array to count the...
GetFreeFont - get a free font index Syntax index = GetFreeFont() fontIndex - free, unused font index ready for use Explanation GetFreeFont() returns a free font index. Examples Get a Free Font...
GetImageHeight - get the height of an image Syntax imgHeight = GetImageHeight ( imageIndex ) imgHeight - returned height of image imageIndex - the index of the image to...
GetImageWidth - get the width of an image Syntax imgWidth = GetImageWidth ( imageIndex ) imgWidth - returned width of image imageIndex - the index of the image to...
GetScreenHeight - get the height of the game screen Syntax screenHeight = GetScreenHeight( ) screenHeight : returned height of the screen Explanation GetScreenHeight( ) gets the height of the...
GetScreenWidth - get the width of the game screen Syntax screenWidth = GetScreenWidth( ) screenWidth : returned width of the game screen Explanation GetScreenWidth( ) gets the width of the game...
Global - declare a global variable Syntax Global varName = value varName - name of global variable value - value of the global variable Explanation Global declares a variable in the global scope....
If - start an If statement Syntax Single Line If Syntax If condition Then do something Multi Line If Syntax If condition ; do something EndIf Explanation If is a conditional statement...
ImageMaskColour - set an image's transparent color Syntax ImageMaskColour imgIndex, color imgIndex - index of the image color - color to make transparent Explanation ImageMaskColor sets the...
Inc - increment a variable Syntax Inc varName varName - the variable to increment Explanation Inc increments a variable. This is doing the same thing as : var = var + 1 Examples Increment a...
Ink - set the drawing color for text and primitives Syntax Ink color color - color to use when drawing text and primitives Explanation Ink sets the color for drawing text and...
LeftKey - check if the left arrow key is pressed down. Syntax pressed = LeftKey( ) pressed - True / False, depending on if the left key is pressed down Explanation LeftKey() checks if the left...
LeftMouseButton - check the state of the left mouse button Syntax state = LeftMouseButton() state - state of the mouse button Explanation LeftMouseButton() checks the state of the left mouse...
LoadFont - loads a font from Windows to use in your game Syntax name FontName$, FontIndex, Size, StyleFlag FontName$ - name of the font to load FontIndex - numerical index to assign to the...
LoadNewImage - load an image, automatically return image index Syntax imgIndex = LoadNewImage( fileName ) imgIndex - returned image index fileName - filename of image to...
MouseX - get the horizontal mouse cursor position on the game screen. Syntax xPos = MouseX( ) xPos : horizontal position of the mouse cursor on the game screen. Explanation MouseX() gets the...
MouseY - get the vertical mouse cursor position on the game screen. Syntax yPos = MouseY( ) yPos : vertical position of the mouse cursor on the game screen. Explanation MouseY() gets vertical the...
NewSprite - create a new sprite from an image, get an available sprite index automatically. Syntax spriteIndex = NewSprite ( x, y, imageIndex) imageIndex - index of the image used to create a new...
Odd - check if a number is odd Syntax oddBool = Odd( numb ) evenBool - 1 if the number is odd, 0 if not numb - the number to check Explanation Odd checks if a number is an odd number. If it is,...
OpenScreen - create a game screen / window Syntax name ( argument, argument2 ) argument - explanation argument2 - explanation Explanation name does something in more detail. Examples Example...
( PlayBasic v1.61+ ) Print display a message Syntax Print message message - message to display Description Print displays a message to the player of your game. The message can be a string,...
PSub - define a subroutine Syntax PSub subName( argument, argument2 ...) ; psub code here EndPSub Explanation PSub begins the declaration of a subroutine. Subroutines are used to construct...
RGB - create a color using RGB Syntax color = RGB ( red, green, blue ) color - returned color red - red component of color (0 to 255 or $0 to $ff) green - green component of color (0 to 255 or $0...
RightKey - check if the right arrow key is pressed down. Syntax pressed = RightKey( ) pressed - True / False, depending on if the right arrow key is pressed down Explanation RightKey() checks if...
Rnd - generate a random number between 0 and x Syntax randNum = Rnd ( x ) randNum : returned random number x : maximum number Explanation Rnd() generates a random integer between 0 and...
Rnd# - generate a random float between 0 and x Syntax randFloat# = Rnd# ( x ) randFloat# : returned random float x : maximum number Explanation Rnd#() generates a random float between 0 and...
RndRange - generate a random integer between min and max Syntax randNum = RndRange( min, max ) randNum : returned random integer min : minimum number of range max : maximum number of...
RndRange# - generate a random float between min and max Syntax randFloat# = RndRange#( min, max ) randFloat# : returned random float min : minimum number of range max : maximum number of...
RotateSprite - rotate a sprite Syntax RotateSprite SpriteIndex, Angle SpriteIndex - index of the sprite to rotate Angle - angle of rotation Explanation RotateSprite rotates a sprite. The rotation...
SetBit - set a bit of a number Syntax Explanation SetBit() sets a bit in a number. Numbering of bits begins with 0 at the left, moving to the right. Therefore, in the 8-bit number, 0110010, the...
SetFont - set the font used for drawing text Syntax name ( argument, argument2 ) argument - explanation argument2 - explanation Explanation name does something in more detail. Examples Example...
SetFPS - set the framerate limit (frames per second) of a game Syntax SetFPS fps fps - frames per second as an integer Explanation SetFPS sets the framerate limit of a game. Examples Set the FPS...
SpaceKey - check if the Space key is pressed down. Syntax pressed = SpaceKey( ) pressed - True / False, depending on if the Space key is pressed down Explanation SpaceKey() checks if the Space...
SpriteDrawMode - set the sprite draw mode Syntax SpriteDrawMode SpriteIndex, DrawMode) SpriteIndex - index of sprite DrawMode - draw mode(s) to set for the sprite Explanation SpriteDrawMode sets...
Str$ - convert a number to a string Syntax str = Str$( num ) str - returned string num - number to convert to a string Explanation Str$() converts a number to a string. Examples Convert a Number...
%%content%%
TestBit - test a bit of a number Syntax bitFlag = TestBit ( number, bitNo ) bitFlag - state of the bit, 1 or 0 number - number to check bit bitNo - bit number, 0 is the far left...
Text - draw a text message using x/y coordinates. Syntax Text x, y, str x : x-coordinate of text y : y-coordinate of text str : message to show player Description Text displays a text message...
UnDim - destroy an array Syntax UnDim DoomedArray() DoomedArray() - name of the array to destroy Explanation UnDim destroys the array used as it's argument. The memory used by the destroyed array...
UnDimAll - destroy all arrays Syntax UnDimAll Explanation UnDimAll destroys all arrays in the game. The memory used by them is freed. Be careful with this, if you destroy all arrays — you destroy...
UpKey - check if the up arrow key is pressed down. Syntax pressed = UpKey( ) pressed - True / False, depending on if the up key is pressed down Explanation UpKey() checks if the up arrow key is...
Val - convert a string to a number Syntax num = Val( str ) num : returned number str : string to convert to a number Explanation Val$() converts a number to a string. Examples Convert a String to...
( PlayBasic 1.61+ ) WaitKey - wait for the player to press a key Syntax WaitKey Explanation WaitKey waits for player to press a key. This can be any key. After the player has pressed a key, the...
Frequently asked questions about PlayBasic. PlayBasic FAQ - our unofficial PlayBasic FAQ. WhackStick FAQ - when PlayBasic isn't as close to BASIC GDN as you expect Categories: PlayBasic Wiki
Files are used to store data between game sessions. Text Files load a text file create a text file check if a file contains valid / invalid data reading data from a text file File Functions This...
When PlayBasic runs out of code to execute, it naturally ends the game. A game loop (known as the main loop outside game programming) is the primary loop that keeps your game running. Simple Game...
The game screen is the surface where graphics are drawn. This can be full screen or it can be in a game window. OpenScreen OpenScreen opens a game screen. It is optional as a 800 by 600 game screen...
GetSign - check if a number is positive Syntax sign = GetSign ( numb ) sign : sign of number, 1 if negative, 0 if positive numb : number to check Description name does something in more...
So, you want to make video games? Maybe you only want to make games for a hobby or maybe you want to become a part of a professional game development company. Either way, PlayBasic Wiki Complete is...
foldunfold Table of Contents Framerate Misc Related Pages Source Code Tutorials Backlinks Links Camera Color Background Game...
Gravity is a pulling, or attracting force in game physics. Gravity Basics Orbit using Gravity Direction of Gravity Related Pages Physics Tutorials Easy Forces - 2D Physics - demonstrates a...
{$name} Guide
Heath Basics The health of a game object is usually stored in an integer (whole number) variable that is a part of the Type that defines the game object. SetFPS 60 Type Obj...
Prerequisite Concepts — Concepts Basic Concepts Core —- Concept Related Pages Backlinks These pages link back to this page. You may find them helpful.
Disable Keyboard Keys Find the Size of an Array Limit the Value of a Variable Load and Draw an Image Make a Variable Negative Rotate a Sprite Categories: How To
How to disable, block, or stop keyboard input. SetFPS 60 keys_enabled = True Do If SpaceKey() And keys_enabled keys_enabled = False FlushKeys ElseIf SpaceKey() And Not...
If you are allowed to edit pages in this Site, simply click on edit button at the bottom of the page. This will open an editor with a toolbar pallette with options. To create a link to a new page,...
Finding the size (or length) of an array is easy in PlayBasic — it comes with a function to do just — GetArrayElements() This How To covers finding the array size of 1, 2, and 3 dimensional...
How to Limit the Value of a Variable in PlayBasic Limiting the value of a variable involves two steps. Check to see if the variable has exceeded the limit. If it has, set it back to the...
How To Load and Draw an Image in PlayBasic Declare a Variable Before you load the image, you need to declare a variable to hold the image index. The image index acts as a handle by which you can...
How to Make the Value of a Variable Negative in PlayBasic Making the value of a variable negative involves two steps : Check if the variable is positive. Change the number from a positive number...
Load an Image myImg = LoadNewImage( "myImage.png" ) Create Sprite From the Image mySpr = NewSprite( GetScreenWidth() / 2, GetScreenHeight() / 2, myImg ) Optional : Center the Sprite...
Images are the basic graphical unit of PlayBasic. Think of them as plain, ordinary images that are there for decoration only. Mostly images are used for interfaces such as HUD elements. Image...
[[row]] [[cell style="background:#fafafa;border:1px solid #aaa;padding:0.3em;"]]{$col}[[/cell]] [[cell style="background:#fff;border:1px solid #aaa;padding:0.3em;"]]${$val}[[/cell]] [[cell...
Source Code Primitive Explosion: 23 Sept Simple Quiz Game : 20 Jul RandomPulse() : 28 Jun DrawGrid() : 28 Jun Draw a Grid Demo : 14 Jun Wall Bounce : 13 Jun MoveTowards2D() : 08...
Tutorials Indexes : 10 Apr Types : 07 Apr If Statements : 02 Apr Logical Operators : 02 Apr Relational Operators : 02 Apr Random Numbers : 01 Apr Basic Math : 31 Mar Variables : 31 Mar Boolean...
How To: Make a Variable Negative Source Code Source Code: Avoidance A.I. Demo Tutorial Tutorial: 2D Game Space Tutorial: 2D Physics Tutorial: Built-In Functions Tutorial: Frog Throwing Tutorial:...
Input is data put into your game program. In-Game User Input Input Devices Keyboard You can use the keyboard for player input. Used by itself, it's good for simple control using single keystrokes...
Please change this page according to your policy (configure first using Site Manager) and remove this note. Who can join? You can write here who can become a member of this site. Join! So you...
The player can use the keyboard to control the player object. Handling Keyboard Input Checking Keys Arrow Keys The four arrow keys can be checked using the following four functions. UpKey() -...
KeyState - check if a key is down Syntax KeyState ( scanCode ) scanCode - scancode of key to check Description KeyState checks if a key is down by scancode — that is — the numerical value...
Line - draw a line Syntax Line x1, y1, x2, y1 x1, y1 - x/y position of one end of the line x2, y2 - x/y position of the other end of the line Description Line draws a line. Examples Example...
This is a reference list of hex values and color names that can be used to create your own constants. This list is the same as the named colors in CSS, except modified for PlayBasic. Color...
This is a list of built-in constants in PlayBasic. Constant Name Actual...
This article is a stub. You can help us improve PlayBasic Wiki Complete by expanding it. This is a growing list of functions of...
Loops repeat blocks of code. The most basic kind of loop is the Do loop, which most examples will use as their primary game loop. SetFPS 60 Do Cls 0 Sync Loop Types of Loops Do …...
(Main article: {$page})
Mathematical Operators Addition + Division / Equality = Multiplication * Subtraction - Note: If all the numbers in an expression are integers, the result will be an integer. If one...
Hi, I'm Shawn Hartnell. Shawn Z Math Tutorial Can't get LengthDir2D() to work with Types Video Tutorials Disable Keyboard Input Get Text Input From Player Input Boxes Basic Tutorials Strange...
Members: Moderators Admins
Memory banks can be used to store data. Memory Bank...
Handling Mouse Input Check Mouse Mouse Cursor Position MouseX() - horizontal position of the mouse MouseY() - vertical position of the mouse Changes in Position ( Delta...
Movement is the changing of position over time. Movement is the changing of position over time. Therefore movement is the changing of position variables incrementally each game...
A multiplayer game is a game where more than one player is playing. Hotseat Online To Do Find and enter ip address for connection between server and client. Chat with text input. Related...
PlayBasic Wiki PlayBasic Wiki Getting Started Wiki Index Recent Changes Community Forum Recent Posts Projects Member Pages Learn PlayBasic Tutorials How To Source Code PlayBasic...
A number is a numeric value. foldunfold Table of Contents Numeric Literals Numeric Data Types The Basic Two Integer Float Representing Numbers Conversion Related Pages Backlinks Numeric...
Add Object (to array) Center Object (in environment) Center of Object Check Object Count Objects Destroy Object Individual Object Object Following View Object Nearest Object Sprite Object...
An operator performs an operation on a piece of data. Mathematical Operators Addition Subtraction Multiplication Division + - * / Related Pages Backlinks These pages link back to this page....
Output is data that comes out of your game program. Related Pages Data Graphics Input Music Sound Text Backlinks Categories: Data : Output
Particle Systems use the same basic concepts as game objects. Particle Snow Basic Particle Snow Effect Example Code This example illustrates the very basics of a particle system. Press the...
This page details game physics. Basic Mechanics Movement Position Forces Gravity Related Pages Speed Tutorials 2D Physics - tutorial series about 2D Physics using PlayBasic Source...
Platform Moving Platform Vertical Moving Platform Solid Platform Related Pages Source Code Simple Gravity Demo Tile Map Categories: Uncategorized Pages
PlayBasic in a Nutshell PlayBasic is a game programming language and therefore is easier to make games with than using a general purpose programming language. PlayBasic is based on BASIC which is...
This is our general PlayBasic FAQ. General Is PlayBasic Free? No. It costs $30 USD. However, a new free PlayBasic Learning Edition has been announced to be on the way. Categories: PlayBasic
# A B C D E F G H I J K L M N O P Q R S T U V W # 2D 360 3D 3D Shooter 8-Direction Keyboard Control in...
PlayBasic Wiki Complete Welcome to PlayBasic Wiki Complete! We currently have more than 325 pages. Start Here Getting Started Tutorials PlayBasic FAQ Forum Built In...
Keyboard Keyboard Mouse Mouse Related Pages Source Code 8-Direction Keyboard Control in 2D Tutorials Introduction to Player Control Backlinks These pages link back to this one. You may find...
Position is the place of something in a game world. 2D Position The position of something in 2D is defined two variables : x# and y#. The x# variable is the horizontal position. By default...
A Primitive is a basic shape. 2D Primitives Box, Square Rectangle The Box and BoxC commands can draw both squares and rectangles Box - draw a box BoxC - draw a colored box Circle, Ellipses The...
Shawn Z is a vertical shooter loosely based on Section Z.
Shawn Z
Because sometimes, you just want things to be random. Generate a Random Number Random numbers can be generated with these functions : Rnd() - generate a random integer between 0 and x Rnd#() -...
Individual Edits Edited Pages New Pages
RPG
RPG stands for role-playing game. Related Pages Source Code Tile Map Backlinks These pages link back to this page. You may find them helpful. This article is a stub. You can help us improve...
Storing Scores in Variables Single Player Score If your game has only one score, it can be stored in an integer variable. Single Player Score Example Code In this example code, the score...
List of Constants List of Color Constants List of KeyCode Constants Add a "Recently Added / Updated Source Code" Box to the source code page and the main page. Position Position, WTF is...
Part 1 : Introduction to PlayBasic PlayBasic is one of the fastest game programming languages. It excels at creating 2D games and it's capability to help you make 3D games is rapidly...
Part 2 : Game Code Structure The source code of all games are structured in three phases : Game Code Structure Name Does Initialize Set up the game to run. Game Loop Repeat code to keep...
Part 3 : Making Things Move Let's make something move. Here's the code for this part. ; INITIALIZATION ---------------------------------------- ; set the frame rate to 60 frames per...
Beginner's Math Tutorial This tutorial is a beginner's math tutorial using PlayBasic. This tutorial is intended as a larger tutorial base on math. It assumes you know absolutely nothing about math,...
PlayBasic Wiki PlayBasic Wiki Getting Started Wiki Index Recent Changes Search Community Forum Recent Posts Projects Member Pages Learn PlayBasic Tutorials How To Source Code PlayBasic...
{$title} {$body}
Sitemap of PlayBasic Wiki Complete :
Loading Sound Files Sound files loaded into PlayBasic require a sound index to refer to the sound when you want to play it. LoadNewSound() will load a sound file into PlayBasic and create the...
A.I. Avoidance A.I. Demo by u9 and translated by hartnell and u9 Follow A.I. Demo by u9 (modified version of Avoidance A.I. Demo) Arrays Random Array Control / Input Keyboard 8-Direction...
Description This code demonstrates the principles behind creating a simple text-based 3-Digit combination lock. Instructions Use left / right arrow keys to change selected number Use up / down...
Explanation This source code snippet demonstrates 8-Direction keyboard control in 2D using the arrow keys. Source Code SetFPS 60 x# = GetScreenWidth() / 2 y# = GetScreenHeight() / 2 speed# =...
A poor circle being bullied by the big bad square. You play the role of the big bad square. See if you can catch the poor defenseless circle to get a reaction :) The Code ; Avoidance AI demo...
Description This code is a demo of a 'ball cannon'. Balls are shot from an offscreen 'cannon', after which they bounce off the walls and floor. Instructions Press space to fire a ball, hold space...
Description This is a 2D car physics demo suitable for a top-down 2D racing game. The original code was written by u9. Instructions Use the left and right arrow keys to steer. Use the up arrow...
Description This source code creates a simple countdown timer. It can be used for time limits and races against the clock. Instructions The timer starts automatically when the code starts running....
Explanation Crazy Bubble was invented as a noob game 'easier than a Pong Clone'. Instructions The bubble is moved around by random forces. The object is to keep the bubble on the screen for as...
Explanation This is a fairly simple drag and drop example using the Mouse. Instructions Use the left mouse button to drag and drop the green square. Source Code SetFPS 60 Type Obj x#...
Description This source code draws an interactive grid. Instructions WASD: Move grid. IJKL: Resize grid. Arrow Keys: Change number of cells in grid. Source Code SetFPS 60 LoadFont "Arial",...
Syntax DrawGrid( gridX#, gridY#, gridWidth#, gridHeight#, numbCellsX, numbCellsY ) gridX# - x position of the grid gridY# - y position of the grid gridWidth# - width of grid gridHeight# - height...
Description This code finds the nearest game object in an array. Instructions Use the arrow keys to move the player object. The nearest object will light up. Source Code font =...
Explanation The big bad circle trying to catch the poor square. You play the role of the poor square. See if you can avoid the big bad circle :) The Code ; Follow AI demo done by u9 Jun 2008 ;...
Explanation This is an example of an object following the mouse cursor. Instructions Place your mouse in the game window and the circle will constantly move towards the mouse cursor. Source...
Description This creates a full screen TV static effect without using Dot or DotC (they were too slow). Instead it generates random static tiles and randomly displays them in a way similar to a...
Description Instructions Source Code Related Pages Backlinks These pages link back to this one. You may find them helpful. module "forum/ForumCommentsModule" title%3D%22Comments%22
Introduction I tried to make a game out of the simple gravity demo while learning to play around with PlayBasic. I got into many annoying situations which i didn't know how to solve, hence the...
Description Gunna Die is a simple arcade game. Instructions Use the arrow keys to defend your ship (circle) in the center from the incoming asteroids. Source Code SetFPS 60 LoadFont "Verdana",...
Description "Gunna Die Again: You Still a Gunna Die" is the sequel to Gunna Die. It's currently unfinished. See the Gonna Die Design Document. Instructions Use left mouse button to fire useless...
LengthDir2D - calculate a positional offset with length and direction Syntax NewX#, NewY# = LengthDir2D ( X#, Y#, Dir#, Leng# ) NewX# - x position of the offset NewY# - y position of the...
MakeNeg - make a number negative Syntax negNumb = MakeNeg ( numb ) negNumb : returned number as negative numb : number to make negative Explanation MakeNeg() makes a number...
Description Mod Blink demonstrates how to time blinking by using Mod() to check if the number of blinks remaining is odd or even. Alternately, you could use Even() or Odd() to do the same...
MoveObject2D - move an object in an orbit around a point Syntax NewX#, NewY# = MoveObject2D# ( OrbitX#, OrbitY#, CenterX#, CenterY#, Speed#, Dist# ) NewX# - new calculated x position NewY# - new...
MoveSpeedDir2D - calculate movement based on speed and direction. Syntax NewX#, NewY# = MoveSpeedDir2D ( X#, Y#, Speed#, Dir# ) NewX# - new calculated X position NewY# - new calculated Y...
MoveTowards2D - move towards a point Syntax NewX#, NewY# = MoveTowards2D ( X#, Y#, X2#, Y2#, Speed# ) NewX# - new calculated X position NewY# - new calculated Y position X# - current X...
Description This shows a way to generate and display a number sequence such as those commonly found in I.Q. tests. Instructions Copy, Paste, Press F5. and the number sequence will be...
Description This is the code for an upcoming Pong Clone tutorial. A full zip including sprites and sounds will be provided when the project is finished, before the tutorials are...
Description 'Pop Bubbles' uses a 2D array to keep track of randomly appearing bubbles which can be popped by the player object. Instructions Use the arrow keys to move the player object. Have...
Description Generates a dynamic explosion using graphics primitives. Instructions Copy and paste, press F5 Source Code SetFPS 60 ExpCR = 0 ExpR = 50 ExpMC = $bb ExpX = 100 ExpY = 100 Do...
Explanation This is a simple proximity mine demo. The proximity mines will explode if they are within 40 pixels of the dot or within each other. Instructions Use the arrow keys to move the...
Explanation This source code example chooses a name randomly from an array of names. Instructions Just copy and paste into PlayBasic and press F5. Source Code ; create array Dim names$(5) ;...
Explanation Random Location 2D chooses a random location from an array. Instructions Copy into your PlayBasic code editor and press F5 Source Code SetFPS 60 ; create object type Type Obj...
Explanation This source code snippet is an example of placing a game object at a random position in 2D. Instructions Just copy into your PlayBasic code editor and press F5. Source Code SetFPS...
Syntax bool = RandomPulse( freq ) bool - if pulse is on freq - general frequency of pulse Explanation RandomPulse() will generate a random pulse ( return True) randomly based on the frequency...
Description This is a simple gravity demo. This technique is used in platform games. Instructions Press the Space Key to throw a ball. Source Code Vanilla Version Gravity and Bounce This...
Description Simple text quiz game. Instructions Use the right, left, and up arrows to choose the correct answer to the quiz question. Source Code SetFPS 60 LoadFont "Courier", 1, 20, 0 Type...
Description This is a simple shooting demo that uses an array to manage bullets. Instructions Use the left and right arrow keys to fire. Source Code SetFPS 60 Type TObj x# y#...
Explanation This code demonstrates a simple snow particle effect. The snow itself is drawn using DotC Instructions Press the ENTER key to create snow and watch it fall. Source Code SetFPS...
Description This code demonstrates how to set up a start location for a game object and place it back there. This is useful in arcade games where the player object is put back at the starting...
%%content%%
Explanation Text Menu is an example of a simple text menu. It is suitable to use for a title screen menu. Instructions Use the up and down arrow keys to move the menu selector. Press the Enter...
Explanation This source code example loads and displays a simple tile map. The data for the tile map is contained in the Data statements. The numbers are laid out exactly how the tile map is...
Description This is a demo of the wall bounce used in ball and paddle games such as Pong and Breakout. Instructions Use the Space Key to change the speed and direction of the ball. Source...
Speed is the rate at which something happens. Game Speed The overall speed of a game is usually measured in it's framerate — how many frames per second fps there are. The framerate of game...
Sprites are images that are commonly used to represent the game objects in a 2D game. Sprites have other properties in addition to those of images — most importantly, sprites can be used for...
Stat is short for statistic. Stats are anything about a game object or the game itself that has an influence on game play. Game Object Stats Ammo Health Game Stats Score Related...
These pages are stubs. You can help us improve PlayBasic Wiki Complete by expanding them.
This article is a stub. You can help us improve PlayBasic Wiki Complete by expanding it.
( PlayBasic 1.61+ ) Sync - draw a frame Syntax Sync Description Sync draws the current frame. If you do not use Sync you will see nothing. Therefore, it is very important to use Sync after drawing...
I suggest the image be changed such that the arrows point in the direction of the positive axis. This is probably what most people expect, and it also will indicate that the y axis is in fact...
name - does something Syntax name ( argument, argument2 ) argument - explanation argument2 - explanation Explanation name does something in more detail. Examples Example Title Short explanation...
Text when used and manipulated as data, is called a string. Text, when drawn on the game screen is a graphical element. Draw Text There are two primary ways to draw text in PlayBasic. Functions...
blah
Top
edit this page edit sections history talk
2D Games take place in 2D game space. This tutorial is an introduction to both 2D game space and how to move around in it. 2D Game Space in PlayBasic Tutorial 2D games take place in 2D game space....
Author's Note : 2D Physics in PlayBasic is more of a book in progress rather than a tutorial series, so please do not expect to read 2D Physics in PlayBasic like a tutorial. Secondly, it's also a...
Acceleration As you learned in a previous chapter, speed is the rate of change of position (in relation to pixel zero). Built upon this concept is acceleration. Acceleration is the rate of change...
This tutorial will introduce you to arrays. What is an Array? An array is a data structure that can hold more than one piece of data at a time. Categories: Beginner Tutorials : Programming...
This tutorial will introduce you to basic, simple math. Mathematical Operations The four basic mathematical operations are : addition, subtraction, multiplication and division. Addition Addition...
This tutorial will introduce you to bitmasks. What is a Bitmask? ClearBit() SetBit()
This tutorial will introduce you to boolean expressions. What is a Boolean Expression? A boolean expression is any expression that evaluates to either True or False. The two most simple boolean...
Functions are your friends and you'll be using them as long as you are making games with PlayBasic. This tutorial will introduce you to the basics of using PlayBasic's built-in...
This tutorial will introduce you to Do loops. Do Loop A Do Loop will loop forever until the player presses the ESC key or the X on the game window. LoadFont "Tahoma", 1, 16, 0 counter = 0 Do...
Easy Forces Before moving on to more real-world physics, I think a word should be said about the quick and dirty way of simulating forces in 2D games. Most often, these forces are wind and gravity....
Force Acceleration doesn't happen by itself, even though I presented it that way in the last chapter to keep things simple. Objects do not simply start accelerating for no reason. Instead...
For counter start To end Next LoadFont "Tahoma", 1, 16, 0 For i = 1 to 10 Print i Next Sync WaitKey LoadFont "Tahoma", 1, 16, 0 For i = 5 to 10 Print...
Not only is frog throwing fun, it's an essential type of player control for Frogger-style games. Frog Throwing Tutorial "Frog throwing" gets its name from the game Frogger. Technically it's a form...
Fundamental Units of 2D Physics It's customary and almost a cliche to begin an introductory text on physics with one of two approaches. Attempt to blow your freekin' mind in two paragraphs. Start...
This tutorial will introduce you to the basic code structure most games follow. Basic Game Structure The basic game structure games use is divided into three sections : Initialization, get the...
This tutorial will introduce you to displaying graphics in PlayBasic The term graphics includes anything on the screen seen by your player. Drawing a Frame All graphics must be drawn between Cls...
This tutorial will show you the minimum you need to get a basic, error free window working in PlayBasic. Hello World Tutorial The code needed to get a simple, error free window working in PlayBasic...
This tutorial will introduce you to If Statements. What is an If Statement? An If statement checks a boolean expression to decide whether or not to run code. To learn about boolean expressions,...
This tutorial will introduce you to the concept of the index. What is an Index? An index is a number that refers to something. Wah? An index is a number that refers to something. For example, let's...
Author's Note : 2D Physics in PlayBasic is more of a book in progress rather than a tutorial series, so please do not expect to read 2D Physics in PlayBasic like a tutorial. Secondly, it's also a...
Images are the most basic kind of 'graphics' in PlayBasic. This tutorial is an introduction to them. Introduction to Images in PlayBasic Tutorial Images are the fundamental graphical unit of...
You've already been shown how to do basic player control in previous PlayBasic tutorials. In this tutorial, you'll learn how it works and start on your way to more complex forms of player...
What is a Logical Operator? A logical operator gives you more freedom in your boolean expressions. Because of this, they are sometimes called boolean operators. The format for using logical...
Position and Motion Position and Motion are intimately linked. This is because : Motion is the changing of position. However, in considering this, we are faced with the fundamental questions...
This tutorial will introduce you to the foundation of all things random — the simple random number. Generating Random Numbers Random numbers are generated using a function that generates random...
This tutorial will introduce you to relational operators. What is a Relational Operator? Relational operators are used in boolean expressions to check the relation between two things. In other...
This page lists our PlayBasic Tutorials. Beginner Tutorials Hello World Yes, it's the classic "Hello World" tutorial. This tutorial will show you the minimum you need to know. Variables Learn the...
This tutorial will teach you to use Select Case statements. playerName$ = "Bob" Select playerName$ Case "Bob" Print "Hello, Bob." Case "George" Print "Hello, George."...
The game loop is what keeps your game running. In this tutorial, you learn the very basics of constructing a game loop. This is a very important tutorial as all games are built on the game...
Speed In real-world physics, motion happens at a rate based on time. The rate of motion is more commonly (and less technically) known as speed. Speed is typically expressed in this mathematical...
"Sir" Issac Newton was a great guy. In life he was scared of girls and practiced alchemy like a paranoid squirrel. He was such a lovable nut. However, the sordid details of his personal life are...
This tutorial will introduce you to Types. What is a Type? A type is a way of grouping all the variables required for a type of game object. A type is first declared and then game objects are...
This tutorial will introduce you to variables. What is a Variable? Variables are containers that hold data while your game is running. Variables are commonly used to store a character's hitpoints...
Before reading this tutorial, you should read these tutorials : Hello World Game Structure Simple Game Loop This tutorial will teach you to make your first game. First, If the Text is Too...
A variable is a data structure. Variables can hold one piece of data of one data type. Why use variables? Variables are reusable. If a value changes, no problem! Things like a character's...
Description Instructions Source Code SetFPS 60 Type Obj x# y# yStart# ySpeed# yForce# EndType Dim waver As Obj PSub startWaver() If SpaceKey() waver.x# =...
According to Wikipedia, the world largest wiki site: A Wiki ([ˈwiː.kiː] <wee-kee> or [ˈwɪ.kiː] <wick-ey>) is a type of website that allows users to add, remove, or otherwise edit...
Links to make admin stuff easier : Includes Front Page Includes Include: Featured Source Code Include: Featured Tutorials Include: Most Visited Pages Categories: PlayBasic Wiki
All Categories Categories: PlayBasic Wiki
Wiki Index A B C D E F G H I K L M N O P R S T V W Wiki Index This is a growing index of PlayBasic Wiki Complete. It exists to help you find what you are looking...
list of functions