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 #7 items in Videos category by Kevin Picone

 Particles Using Sprites

By: Kevin Picone Added: May 6th, 2016

Category: All,Particles,Videos,Effects,Alpha Blending

Particles Demo Using Sprites

     This is an older code snippet that was originally written by Crystal Noir, it creates a type of 3D particle explosion using animated 2d sprites. I've tweaking the code and fixed some logic errors and this was the end result.

Particle Demo Video



Get Source Code




 Meta Balls - Light Blobs

By: Kevin Picone Added: April 22nd, 2016

Category: All,Demos,Videos,Effects,Alpha Blending

Meta Balls - Light Blobs

This example recreates a popular demo effect known as meta balls/blobs. The scene is calculated by working out the amount of energy that each pixel receives from the surround 'blobs' or lights. The more lights the more work each pixel has to be do.

So if you did all the work (calc the distance etc) in the inner most loops, you’d get a pretty heavy per pixel calculation. Such a loop would run slowly even in assembly/machine code. So what we need to do is come up with some ways we can simplify the inner loop to get the cost per pixel down as much as possible.

Video:



Related Links:

- Get Source Code
- A Crash Course In BASIC program Optimization





 Vertical Sprite Depth Ordering

By: Kevin Picone Added: June 3rd, 2012

Category: All, Sprites ,Videos


     This example breaks away from the concept that depth is straight into the screen. In fact, Sprite Depth/ Scene Depth are just a sort order keys for the object. We can set the depth key to anything we like (0 to $ffff). Here i'm creating a scene where the sprites drawn vertically sorted upon their Y values.

     To do this, we're using the sprites screen position on the Y axis, and inverting it for our depth value. We need to invert the value as the sorting engine draws things in highest to lowest. So smaller z values are drawn after higher ones.

     What this means is that characters further down the screen (represented as some coloured ellipses) are drawn after characters above them. So foreground characters can appear to walk in front of other characters.




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




 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




Viewing Page [1] of [1]



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]