PLAYBASIC SOURCE CODES


Vertical Sprite Depth Ordering

     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.



Vertical-Depth-Sorting-Sprites.png
#1
Vertical-Depth-Sorting.zip (2.72 KB)

Atlus Snake

    Atlus's version of the Snake game

Atlus-Snake-titlescreen.jpgscreen-2.jpgscreen-3.jpg
#1
Atlus-Snake-Game-Source-Code.zip (385.35 KB)

Get All Files In Folder (Sorted)

     This example is built from a few other tidbits on the forums, what it does is returns a sorted list of the files that appear within a folder. The GetAllFilesInFolderSorted() function is recursive, so it'll search folders within this folder, if you don't want this you'll have to manually switch this off within the function.

     This type of function can be handy when writing programs that need to not only locate if a file exists, but how old a file is. For example, I've been using a variation of it to build thumb nail galleries recently, but it's also used in PlayPackager.

#1
Get-All-Files-In-Folder-Sorted.zip (6.46 KB)

Rotated Column

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

Rotated_Column.png
#1
Rotated-Column.zip (3.13 KB)

Puzzle15

    Atlus's version of the classic Puzzle 15 block sliding game
Atlus-Block-15-screen-1.jpg
#1
Puzzle-15-Source-Code.zip (642.99 KB)