List All Pages
( Basic4GL 2.4.7 ) Abs - make a negative number positive (return absolute value) Syntax num = Abs ( x ) num - returned positive number. x - number to change to positive Description Abs() changes...
This tutorial will give you an essential quick tour of the Basic4GL IDE. It is very important you take this quick look around so you know what the hell we are talking about in later tutorials. You...
An array is a data structure that can hold more than one chunk of data. All chunks of data in an array must be of the same data type. Arrays in Basic4GL can be 1, 2, or 3-dimensional. 1D Array A...
Creating ASCII games is easier than making graphical 2D games and they are alot of fun to program. This tutorial is a primer of the very basic concepts of ASCII game programming by creating a...
Setting the background image for B4GL. Dim backgroundImage, bgsprite Create the variable backgroundImage = LoadTexture("Background.jpg") bgSprite = NewSprite(backgroundImage) Load the...
{$text}
Awarded to member name for creating a member page. The member badge is the first badge that most members earn. Display Code [[include include:member-badge member=member...
You can earn badges that reflect your skill with Basic4GL and OpenGL and earn respect in our Game Maker community. You can display your badges on your Member Page. The Badges These are the badges...
Basic4GL in a Nutshell Basic4GL is a BASIC dialect that supports OpenGL. Unfortunately, Basic4GL does not support modern BASIC commands and has some flaws that will surprise the most seasoned...
Basic4GL arrays are like variables with slots. Basic4GL Arrays Dim names$(4) names$(0) = "Bob" names$(1) = "Tom" names$(2) = "Dick" names$(3) = "Harry" Print names$(1) Note for BASIC...
Games are made in Basic4GL by writing code in the IDE which comes with BASIC4GL. Basic4GL IDE IDE stands for Integrated Development Environment. The IDE includes a code editor, a debugger, and...
If statements are conditional statements. They are used to execute different lines of code depending on a condition. Basic4GL If Statement Dim name$ name$ = "Bob" If name$ = "Bob" Then Printr...
Basic4GL is an easy to learn game programming language based on BASIC, originally a programming language designed for beginners. The primary purpose of Basic4GL is to make it easy for beginner's to...
Basic4GL loops repeat code over and over based on a condition. Basic4GL For Loop The Basic4GL For loop repeats a block of code a set number of times. Dim i For i = 1 to 10 Printr...
This is a tutorial that explains the absolute minimum you have to do to get a Basic4GL project up and running without an error. This will not teach you how to make a complete game. It will only...
Basic4GL operators perform various operations on data. Arithmetic (Mathematical) Operators Arithmetic operators are used for basic mathematical operations. Operator Name Does Example + Addition...
Basic4GL Strucs can contain pieces of data of different data types. Basic4GL Strucs Struc gameObject name$ hitPoints magicPoints EndStruc Dim gameHero As gameObject gameHero.name$ =...
BASIC and Basic4GL Basic4GL is based on BASIC, a beginner programming language. The syntax of Basic4GL closely follows that of BASIC, with a few differences. The differences between BASIC and...
Basic4GL is an easy to learn game programming language based on BASIC, originally a programming language designed for beginners. This Basic4GL tutorial series will introduce you to the core...
Basic4GL Variables are like containers that hold information that your game needs as it is running. Creating Basic4GL Variables Before a variable can be used, you must create it using Dim. This is...
Basic4GL Wiki Welcome to Basic4GL Wiki Complete, the place where you can learn to make video games using Basic4GL. Core Language Graphics OpenGL Sprite Tutorials Source Code What's...
Welcome to our Basic4GL Beginner's Guide. The Basic4GL Beginner's guide links to tutorials and other pages in the order you should read them to advance from complete noob to intermediate Basic4GL...
BindSprite(sprite variable) is used to tell the program that, out of all the sprites in your program, you want all your commands that affect sprites to affect the sprite designated by BindSprite()...
( Basic4GL 2.4.7 ) ClearKeys - clear the keyboard buffer. Syntax ClearKeys() Description ClearKeys() clears the keyboard buffer. It is useful if you want to make sure that the player isn't pressing...
( Basic4GL 2.4.7 ) ClearLine - clear the line the cursor is on. Syntax ClearLine() Description ClearLine() erases only the line that the text cursor is currently on. With a little creative...
CloseFile() will affect a variable that has been assigned to a file with either OpenFileRead() or OpenFileWrite(), making it so that that variable is no longer associated with that file. It is used...
Cls
( Basic4GL 2.4.3 ) Cls - clear the screen Syntax Cls Description Cls clears the screen of text. It does not clear the screen of sprites, this is done automatically with the TEXT_BUFFERED...
( Basic4GL 2.4.3 ) Color - change the text color Syntax Color ( red, green, blue ) red - red component green - green component blue - blue component Description Color() changes the color of the...
Comments are remarks (or notes) put directly in the source code to help remember what a bit of code does or to document it for other people. Basic4GL itself ignores comments. Single Line...
The Community Team is here to help you with anything you need. All members of the community team have volunteered to help you. Administrators These members have complete control over the wiki. (...
( Basic4GL 2.4.3 ) Const - create a constant Syntax Description Examples Direction Constants Sometimes declaring the four cardinal directions can save you time and make your code more readable...
Basic4GL uses as its core language a dialect of BASIC and is a mix of both modern and classic BASIC dialects. When you read the word BASIC in this wiki it will always refer to the core language...
Data is information your game needs. Related Pages Array Data Type Data...
A data structure holds data while your game is running. All the data your game will use is held in a data structure. When the game is over, the data is not saved unless you specifically write...
Basic4GL has four data types: string, integer, real. Integer The integer data type is any whole number. Integers and other numbers that are meant to be used in mathematical calculation are never...
Dim
( Basic4GL 2.4.7 ) Dim - create a variable Syntax Dim variableName variableName - name of variable to be created Description Dim creates a variable for you to use later. All variables in a...
%%content%%
Basic4GL is available from the official Basic4GL site. You can get the current version of Basic4GL from the official Download Page. The current version of Basic4GL is 2.4.10. Once you have it...
( Basic4GL 2.4.3 ) DrawText - display (draw) text in TEXT_BUFFERED mode Syntax DrawText() Description DrawText() displays text when using TEXT_BUFFERED mode. In other words, when you Print...
Drawing Text at a Location Tutorial To draw text at a specific place you have to use the Locate(x,y) function. This function is deceiving because it's not actually the x and y. It's really...
How to Draw Text in Basic4GL Tutorial Drawing text in Basic4GL is extremely easy. You simply use the Printr and / or the Print function. Drawing Text with Printr Printr draws each bit of text on a...
End
( Basic4GL 2.4.3 ) End - end the game Syntax End Description End performs a simple task. It ends the game. However, it does not close the window. This is at times useful and at other times...
FAQs are collections of frequently asked questions about a subject with appropriate answers. Basic4GL FAQ Text FAQ
Text Files Load a Text File Create a Text File File...
For
( Basic4GL 2.5.2 ) For - start of a for loop. Syntax Description name does something in more detail. Goto can be used to jump out of a For loop but it is not recommended. Examples Example...
The game loop is the main program loop in a game. All games, even the most simple, use a game loop. Related Pages Game Programming Documentation Do Loop Sleep Tutorials Backlinks
Getting Text Input From The Player To do this we use the input function similar to the input function in FreeBasic. Input variable This will just wait for the text to be entered without giving...
How to Get the Mouse Cursor Position in Basic4GL The Concept The mouse cursor position is reported by Mouse_X() and Mouse_Y(). However, these functions return the mouse position as a number...
Syntax glClearColor ( red, green, blue, unknown ) red - red component green - green component blue - blue component alpha - alpha component Description glClearColor() sets the clear color. In...
( Basic4GL 2.4.3 ) Gosub - go to a subroutine Syntax Gosub label label - the label where the subroutine starts Description Basic4GL uses the classic BASIC style of subroutines using Gosub and...
( Basic4GL 2.4.10 up ) Goto - goto a label Syntax Description Examples Jumping Out of a For Loop Goto can be used to jump out of a For loop : Dim i For i = 1 To 10 Printr i If i = 5 Then...
Basic4GL has two ways of rendering graphics : through OpenGL or it's built-in 2D sprite engine, which is suitable for all kinds of 2D games. 2D Sprite Engine The 2D Sprite Engine is built on...
' Guess The Number ' by Shawn Hartnell Dim a Dim number dim guess printr "'Ello. I'm a little man inside Basic4GL." printr "See if you can guess my random number." printr "It will be between 1...
{$name} Guide
Want to be a first-rate elite programmer? Then you will have to pay the toll of reading at least one Hello World Tutorial. For convenience, you can do that right here Hello World Tutorial This...
Karma shows your activity level at Game Maker Wiki Complete. Karma generally shows whether a person is a noob or an established member. It is used when choosing new moderators and admins, who must...
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,...
Awarded to {$member} for creating a member page.
{$title} {$content}
{$title} {$content}
Syntax Input, var var - variable to contain player input. Description Input gets a line of input from the player. When Basic4GL executes an input statement, it pauses the game and allows the...
Ok lets get right into it! first of all you need DIM which defines that it is a variable (I'm pretty sure there's a tutorial on this site about them.) So here's an example DIM feeling$, name$ 'as...
A text game is a turn-based text-only game that uses line-input. Text Games are Text Only Text games are text only. This makes them easy to program and are a great way to explore the fundamental...
Basic4GL has functions for using a Joystick for player control. Related Pages Player Control Joystick...
Jump Program is an ASCII platform game demo by Nicky. It is not released under the same Creative Commons license as the rest of the wiki. The author has only given permission for Dark Maze to be...
Basic4GL has functions that allow keyboard input, assuming one is hooked up to your computer. Related Pages Player Control Keyboard Tutorials Check If a Key is Pressed Pause the Game Until a...
Syntax value = KeyDown( key ) value - true or false key - key to test for as a string Description KeyDown() checks for whether a key is pressed or not. KeyDown( "A" ) would check if the a or A...
This article is a stub. You can help improve Basic4GL Wiki Complete by expanding it. language is used to change the syntax of Basic4GL. It accepts three constants. traditional : a more...
Syntax LCase$( str ) str - the string to turn to lowercase Description Turns a string into all lowercase letters. Invaluable for text parsing, but only matters in display if you are using a font...
Syntax copy = Left$( str, x ) copy - returned substring str - the string to copy from x - the number of characters to copy Description Left$() copies x characters from the left side of a...
Syntax numchars = Len ( str ) numchars - the returned number of characters in the string. str - the string to count Description Len() counts the characters in a string. Examples Counting...
How to Limit the Value of a Variable in Basic4GL 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...
This is a convenient list of Basic4GL errors, what causes them and what you can do about them. Expected ')' This happens when Basic4GL expects to find a matching parenthesis with another...
How to Load and Display a Sprite Tutorial Create Variables Create two variables. One to hold the texture and another to hold the sprite which will be created from the texture. Dim tex Dim...
Syntax ind = LoadTexture( fileName ) ind - returned texture index fileName - the name of the file to load Description Examples Related Pages Backlinks These pages link back to this page. You may...
( Basic4GL 2.4.3 ) Locate - change the cursor position Syntax Locate x, y x - horizontal position of the cursor y - vertical position of the cursor Description Locate changes the position of the...
Loops repeat code a number of times. Related Pages Game Loop Documentation Do For Loop Next Backlinks
How to Make a Variable Negative Tutorial There's two methods to make a variable negative in Basic4GL. However, both methods both use two steps. 1. Check if the variable is actually negative 2. If...
Manage Multiple Sprites Tutorial This tutorial is unfinished and needs text explaining what how the code works. Complete Source Code TextMode(TEXT_BUFFERED) Dim img1 Dim spr1 Dim angle1# Dim...
Math in Basic4GL. Basic Operations Addition Print 4 + 2 Subtraction Print 4 - 2 Multiplication Print 4 * 2 Division Print 4 / 2 Math Functions Abs() Cos() Sin() Sgn() Related...
Hi, I'm Shawn hartnell. Nice to meet you. Badges Awarded to Hartnell for creating a member page. Scratchpad DrawText() For The current background page should be a tutorial or preferably, a...
Member pages are pages where you can write about yourself, write notes, and store your own files. Create Your Own Member Page To create your own member page: Type your name into the box below...
Members: Moderators Admins
Using the Mouse in Basic4GL write me Related Pages Player Control Mouse Tutorials Get the Mouse Cursor Position Set the Mouse Cursor Position Get the Mouse Cursor Position in...
If it's 0 it will check the left mouse button, 1 will check the right mouse button. It will return -1 if the button being checked has been pushed, if not, then it will return...
( Basic4GL 2.4.3 ) Mouse_X - Return the mouse's x as a percentage of where it is on the screen. Syntax Mouse_X() returns the x position of the mouse as a percentage 0-1 Description Returns the...
Syntax Mouse_Y() Description Returns the position of the mouse_y in a percentage 0-1 Examples dim tex dim sprite1 tex = LoadTexture("spaceship.bmp") sprite1 =...
Basic4GL Wiki Basic4GL Tutorial Basic4GL Beginner Basic4GL Introduction Basic4GL How To Basic4GL Syntax Basic4GL Variables Basic4GL Operators Basic4GL If Statements Basic4GL Loops Basic4GL...
Syntax ind = NewSprite( tex ) ind - index of the newly created sprite tex - texture to create it from Description NewSprite() creates a new sprite to be seen on the screen. It is used as...
Syntax Description OpenFileRead() opens a file for input (if it exists) and assigns a file handle which is useful in manipulating the file. The file handle is normally stored in a...
Syntax Description Examples dim file file = OpenFileWrite("file.txt") That will assign the file variable to that file, and can then be referenced to with any Write commands. If the file you...
OpenGL is an open source graphics library. Basic4GL has OpenGL support built...
Player control in Basic4GL can use the keyboard, mouse, or joystick (gamepad). Related...
(Basic4GL 2.4.3 up) Print - display text to the screen without a line break Syntax Print message message - number or string to be printed. Description Print displays a message to the...
( Basic4GL 2.4.3 ) Printr - print text to the screen Syntax Printr message message - number or string to be printed. Description Printr is almost exactly like Print with one exception. It causes...
Pull My Finger is an example of using Input and throwing away the value. It doesn't matter what the player chooses. The inevitable happens anyway. 'Pull My Finger : 'a stoopid game of...
The basis of all random things is a randomly generated number. Related Pages Documentation Randomize( ) Rnd( ) Backlinks Links Graphics at Game Design Novice
Randomize - seed the random number generator. Syntax Randomize() Description Randomize() changes the seed for random numbers making them more random. It's a good idea to use the game timer as the...
( Basic4GL 2.4.7 ) ResizeText - resize the text Syntax ResizeText ( cols, rows ) cols - how many characters wide rows how many characters tall Description ResizeText changes the size of the text...
Syntax copy = Right$( str, x ) copy - returned substring str - the string to copy from x - the number of characters to copy Description Right$() copies x characters from the right side of a...
( Basic4GL 2.4.7 ) Rnd - generate a random number. Syntax randNum = Rnd() randNum - generated random number. Description Rnd() generates a random number between 0 and 32767. This may not seem...
How to Rotate a Sprite Automatically in Basic4GL Create a New File Create a new Basic4GL file and save it. The below image is used in this example. Save it and put it in the same folder as your...
How to Rotate a Sprite Tutorial Create the sprite, set it up. Dim degs degs = 0 In the game loop: degs = degs+15 SprSetAngle(degs) That will turn it. Complete...
How to Run Basic4GL in a Window Basic4GL doesn't automatically run in a window. This can be annoying for you while developing a game, especially if the full screen mode changes your resolution...
(Basic4GL 2.4.10) ScanKeyDown - check if a key is pressed using a virtual keycode Syntax Description Examples Related Pages KeyDown() - check if a key is pressed. Backlinks These pages link back...
Syntax SetTextScroll ( bool ) bool - true or false Description SetTextScroll sets whether or not the text will scroll upwards if something is printed on the last line. By default it does, as the...
Syntax sign = Sgn ( x ) sign - returned sign of number ; -1, 0, or 1 x - the number to check Description Sgn() returns the sign of a number. In other words, it checks if the number is positive,...
Basic4GL Wiki Basic4GL Wiki SiteMap Recent Changes List All Pages Learn Basic4GL Beginner's Guide Tutorials Source Code Community Badges Community Team Member Pages Basic4GL...
Syntax Sing ( numb ) numb - any number Description Sin() returns the sine of a number in radians. Examples Return Sine in Radians. Print Sin( 42 ) Return Sine in Degrees Because OpenGL...
Basic4GL Wiki SiteMap :
Syntax Description Sleep() causes the program to stop and wait for x milliseconds before starting again. Examples Sleep for Two Seconds Sleep(2000) This will cause the program to wait for 2000...
Slide Control in Basic4GL Slide control is where the player object can only move two directions (left and right or up and down) and thus "slides". This is the kind of control used in slide...
Sound Functions DeleteSound() LoadSound() PlaySound()
This page is a list of Basic4GL source code available. Text Games Simple Guess The Number - the traditional Guess The Number GDN game. Stoopid Big Freekin' F - a Shawn N. Hartnell classic ported...
' Big Freekin F ' This program prints out a big freekin F on the screen. ' It is a tribute to the "banner" and "picture" programs ' popular in BASIC books of the 1980's. ' programmed by '...
Dark Maze is a traditional ASCII maze game. It features a "dark maze" where the player's light reveals only the tiles around it. Dark Maze is by Nicky. It is not released under the same Creative...
' The Dumbest Game ' the dumbest game written, ever! ' by the game designers of ' basic4gl.wikicomplete.info ' Staring Evile, the drunken leprechaun. 'dim variables ' answer holds the choice...
Sprites in Basic4GL. Related Pages Graphics Tutorials Load and Display a Sprite Manage Multiple Sprites Rotate a Sprite Rotate a Sprite...
Syntax Description SprSetPos( ) will set a sprite's position to the horizontal location of x, and the vertical location of y. Example dim texture, sprite texture =...
Syntax SprSetVisible( bool ) bool - either True or False Description SprSetVisible() hides or shows a sprite. If you use False, the sprite will be hidden. If you use True it will become...
Syntax SprSetXFlip(bool) bool - True or False. Description SprSetXFlip() will flip or "un-flip" a sprite horizontally depending on whether it's argument is True or False. Sprites do not flip...
Syntax SprSetYFlip(bool) bool - True or False. Description SprSetYFlip() will flip or "un-flip" a sprite vertically depending on whether it's argument is True or False. Sprites do not flip over...
Syntax Description Examples Related Pages Val() - convert a string to a number. Related Pages Backlinks These pages link back to this page. You may find them useful.
Strings are used for giving the player messages. Bits of string data are enclosed in quotes. Print "String!" Remember, even if a string is composed of nothing but numbers, it is still a string....
Related Pages Backlinks These pages link back to this page. You may find them helpful. Links Types at Game Design Novice
This article is a stub. You can help improve Basic4GL Wiki Complete by expanding it.
These pages are stubs. You can help by expanding them.
A Subroutine is a block of code that performs a specific task. Subroutines accept arguments but do not return a value. If you want a block of code to return a value, use a Function. Related...
Basic4GL is in many ways an outdated language. One of the most notable throwbacks is it's lack of modern functions and subroutines. This tutorial will teach you all about the ancient way Basic4GL...
How to Swap the Values of Two Variables in Basic4GL Dim a Temporary Variable To swap the values of two variables, you need a third variable which will temporarily hold the value of one of the...
Page to be included include:badge-name can not be found! Delete this line and type a short description of the badge here Display Code [[include include:badge-name member=member...
( Basic4GL 2.5.2 ) name - does something Syntax name ( argument, argument2 ) argument - explanation argument2 - explanation Description name does something in more detail. Examples Example...
This is the member page of User YourName can not be found. About Me Include a bit about yourself here, or completely delete this section if you want. My Badges I have earned the following Badges...
Text Guide Tutorials Basic4GL's text functions are useful for making text games. Draw Text Draw Text at a Location Clear the Screen Change the Text Size Change the Text Color Change the...
Syntax charwide = TextCols() charwide - how wide, in characters, the screen is. Description TextCols() checks how wide, in characters, the screen is. By default, it's 40. This can be changed by...
This is a list of Frequently Asked Questions about Text in Basic4GL. General What's with the ugly fonts? They're not fonts at all. Actually, they are sprites. Basic4GL's graphics engine and text...
This Basic4GL text game tutorial will introduce you to the fundamental concepts of game programming as well as the most common types of text games. Introduction to Text Games
( Basic4GL 2.4.3 up ) TextMode - change the text mode Syntax TextMode ( mode ) mode - text mode to change to : TEXT_SIMPLE, TEXT_BUFFERED or TEXT_OVERLAID Description TextMode() changes the text...
Syntax charwide = TextRows() charwide - how tall, in characters, the screen is. Description TextRows() checks how tall, in characters, the screen is. By default, it's 25. This can be changed by...
Timing in Basic4GL. Timing Functions ResetTimer() Sleep() WaitTimer() SyncTimer() Related Pages Backlinks These pages link back to this page. You may find them useful.
Top
edit this page edit sections history talk
How to Change the Text Color in Basic4GL Change the Color with Color() Color() accepts an RGB value. It will change the color of any text following its use. Color(255,0,0) Draw the...
How to Change the Text Size in Basic4GL Tutorial All text in Basic4GL is displayed using a grid system. By default, the grid is 40 characters across and 25 characters tall. Each cell in the grid...
How to Check if a Key is Pressed in Basic4GL Checking whether or not a key is pressed down is the first step of programming more complicated player control using the keyboard. How you check a key...
Clearing The Screen's Text Tutorial To clear the screen we simply use Cls. Example print("Test!") cls This article is a stub. You can help improve Basic4GL Wiki Complete by expanding it.
How to Create a Game Screen in Basic4GL Unlike most game programming languages Basic4GL does not require any set up to create a game screen or window. Just start up Basic4GL and hit F5. When you...
How to Create a Simple Game Object in Basic4GL This tutorial needs text explaining how this code works and explaining what a game object is. Complete Code TextMode(TEXT_BUFFERED) Struc...
Welcome to our Basic4GL tutorial section. Here you will find many Basic4GL tutorials. See also our Beginner's Guide. Basic4GL Tutorial This is our Basic4GL beginner tutorial. It is a step-by-step...
%%content%%
Syntax UCase$( str ) str - the string to turn to lowercase Description Turns a string into all uppercase letters. This can be used for text parsing ( possibly, most people use LCase$() ). As...
Syntax numb = Val( str ) numb = number returned str = string to change to a number Description The Val() function converts a text string into a corresponding number. Examples Convert a String to...
A variable is a data structure that can hold one type of data. Basic4GL variables must be created with Dim before you attempt to use them. This includes giving them a starting value. Because of...
Basic4GL's variables are stricter than in most programming languages. However, don't worry, they are just as simple. If you've never programmed before, this tutorial will give you an introduction...
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...
A B C D E F G I K L N P S T W A Abs() A Quick Look Around Basic4GL Array ASCII Game Primer Tutorial B Background Basic4GL Basic4GL Minimum C Comment Cos Core...
Useful Basic4GL websites : Basic4GL - official Basic4GL website. Basic4GL Forum - official Basic4GL forum. Basic4GL Wiki - official wiki Matthew-4GL a personal wiki with some Basic4GL...
These lists are for easy reference. list of errors This article is a stub. You can help improve Basic4GL Wiki Complete by expanding it.