Flash Game Developers - Get Your More Traffic to Your Games!
Are you a FLASH game developer looking to get more plays to your games? Are you looking for more Facebook exposure of your games?
If so, GameSerpent can help....please read on...
At this time GameSerpent.com is looking only for games to implement our highscore API. What this means is that your game can keep all the advertisements and links intact and can be URL locked to this domain, only your game will submit scores to our highscore tables here and on Facebook.
Our highscore games are played by thousands of our members here and on Facebook. Each has it's own Highscore table.
When a Facebook user submits a highscore, he also submits his/her score to his/her Facebook profile (known as feeds) which means more exposure to your game.
****************************
We are currently looking for quality, challenging and entertaining highscore games.
So, if you have a quality high score game that you would like to get more exposure, implementing our API will get you more plays.
Add our API (AS3)
Contact us first and send us a URL to a playable version of your game. We will email you back and let you know if your game is acceptable. (no nudity or things like that, games must be suitable for everyone i.e rated "E" and must not confuse the player about where to click to play the game.)
Once you hear back from us follow these instructions to access our Highscore API for AS3 games, follow the comments in the code below. There are 3 example dor different situations.
************
EXAMPLE 1 (Flex)
This works for Flex SDK (mxmlc) so if you get errors the see below
It is shown here in its own package but you can move it around to fit your needs.
package {
import flash.display.MovieClip;
import flash.events.*;
import flash.display.Sprite;
import flash.net.LocalConnection;
public class Send extends MovieClip
{
//don't change these, they create the channel name to access the API
public var chid:String = root.loaderInfo.parameters.chid;
public var channel1:String = 'GameSerpentChannel';
public var channel:String = channel1 + chid;
public function Send ():void
{
//Make your own button to click (we used a square to demonstrate)
var square:Sprite = new Sprite();
addChild(square);
square.graphics.lineStyle(3,0x00ff00);
square.graphics.beginFill(0x0000FF);
square.graphics.drawRect(0,0,100,100);
square.graphics.endFill();
square.x = stage.stageWidth/2-square.width/2;
square.y = stage.stageHeight/2-square.height/2;
//click the square to send your score
square.addEventListener(MouseEvent.CLICK, SendScore);
}
//Your Score Variables
// replace 999 with your game score variable
public var gamescore:Number = 999;
// replace 2 with your game mode variable if none leave as 2
public var gamemode:Number = 2;
//This is what connects to our API which is called when the square (button) is clicked
public function SendScore(event:MouseEvent):void{
var sender:LocalConnection = new LocalConnection;
sender.send (channel, "GameSerpent_api" , gamescore, gamemode);
}
}
}
****************
EXAMPLE 2 (for FLASH IDE) see exapmle 3 for a self contained class
*** Testing in the Flash IDE will throw an error because it is tryng to connect to the API just publish the file or add your own try catch routine to prevent this..
package {
import flash.display.MovieClip;
import flash.events.*;
import flash.display.Sprite;
import flash.net.LocalConnection;
public class Sender extends MovieClip
{
//don't change these, they create the channel name to access the API
public var chid:String;
public var channel1:String = 'GameSerpentChannel';
public var channel:String ;
public function Sender ():void
{
//Make your own button to click (we used a square to demonstrate)
var square:Sprite = new Sprite();
addChild(square);
square.graphics.lineStyle(3,0x00ff00);
square.graphics.beginFill(0x0000FF);
square.graphics.drawRect(0,0,100,100);
square.graphics.endFill();
square.x = stage.stageWidth/2-square.width/2;
square.y = stage.stageHeight/2-square.height/2;
//click the square to send your score
square.addEventListener(MouseEvent.CLICK, SendScore);
this.addEventListener(Event.ADDED_TO_STAGE, AddedToS);
}
//Your Score Variables
// replace 999 with your game score variable
public var gamescore:Number = 999;
// replace 2 with your game mode variable if none leave as 2
public var gamemode:Number = 2;
//This is what connects to our API which is called when the square (button) is clicked
public function SendScore(event:MouseEvent):void{
var sender:LocalConnection = new LocalConnection;
sender.send (channel, "GameSerpent_api" , gamescore, gamemode);
}
}
}
*************
EXAMPLE 3 (FLASH IDE self contained class)
*** Testing in the Flash IDE will throw an error because it is tryng to connect to the API just publish the file or add your own try catch routine to prevent this..
//you would submit a score with this line in your game
Send.SendScore(yourScoreVar, root, yourGameModeVar/if not set to 2/);
//yourScoreVar - var that contains your finale score
//yourGameMode - optional variable of your game mode, leave as 2 for default
//Then this code goes in a class called Send. Put it into a file of it's own and
//copy it into a folder with the rest of your classes so that you can import it into your game.
package {
import flash.display.MovieClip;
import flash.events.*;
import flash.display.Sprite;
import flash.net.LocalConnection;
public class Send {
public static var channel1:String = 'GameSerpentChannel';
public function Send ():void {
}
public static function SendScore (gamescore:Number,r: * ,gamemode:Number=2):void {
var chid = r.loaderInfo.parameters.chid;
var channel:String = channel1 + chid;
var sender:LocalConnection = new LocalConnection;
sender.send (channel,"GameSerpent_api",gamescore,gamemode);
trace ("submiting",gamescore);
}
}
}
*******MOCHIADS VERSION CONTROL USERS***********
If your game is using mochiads version control, you may need to find the actual root of your game.
To do that you will need to do something like this:
var r:DisplayObjectContainer = this;
while(r.parent) {
r = r.parent; // this codes finds the MochiCrypt -loader
}
GameSerpent.Send.SendScore(score, r, gamemode);
thanks to MuktoSoft for pointing that out to us!
AS2 Games
Shown here is some example code that submits the score with a button. You don't have to use a button. Optionally, you can send the score on an onLoad() or onEnterFrame event.
stop();
submitscore = new LocalConnection();//connect to GameSerpent.com API
//don't change these, they create the channel name to access the API
var chid = _root.chidas2;
var channel1 = 'GameSerpentChannel';
var channel = channel1 + chid;
// Your Score Variables
var gamescore = 999; //replace 999 with your gamescore variable
var gamemode = 2; //replace 2 with your game mode variable if none leave as 2
//***if you are using Mochiads version control your AS2 game may not work. //
//One work around may be to add _lockroot=true; to your main time line and see if that works.
//Or make a URL locked version only for use on gameserpent.com domain
After you have added our API
Tell us were to download your game by filling out Our Contact Form. (Or email us if we have already had communication). We will then test it to make sure it works and install it!
If you need help, we look forward to working out the details of implementing our Highscore API one on one with you so Contact us today so we can get things rolling and get you more traffic and game plays!
***please note: Games using our API will not be able to use mochi leaderboards unless you do some URL checking. For example: if the game is being played on http://gameserpent.com set your score code to use our API, if on some other site use code to submit to Mochi. Mochiads are welcome and encouraged!
Member Stuff
Get a Free Account
* Turn off site advertisements! * Save all your favorite games * Create your own Avatar * Comment on or review games * Play High score games * Rate Games * Chat with site admins * More........ Register! Already have one? Sign in! My Favorites Help