Behold! Five Second Fiasco!
As you may have guessed, this is a collab entitled Five Second Fiasco. The concept here is very much the same as it was in the Four Second games the legendary jmtb02 produced (And before everyone kills me, he doesn't mind my organising this spinoff.), the only differences are that this version is , as you also may have guessed, Five seconds for each minigame, rather than the origional Four. There are also a few programming changes, such as AS3 support and a less restrictive API, and we have added a few more amusing features :P.
As you might expect, contributers earn a slice of the profits from the game proportionate to the number of games they had accepted.
So yes, please read onwards, and submit! This game can only become the awesome thing it has the potential to be with your help.
How to enter
To enter a game, you simply have to make an entertaining game that can be played in five seconds, come up with some rules, and email it to me at christopherkitching@hotmail.com. You must also tell me your PayPal address so i can give you money! (Assuming you want to be paid.) . For your security (And my convenience), and for anyone who is interested to know, the games will be stored inside the main program in a literal ByteArray. This may at first seem incredibly stupid, but it does mean that nobody decompiling the game has any real hope of getting at your minigames, and it's a useful way of my porting many flash programs in one. It also means that i do not need or want your .fla, as i will not be needing to access your source code (As long as you properly implement the API appropriate for your flash language.)
I was attempting to make a system whereby frame rate was not relavent, but it didn't really go so well - as such, framerate for enteries must be 30 - sorry!
Rules
There is presently no deadline for submission of games - we'll launch as soon as i have enough games (About 100-150ish, more the merrier!).
While there is no formal filesize limit, try and keep it as small as possible, less than 1 MB if you can. We don't want a 150MB flash game :P. Large games may be rejected.
Please try and keep filesize as small as possible! People don't enjoy loading screens!
Obviously, anything obscene, hugley violent, pornographic, stupidly gory etc. is not going to be accepted - this is a family-friendly game, we don't want small children being beaten to death by a man with a wrench, for example.
Coding etc.
You can write your game in any Flash language you fancy, however i will not be realeasing a pre-programmed API for AS1 because it's rubbish and i can't be bothered to learn it sufficently to be able to code one.
For AS2
If your game is being programmed in AS2, begin by pasting the code below into the first frame of the main timeline:
rules = "Do stuff.";
winAtTimeout = true;
//true if the player wins when time runs out, false if they lose.
rec = new LocalConnection();
conn = new LocalConnection();
//Put in this function things to trigger the game starting.
//This will be invoked as soon as the rules have gone away.
rec.beginGame = function() {
trace("Starting game!");
}
//Don't bother about this stuff too much...
rec.connect("GamePort");
conn.send("FiveSecondFlannel", "callBack", String(rules), String(winAtTimeout));
function winGame() {
conn.send("FiveSecondFlannel", "gameWon");
}
function loseGame() {
conn.send("FiveSecondFlannel", "gameLost");
}
As you can see, the beginGame function is invoked when you game appears. You put your rules in the rules variable, and the winAtTimeout value to true if the player wins after five seconds, or false if they should lose.
When the player wins your game, you call:
_root.winGame();
When ther player loses the game, you call:
_root.loseGame();
Please, do NOT put in a preloader.
Note that there are no constrains abnout use of _root as there have been in the four second collabs (Although not using _root won't do any harm, it isn't required that you don't use it.)
For AS3
As3 is prettymuch the same - you are doing the same LocalConnection calls, Here's an example of a basic program with the required functions defined:
package
{
import flash.net.LocalConnection;
import flash.display.Sprite;
/**
* ...
* @author DefaultUser (Tools -> Custom Arguments...)
*/
public class AS3Test extends Sprite{
public var winAtTimeout:Boolean
public var rules:String;
public var conn:LocalConnection;
public var rec:LocalConnection;
public function AS3Test() {
rec = new LocalConnection();
conn = new LocalConnection();
rec.client = this;
rec.connect("GamePort");
winAtTimeout = true;
rules = "Do stuff.";
conn.send('FiveSecondFlannel', 'callBack', String(rules), String(winAtTimeout));
//For testing, comment this line to prevent errors when game starts - Don't forget to uncomment it before you submit!
}
public function beginGame():void {
trace("Starting Game.");
}
public function winGame():void {
conn.send("FiveSecondFlannel", "gameWon");
}
public function loseGame():void {
conn.send("FiveSecondFlannel", "gameLost");
}
public function garbageCollect():void {
//In this function you must REMOVE ALL EVENT LISTENERS FROM EVERYTHING.
}
}
}
As the code comment says, you need to comment line 21 out in order to run the game outside of the main system, when you want to submit, ensure you uncomment it. If done right, the version you submit should throw an unhandled error event as soon as you run it (That means it's trying to connect to the main program, but can't.).
As with AS2, you cann winGame and loseGame in to win or lose, and winAtTimeout defines if you win or lose when time runs out. beginGame is called by the main system when the game is to begin.
IN AS3, there is also a Garbage collection issue. At the end of the game the garbageCollection function will be called - it is important that you remove all event listeners from all objects in your game in this function. Failure to do so will make the game system unstable.
Alternativley, define all your event listeners uing weak referencing, (Syntax like addEventListener(blah, blah, blah, blah, true);) - listeners defined thus do not have to be removed in the garbageCollect function, but it would be good if they were, for neatness :P.
And that's all! Remeber, the email address to submit your games to is christopherkitching@hotmail.com - as long as you did your coding right, i do not need your source code, so you don't have to send it.
All questions and such to the same address, please.
Get submitting! :)