Facebook Bookmark Bookmark Bookmark Bookmark Bookmark Bookmark Bookmark Bookmark My Bookmark

LorenzGames, All about Flash Games!

Follow me on Twitter!

20 useful Flash API's and Tools

July 1st, 2009 - Read: 426 times - Category: Developers, Flash
Reading the MochiAds Forum I have found an interesting post containing a bunch of useful Flash API's and Tools. I elaborated it a lil bit and here it is, the bible for every Flash Developer! Emoticon

Flash Developers

Mutiplayer APIs SmartFoxServer is probably the most used, it is the core of many Multiplayer Games, probably the biggest one is Club Penguin. ElectroServer powers Webkinz. Either one and the other give you the possibility to create your game from zero, lobby included. They cost probably too much for an independent developer. I personally have used a lot the Nonoba, winning many contest on their site and the 2ND place of the final contest. It is easy to use and it is free but sometimes I found it a lil bit slow and it didn't let me customize the lobby. I didn't like very much to have a white and green lobby for all my games. BlossomServer is new and it has been created by Jiggmin, the author of Platform Racing. It is free and it gives you the possibility to download the source code and change if you want. The only problem is that it is based on a PHP socket server... which is not stable as Java or C.Red5 is a free java server, but probably it crashes too much.

3D APIs I have used all of them and honestly my favourite is Away3D.It is quite simple to use and it has a lot of functions for game designer.I wrote an article about it few months ago, you can read it here .

3D physics APIs This is the only 3D physics engine that I'm aware of for Flash. From looking at a few of the tutorials, it looks like you would have use this physics API in conjunction with a 3D API so you can render what's actually going on. I haven't had a chance to actually use the API, so I can't give much of an opinion.
2D physics APIs I have used Box2D in my last game Dynamic Systems http://www.lorenzgames.com/game/dynamic-systems .
They have a nice community and it is easy to find tutorials on Internet.

IDEs From what i have heard FlashDevelop is great. It has great syntax highlighting, auto completion, and it's just overall a whole lot better to use compared to the built in Actionscript editor in the Flash authoring tool, plus it's free! FDT should be good too, but it's not free.

TweenersA Tweener is basically a tool that creates transactions in an object.
For example if you need to move an object from point A to point B with an animation.
The Caurina one is one of my favourite, probably because i have used it for so long.
They have surely saved me a lot of work.

Debuggers

For now this is all, if you have any other interesting Tool please contact me. Emoticon


Write a comment

How to import games to your site from MochiAds

June 27th, 2009 - Read: 245 times - Category: MochiAds, PHP, Publishers
MochiAds gives you the possibility to directly download the games to your site through JSON.
The problem is that many people has no clue how this thing works, that's why i have created a script that not only allows you to Download how many games you want from theire site, but gives you the possibility to use the button "Post to my site" that is on the page of every game on MochiAds for manuale downloading.

Mochiads Logo

This script will only unpack the JSON, then you will have to put everything in your own Database and downloading the files the way you want wherever you want. For example you can use the method:
file_put_contents("where you want the file to be", file_get_contents("url of the file on mochiads"));

The only thing you have to change in the code is the Publisher ID, you can find your own here.
If you are going to use the manual submission from MochiAds dont forget to add the link to the file where you put this script in "Auto POST URL".
I set the type of games to download to only featured games, if you want to download all just change "featured_games" to "all".
Please enjoy and share. Emoticon

PHP
$pubID = "Here put your Publisher ID";
$gt=$_POST['game_tag'];
$extrag=$_POST['extrag'];
$typeGame="featured_games"; // Change it to 'all' if you want to import all the games.
 
if($gt!=""||$extrag!=""){	
	if($gt!=""){
		$json=file_get_contents("http://www.mochiads.com/feeds/games/".$pubID."/".$gt."/?format=json");
		$n=1;
	}
 
	if($extrag!=""){
		$json=file_get_contents("http://www.mochiads.com/feeds/games/".$pubID."/".$typeGame."/all?format=json&limit=".$extrag);
		$n=$extrag;
	}
 
	$jsonArr=json_decode($json,true);
 
	$g=0;
	while($g<$n){
		$gameArr=$jsonArr["games"][$g];
		$name=$gameArr["name"];
		$description=$gameArr["description"];
		$instructions=$gameArr["instructions"];
		$swfUrl=$gameArr["swf_url"];
		$imgUrl=$gameArr["thumbnail_url"];	
		$category=$gameArr["categories"][0]; // This is an Array [0] will take the first catgeory choosen.		
		$keywords="";
		$nTags=count($gameArr['tags']);
		for($i=0;$i<$nTags;$i++){
			$keywords=$keywords.$gameArr['tags'][$i].' ';
		}
		$width=$gameArr["width"];
		$height=$gameArr["height"];
		$g++;
 
		echo "<a target='_blank' rel='nofollow' href=".$swfUrl." target="_blank"><img style='margin:10px 0px 10px 0px; border: solid 2px #FFFFFF;' src=".$imgUrl."> ".$name."</a><br>";
	}
}


