EXAMPLE SOURCE CODES


     This is a small collection of mostly game example source codes. These source codes are made available to help PlayBasic programmers kick start their game programming journey. Looking for more source code / tutorials & media, then remember to visit the PlayBasic Resource board on our forums.

Found #151 items

 Selective Tile Map Refreshing II

By: Kevin Picone Added: May 20th, 2012

Category: All,Maps


    This is a more updated version of the previous example. The only real difference is that, this one uses built maps where is the original one demonstrates the hands on method. Apart from that they're pretty much the same, with just some tweaks for newer editions of PlayBasic V1.64M and above.

    This is another short PlayBasic source code example, this one's demonstrating a selective redrawing method using PlayBasic Maps. The program attempts to reduce the cost per refresh by not redrawing the entire backdrop picture every frame. It does this by tagging the overdrawn zones that need to be restored using a Map. So basically the backdrop picture is first cut up into an Map representation. In this example the block size is 32x by 32y pixels, giving us a level size of (800/32 by 600/32). The demo uses two versions of the level tile map data. One is the original and the second is a version we're going to draw from. We need two since the redraw version gets cleared and altered each frame.

     When drawing character objects (in this demo those are the circular blobs), we move the object then convert it's 2d space coordinates back into map coordinates. Then copy from this tile/block area from Original Level to the Refresh Level. We repeat this process for all on screen objects. So after processing our characters, the refresh map contains the parts of the backdrop that need to refreshed (reset) back to it's original state before drawing the next frame. So rather than redraw the entire backdrop picture every time, we can selectively refresh the backdrop. This type of method works really well in 2D games, as it allows the program to lower the cost per-pixel, ironing out the performance for older systems. By older, I mean systems beyond 5 years, closer to 10 years old really

Download: Login to Download




 Glow / Lightning Balls

By: Kevin Picone Added: May 1st, 2012

Category: All, Videos, Effects


     This source code is variation of the one of the older example. The main change is that this version takes on more of a 3d feel.



Download: Login to Download




 Textured Tunnel

By: Kevin Picone Added: April 2nd, 2012

Category: All, Videos, Effect


     This is a PlayBasic version of the classic demo effect found in many Amiga / Atari demos from the 90's.


Download: Login to Download




 Atlus Snake

By: Atlus Added: December 31st, 2011

Category: All,Games


    Atlus's version of the Snake game


Download: Login to Download




 8Way Layered Star Field / Asteroids Style

By: Kevin Picone Added: December 30th, 2011

Category: All, Games, Effects, Videos

     This example creates a layered infinitely scrollable star field using shapes. The star field can move/wrap in all 8 directions, much like you'd see in Asteroids arcade style games.. Here we're using Shapes to batch render dots, rather than trying to brute force them individually


Download: Login to Download




 Rotated Column

By: Kevin Picone Added: December 29th, 2011

Category: All, Videos, Effects


     This is a little effect that renders a perspective /rotating column with camera push in/out.


Download: Login to Download




 Atlus Tetris

By: Atlus Added: December 15th, 2011

Category: All,Games,puzzle


     Here is Atlus's version of the classic Tetris puzzle game


Download: Login to Download




 Puzzle15

By: Atlus Added: December 2nd, 2011

Category: All, Games


    Atlus's version of the classic Puzzle 15 block sliding game
Download: Login to Download




Viewing Page [5] of [19]



Want More Source Codes?:



Release Type: The source code & tutorials found on this site are released as license ware for PlayBasic Users. No Person or Company may redistribute any file (tutorial / source code or media files) from this site, without explicit written permission.

 

 
     
 
       

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