8-bit fluff Title:Jon-Keatley.com

Example

GrubGrubGrub is a platform game with a twist; the player cannot jump. Instead the player can reach higher elements by rotating the world 90 degrees. The object of the game is to eat all the grubs in a level while avoiding predators within a set time. Awards are given based on how quickly you can eat the grubs and get to the exit. The game is data driven and receives its level information via a php script. The reason for storing the level data on the server is two fold. 1. It allows for levels to be altered and additional levels added without having to update the game (ideal if the game is hosted on many servers). 2. It provides a degree of copy protection as copying the swf will only get you half the game. The game is also site locked meaning the php script that provides the game with level data will only provide the data if the swf was hosted by a whitelisted domain. This means that the only way to copy the game would be to decompile the swf and alter the code that interfaces with the php script. To make this task even harder I have obscured the section of code responsible for transferring the domain details.Category: GamesMain Language Used: Actionscript / FlashSupport Languages Used: PHPClick to view

Coding Sampleprivate function processGame(tpassed:int) { var l:int = 0; for(l =0;l < mLife.length;l++) { mLife[l].Update(tpassed); if(mLife[l] is Door) { //if the door is open generate effects if(mLife[l].IsOpen) { mDoorOpenEffectCounter += tpassed; if(mDoorOpenEffectCounter >= DOOR_OPEN_EFFECT_DELAY) { mDoorOpenEffectCounter = 0; mBackEffects.Add(2,mLife[l].X + DOOR_EFFECT_OFFSET_X,mLife[l].Y + DOOR_EFFECT_OFFSET_Y); } } PlaceLife(l); } else if(mLife[l] is Grub) { if(mLife[l].IsDead) { mDeathCounter += tpassed; if(mDeathCounter >= DEATH_DELAY) { mDeathCounter = 0; EndGame(true); } } else { PlaceLife(l); } } else { PlaceLife(l); } } //for each collision grid cell check for collisions between neighbor life objects for(l = 0;l < Collision_Grid_Size;l++) { for(var m:int = 0; m < Collision_Grid_Size;m++) { CheckGrid(l,m,0,0); CheckGrid(l,m,-1,0); CheckGrid(l,m,1,0); CheckGrid(l,m,0,-1); CheckGrid(l,m,0,1); } } if(mTimer.Remaining == 0) { EndGame(true); } mMap.Update(tpassed); }