HTML
 <br><input name="extrag" value="5" size="5" type="text"><br>MochiAds Games <input value="Download" name="Submit" type="submit"><br> 


Write a comment

Make a game with PlayCrafter without a line of code!

June 25th, 2009 - Read: 76 times - Category: Developers
If you have alwasy wanted to make a game but you have zero clue about programming, today to help you there is PlayCrafter!
This brand new site is like a huge level editor, very similiar to Splooder that has tons of objects to just drag and drop on the stage.
It has the potential to make really good games.
It's like the TorqueX of Flash. So in some sorts, yes, it is more like a powerful level editor...

Watch this teaser to understand better:



That's PlayCrafter! not a single line of code needed...
As you can see you have a big list of objects divided in categories, plus you can use game templates to make just the game you want.

There are almost 20 game templates to choose.

PlayCrafter Template

On LorenzGames we have accepted 2 games made with PlayCrafter, one is Matcheroo and the other one is Buggy Bricks.

Just remember that not a line of code means you have the control they gave you.
You will not be able to earn anything from them and of course you will not be able to sell licenses of them or place the logo of your site.
I think the idea is quite good, people may start with this and then as they strive for more options they will eventually have to turn to programming in Flash!


Write a comment

The ultimate PHP image resizer to create perfect thumbnails!

June 23rd, 2009 - Read: 111 times - Category: PHP
I have recently created a new image resizer in PHP.
This not only scale and resize with an amazing quality, but I created some parameters to give effects as you can see in this image.
Best PHP Image resizer
You can:
  1. Simply resize your image the dimension you want and it will AutoCrop too.
  2. Darken the image.
  3. Make it brighter.
  4. Invert the colors.
  5. Use less colors.
the usage is very simple: upImg($_FILE, or "http://url", Size Width, Size Height, "output name ex:temp/name", "darker", "brighter", "colors", Invert: 0 or 1)

Here is th code, enjoy! Emoticon
upImg('','ds.jpg',80,80,'namefile',0,0,256,0);
 
function upImg($file,$urlfile,$sizew,$sizeh,$uploadfile,$squared=0,$squared2=0,$pal=256,$inv=0){
	$uploadfile.=".gif";	
 
	if($urlfile!=""){
		$file = array("size" => 0, "type" => "");
		$file["size"] = strlen(file_get_contents($urlfile));
		$file["type"] = strtolower(str_ireplace(".", "", substr($urlfile, -4)));
	}
 
	if($file["size"]>200 && ($file["size"]/1024)<3000){
		$ft=str_ireplace("image/","",$file["type"]);
		if ($ft=="gif" || $ft=="png" || $ft=="jpeg" || $ft=="pjpeg" || $ft=="jpg"){
			if($urlfile==""){move_uploaded_file($file["tmp_name"],$uploadfile);}
			else{file_put_contents($uploadfile, file_get_contents($urlfile));}			
			if ($ft=="gif"){$simg = ImageCreateFromGIF($uploadfile);}
			if ($ft=="png"){$simg = ImageCreateFromPNG($uploadfile);}
			if ($ft=="jpeg" || $ft=="pjpeg" || $ft=="jpg"){$simg = ImageCreateFromJPEG($uploadfile);}			
 
			$swdt = imagesx($simg); 
			$shgt = imagesy($simg);
			if($swdt<$sizew){$sizew=$swdt;}
			if($shgt<$sizeh){$sizeh=$shgt;}
			$dimg = ImageCreate($sizew, $sizeh);
			$rX = $swdt / $sizew;
			$rY = $shgt / $sizeh;	
 
			if($sizeh>$shgt*($sizew/$swdt)){		
				$rX = $swdt /($swdt *($sizeh/$shgt));
				$Rx=((($swdt*($sizeh/$shgt))-$sizew)/2)*$rX;
			}			
 
			if($sizeh<$shgt*($sizew/$swdt)){
				$rY = $shgt /($shgt*($sizew/$swdt));
				$Ry=((($shgt*($sizew/$swdt))-$sizeh)/2)*$rY;			
			}			
 
			imagetruecolortopalette($simg, false, $pal);			
			ImagePaletteCopy($dimg, $simg);
 
			$w = 0;
			for ($y = 0; $y < $sizeh; $y++)  {
				$ow = $w; $w = round(($y + 1) * $rY+$Ry);
				$t = 0;
				for ($x = 0; $x < $sizew; $x++)  {
					$r = $g = $b = $squared2; $a = $squared;
					$ot = $t; $t = round(($x + 1) * $rX+$Rx);
					for ($u = 0; $u < ($w - $ow); $u++)  {
						for ($p = 0; $p < ($t - $ot); $p++)  {
							$c = ImageColorsForIndex($simg, ImageColorAt($simg, $ot + $p, $ow + $u));
							$r += $c['red'];
							$g += $c['green'];
							$b += $c['blue'];
							$a++;
						}
					}
					ImageSetPixel($dimg, $x, $y, ImageColorClosest($dimg, abs(($inv*256)-($r / $a)), abs(($inv*256)-($g / $a)), abs(($inv*256)-($b / $a))));
				}
			}			
 
			imageGif($dimg, $uploadfile);
			imagedestroy($simg);
			imagedestroy($dimg);			
			return $uploadfile;			
		}
		else{echo "Error: The file must be a GIF, PNG, or JPG!";}
	}
	else{echo "Error: File Size incorrect!";}	
}


Write a comment

How to add MochiAds to your game and earn money from it

June 21st, 2009 - Read: 118 times - Category: Developers, Flash, Monetize
As many of you know it, Mochiads as improved a lot in the past 2 years.
One of its competitors, GameJacket, failed last week.
Many developers are doing good money with the Mochi Advertising right now.
Are you doing it? Probably you should give it a try!

Mochiads Logo

Mochiads Version Control not only works as advertising but also protect the code of your game.
Here I am going to explain you how to add it to one of your games in ActionScript 3.

First important thing to do is, if you don't have an account, click here to Sign-Up MochiAds Developers Program.
Login in the dashboard and click on the yellow button Setup New Game.
Now it will ask you:
  1. The Title of your game.
  2. The dimensions of you game, write it how big it is, like 640x480 for example (The game must be not smaller than 300x300).
  3. Version Controll click Yes.
  4. Create Game.
In the Version Controll version you dont need to download the Include files from MochiAds.
Now it will ask you to Authenticate your game, write that string of code on the first frame of the time line, or in the document class. The string will be something like this:
var _mochiads_game_id:String = "your code";


If you are using a Document Class remember to clear everything from the Main Function.
For example let's pretend your Document Class is named MyGame.As inside you need to be sure it will look something like this:
package {
	//...imports
 
	public dynamic class MyGame extends MovieClip{
		//...declarations of variables
 
		public function MyGame () {
			//Here nothing!
		}
 
		//... other functions.
	}
}


Now select the colors of you preloader, you can even upload a custom image if you want, make a custom JPG the same size of your game and upload it to make it appear under the preloader line. It will look more fancy!

Then upload your SWF, give it a version number, like "1.0" or" 0.5alpha"... as you want... Emoticon
And eneter a little description only for you, like "First upload".

OK, now continue, download the file they just created for you, it contains the SWF you will have to distribute.
It's almost over Emoticon.
You need to fill out the game profile.

In Game URL write the Link of a page where people will be able to see your game and then upload the swf you just got there.

Add Description, an icon of 100x100 (I suggest you to make a very cute icon becouse it is the first thing people will see), Catoegories, Keywords and Save.
Great, now you are DONE!

Last thing to do if you want is to enable your game for distribution so that Mochiads will help you to spread it on internet.


Write a comment

Moving Bones in AS3 and Flash CS4

June 19th, 2009 - Read: 136 times - Category: ActionScript 3, Developers, Flash
This tutorial will teach you the basics to add bones to an object and move them using ActionScript 3.

It is quite simple, those are the steps to do:
  1. Design something ( to test i designed something like a snake Emoticon ).
  2. Click on the button Bone Tool (X).
  3. Draw a bunch of bones on the object making sure they are attached.
OK, now you should have something like this:
A Snake moved with bones in AS3
Make sure the last bone on the head is called: ikBoneName6

As you can see in the TimeLine now you have a new layer called Armature_(Number), rename it to Armature_1 if it has another number.

Now click on the Armature_1 layer and you should see in the properties something like this:
Armature Bones setting in AS3
Make sure to change the Type in Runtime.

Now create an empty layer where to place the ActionScript on the TimeLine (to keep the tutorial short i placed everithing on the timeline).
import fl.ik.*;
 
var tree:IKArmature = IKManager.getArmatureByName("Armature_1");
var bone:IKBone = tree.getBoneByName("ikBoneName6");
 
// tailJoint will manage the point of your bone, if you want to manage the head of your bone you need to use headJoint
var tJ:IKJoint = bone.tailJoint;
var posT<img src='http://www.lorenzgames.com/smiles/P.gif' alt='Emoticon' width='14' height='14' />oint=tJ.position;
 
var ikMover:IKMover = new IKMover(tJ, posT);
 
addEventListener(Event.ENTER_FRAME, onFrame); 
function onFrame(event:Event){
	posT.x=mouseX;
	posT.y=mouseY;
	ikMover.moveTo(posT);
}


Now you are set, Test the movie and you should get something like this:



Of course spending lil bit more of time will make this a lot better! Emoticon


Write a comment

GameJacket Failed

June 12th, 2009 - Read: 197 times - Category: Monetize
Months ago i talked about how good was GameJacket...
Sadly i recived an e-mail yesterday telling exactly those words:

"Last month, GameJacket learned that the funding round it had engaged it had failed with the proposed venture capital investor withdrawing its offer due to the uncertain current economic climate. Since this time GameJacket's management has been actively seeking a buyer for the continuation of the business. Despite initial strong interest, all active lines of enquiry were concluded yesterday resulting in no buyer being identified. We’re sorry to report that GameJacket ceased to trade as of yesterday and the company will make a further announcement in due course. The employees and management of GameJacket have worked tirelessly to build and maintain the GameJacket concept and we’re disappointed in this outcome. The company would also like to take this opportunity to thank developers for their generous support and to apologise for the inconvenience this situation will cause. If you have any questions, please contact questions@gamejacket.com"



This thing is very bad for many developers and publishers having games with them.

The developers now will, not only lose all the not paied money the earned but even worst, the games they published all over the web suddenly stopped to work!
I had to remake one of my games, Rotating Balls, this time i used MochiAds, i repleaced the game here, on Kongregate and Newgrounds, i hope sites from all over the world will change it using my new version... but i hardly doubt about that! Emoticon
For sure now we will see a zillion of new games (games using GameJacket) on MochiAds in the next few days, I hope this wont effect the eCPM!

For publishers this is going to be the worst of the nightmares, find all the games from GameJacket and remove them becouse they dont work anymore!
This is bad, will take me a while to make it on LorenzGames.

I really hope this mess is not going to affect the game industry too bad.


Write a comment

How to start to make Flash Games?

April 19th, 2009 - Read: 579 times - Category: Developers
To start to make Flash Games is actually not that complicated, anyone with a lil bit of passion and time can have a try!
I suggest you to download Adobe Flash CS4 from Adobe, they will give you for free the 30 days trial version, so you can evaluate it.
OnLine you can even find some free programs that compile ActionScript, like FlashDevelop.



Then, when you get your program check on Google for: ActionScritp 3 Tutorials.
You can find the best on the site of Emanuele Feronato.

Kirupa is a good forum where you can register and ask any question you want about ActionScript 3 (Shortly AS3).

On LorenzGames you can have an idea of the best flash games made by the best game designers on the world.
I organized few super best game on another site ILikeToGame, you can check them.

In this industry they pay those games from $3k to $10k for the cool ones or more for awesomeness, or you can just put your own advertising like MochiAds, there are so many ways of monetization with this kind of games, you just need to start and give a try! Emoticon


Write a comment

GameSite Domain Names - SEO Vs Originality

April 9th, 2009 - Read: 594 times - Category: Developers
While I was searching for an available domain name to buy for a friend of mine, looking around I just understood that the 99.99% of all the .COM logic sense domain names including the words: "Games", "Game" or "Play" are taken.
Funny thing is that most of them are just sitting there in "PARKING" pages probably for years. I guess some of them make a couple of dollars a year for that Spam, some other little bit more.

I recently contacted one of this parked domains freeflashgames.com, right now you can see it's just a Spam page. I was thinking: "Well, OK, usually I would pay 9 dollars for a COM domain, but I really like this name i would offer 50 dollars!" for a moment I thought it was too much, anyway, now 50 dollars for me was like, I am giving you way more than enough for a Spam page that probably has been banned by some search engine.

A very nice person answered to my email saying that the price i wanted to pay was too low, they where starting the bids from a price of $400.000, yes, Four Hundred THOUSANDS of dollars!Now honestly what is the point? In a market saturated like this, who is the insane mind that is going to spend that money?
And what is the point to buy a domain that contains the word "Game" when the ruler domains of this industry don't even mention it: Newgrounds, Kongregate, MochiAds, Nonoba, Whirled or a more recent Fupa that has an Alexa ranking that looks like the profile of a mountain.


Of course is all about SEO (Search Engine Optimization) today, but does it really work?

After a consultation with some other developers on MochiAds, this is what came out:If you look at Alexa's top ten sites by traffic, most of them have domain names that really aren't helpful at showing what the site's about.
Having words like "Games" or "Flash" helps your SEO work. But if you are going to build something larger and put a lot of effort into it, those words are less important.I would say a original name is good, and you can build a brand of it.Of course, if you would happen to have Games.com, that would be a winner.

You shouldn't use "-" in the domain name. Not necessary, but having a domain name that is easy to remember and hard to misspell is an advantage.

Toys.com was recently sold for 5.1 million USD. ToysRus was the buyer.

Don't mention that your games are addictive in your domain name, that word is so overused that is pretty much useless right now.It's important to plan ahead and map out how you want to develop your website before you go shopping around for a domain. Different domains serve different purposes.

Some factors to consider:

Branding

A domain like "Free-Online-Games.biz" might do well from
an SEO perspective but it's a nightmare to try and brand. If you ever
consider selling casual games or other services it would be very hard
to gain consumer trust with such names.

Community-Building

Similar to branding, but community tends to build around
non-generic names. Games.com is brandable, but it has no personality
(talking about the domain, not the site). Would you be proud to be a
community member of Games.com? Maybe, but it sounds very generic.

Attracting advertisers

If you get big, you'd want to attract ad dollars from big
companies with big brands. But having a lot of impressions isn't
going to get you the big brands by itself. The big boys want their
brands associated with other quality brands. It will be hard to
convince advertisers that "Free-Arcade-Games.net" is a
premium brand.

Good SEO domain names are impossibly hard to come by, all good.com keywords are taken. And if you force a keyword in your domain, you're just making it longer than it needs to be. If you throw in the word 'games' 'online games' or 'free games' in your domain, don't expect to rank for any of those terms in search engines. If you want to try it out, nothing is stopping you from creating a generic site and sending traffic to your main website. But for your main website I
would suggest creating a Memorable domain/branding. To get search engine traffic, you have to work for it over a dedicated length of time, so don't expect there to be a shortcut.



Read 2 comments - Write a comment

The power of Digg in the Flash Games industry

March 27th, 2009 - Read: 653 times - Category: Publishers
The site Digg.Com can really help us to improve the visibility of our games or our game site.
This is something that probably everybody knew, but many people are still trying to make it without any success.

On MochiAds Forum there is a thread that contains all the active developers.
I am sure if you help them to digg their games, they will help you to digg your things.

I am going to create a list here of active Digger interested in Flash Games that you can add to your friends.
The idea is to be friend with all on this list.. which is going to grow every day. When you will have all this people in your list, you will have to use it with etiquette, meaning you can not shout spamming stuff all day long, but only if you have something very very cool, or you just released a new very cool game. This way we can allow everybody to receive real Diggs and Comments and probably end up on the front page.

lorenz82 - npgames - theadory - FullerGames - cccpingu - kaolin - onlinegames - jgames - lolwaffle - rhuaridhclark - gamebittk - Vartagh - Dalshiner - RJGames - eternalsyndrome - quezada - somenick - PlayCow - SidWoo - Grendelio - AllFlashNow - KannushiLink - gws34 - frederik77 - stupidflashgames101 - rei1974 - Musenik - onemangs - ninjagames - kimcuddles - mikemx7f - grimdayz - Gaz - Hamumu - aegamers - puppygames - gummikana - UnknownGuy - jebso - Polycount - PoVRAZOR - ajschatz - cliffski - jankoM2 - theoretical - pyabo - BantamCityGames - terin - Indiepath - Genimo - chanon - BortQ - cyrus_zero - indiepath - rinkuhero - clilian - samnova - sillytuna - winterwolves - badsectoracula - yellowhut - Sodaware - bazdigger - agent4125 - tafty - crispiness - PiEyeGames - JKaercher - jonaswills - bignobody - MrPhilGames - chillypacman - tfowers - parsap - Red27Studios - dbestandy - theblackmask - JForceGames - ducridah750 - kneehat - jasonriggs - HybridMindGames - JoUBG - Mexsillus - oscardog1991

If you are interested please send me a message and I will add your Digg Page in the list.


Write a comment