Integrate your Flash game on Facebook

You all should know Facebook. I think it would be interesting to integrate your Flash game into a Facebook application.

There are more options than you can imagine, but at the moment I’ll just embed a game, nothing more. Just remember there will be a lot more.

Obviously, first you have to have a Facebook account and be logged in

Then you have to install the Developer application.

From this page http://developers.facebook.com/get_started.php click on “Add Facebook Developer Application” and you will be able to start creating your own applications.

Once you clicked on that link, you will find a “Developer” item in the left nav button. This is your application control panel, where you can manage your applications.

Click on “Set up New Application”

You will be redirected to a quite unclear page with a lot of fields to fill… don’t worry, you will be out of this step in less than 2 minutes. Read more

XPOGames developer contest: $18,000 in prizes

This is a month full of rich contests.

Today we’ll talk about XPOGames and its $18,000 cash and prizes contest

XPOGames

The chief of Management and PR wants to explain you all what’s hot at XPOGames:

XPOGames.com / Management and PR

We have issued an official Media Alert (or Press Release) last week which includes all the information regarding our present contest. Nevertheless, I will try supply you with bits of relevant information from within that Media Alert in this post:

XPOGames.com, a new gaming-based social network has just announced the launch of a new game development contest: the ‘$18,000 XPOser game development contest’ for the year 2008, open to each and every flash game developer world-wide. The contest is amongst the most luxurious contests ever published in the field, in-fact, the XPOser 2008 contest will award the highest cash prize ever to be awarded in an independent game development contest.

The contest will award a sub-total of $18,000 and features 3 categories: an Exclusive category which will award the grand-prize of $6,500, a Non-exclusive category which will award the first place out of ten with $4,500 and a Quantity category which will award 2 participants with $1,500 and a Nintendo Wii game console. All categories require the integration of the XPOGames toolkit into each of the uploaded submissions. Each developer will be able to sign-up and submit his/her games for approval and when a submission is approved it is counted as a legit contest entry.

Once a participant reaches 3 approved submissions it is automatically sent a free 1gb limited-edition XPOGames.com USB flash-stick, once a participant reaches 10 approved submissions it is automatically sent a free 2gb limited-edition XPOGames.com USB flash-stick, and once a participant reaches 20 approved submissions it is automatically sent a free 4gb limited-edition XPOGames.com USB flash-stick.

We’ve been getting really great and positive feedback on the contest, a lot of developers are wanting to participate and we’re already enjoying some of their creations. There are still 75 days left to go and many opportunities to win. Our contest staff will continue to post newsflashes, comments and answers to your questions on the feedback block at the lower section of the contest page. More information is available at the contest page. Stay tuned, all this is only the tip of the iceberg as the XPOGames.com community-website is preparing for its launch and will introduce a lot of new, unprecedented features to the gaming community.

As mentioned above, more information for your entry can be found at the contest page and the official Media Alert can be found at here

In addition, don’t hesitate to post your comments for any additional and specific information.

Managing multiple balls collisions with Flash

The first post of the new year (you should know the new year starts on May, 27th) is made by Sunil Changrani and it’s about managing multiple balls collisions with Flash.

I already published a tutorial about Managing ball vs ball collision with Flash but this time we’ll manage any number of balls.

Sunil was just making a Flash game and he ended up getting stuck when he needed a lot of circles to collide with each other.

With some help from Tony Pa, Voidskipper and Kazama_bee, ended up making some nice perfect collisions.

In the movie there are two symbols, one empty movieclip called blip and a movieclip called circle (which has the ball)

So here it is the commented code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
stop();
t = 0;
dx = 0;
//Creating variables
_root.attachMovie("blip","blip",_root.getNextHighestDepth(),{_x:1500, _y:200});
_root.createEmptyMovieClip("container_movie",_root.getNextHighestDepth());
//attaching the movieclips
blip.onEnterFrame = function() {
	//this is the function that executes every frame
	if (Math.random()*1000<100 and t<50) {
		//This condition adds another circle after a certain random interval till total circles are 50
 
		circle = container_movie.attachMovie("circle", "circle"+t, container_movie.getNextHighestDepth(), {_width:a, _height:b, _x:(20+Math.random()*300), _y:(20+Math.random()*300), _rotation:Math.random()*300});
		t++;
		circle.xspeed = Math.random()*9;
		circle.yspeed = Math.random()*9;
		//Creating the circle with random x and y speeds.
		circle.onEnterFrame = function() {
			this._x -= this.xspeed;
			this._y -= this.yspeed;
			//Motion of the circles
			if (this._x<10) {
				this._x = 10;
				this.xspeed = -this.xspeed;
			}
			if (this._x>490) {
				this._x = 490;
				this.xspeed = -this.xspeed;
			}
			if (this._y<10) {
				this._y = 10;
				this.yspeed = -this.yspeed;
			}
			if (this._y>390) {
				this._y = 390;
				this.yspeed = -this.yspeed;
			}
			//Making sure the circle won't go out of the boundaries. 
		};
	}
	//From here I start checking for collisions of the circles
	for (i=0; i<t; i++) {
		a = _root.container_movie["circle"+i];
		for (j=i+1; j<t; j++) {
			b = _root.container_movie["circle"+j];
			var dx = b._x-a._x;
			var dy = b._y-a._y;
			var dist = Math.sqrt(dx*dx+dy*dy);
			//Checking the distances between two circles.
			if (dist<20) {
				_root.solveBalls(a,b);
				//The circles I've taken are of radius 10, so if distance <20 then they collide, so I call a function.
			}
			else {
			}
		}
	}
};
//This function is provided by kazama_bee at mochi forums. I'll try my best to explain it
function solveBalls(ballA, ballB) {
	var x1 = ballA._x;
	var y1 = ballA._y;
	var dx = ballB._x-x1;
	var dy = ballB._y-y1;
	var dist = Math.sqrt(dx*dx+dy*dy);
	radius = 10;
	//it calculates the distance, i could have passed it to the function but it works this way
	normalX = dx/dist;
	normalY = dy/dist;
	midpointX = (x1+ballB._x)/2;
	midpointY = (y1+ballB._y)/2;
	//Now this calculates the normal and mid points..
	ballA._x = midpointX-normalX*radius;
	ballA._y = midpointY-normalY*radius;
	ballB._x = midpointX+normalX*radius;
	ballB._y = midpointY+normalY*radius;
	//shifts the two circle two a different location so they don't hit each other
	dVector = (ballA.xspeed-ballB.xspeed)*normalX+(ballA.yspeed-ballB.yspeed)*normalY;
	dvx = dVector*normalX;
	dvy = dVector*normalY;
	//This calculates the new speeds for the circles
	ballA.xspeed -= dvx;
	ballA.yspeed -= dvy;
	ballB.xspeed += dvx;
	ballB.yspeed += dvy;
	//assigns the new values
}

And this is the result: look at the balls… how interesting!

Now tell me for how long will we see games based on this engine… I have one idea… download the source code and thank all developers.

2 years of blogging

Today the blog is 2 years old!!

2 years of blogging

A lot of funny things happened during this year… Google slapped me down from PR7 to PR4, then the site was hacked a dozen times and marked by Google as an harmful site.

Now, it’s PR5, recognized as an authority by Google and I am the most famous Emanuele in the world!

The number of posts raised from 77 to 264, the number of comments from 1,093 to 4862

Alexa rank went from 158,059 to 65,147, and the blog had over 1,000,000 visitors

What an amazing year!

Well, next one will be better!! I have so many plans…

Nonoba Flash Multiplayer API contest: $20,000 in prizes

This post is written by Chris Benjaminsen from Nonoba.com. Nonoba is a gaming community where you can play games with your friends. What I personally like about Nonoba is they allow you to create your own achievements. See my Bees n’ Flowers page to see what I mean.

Nonoba

This is Chris Benjaminsen:

I have been reading your blog for quite some time [thanks for wasting your time reading my blog - Emanuele] and though I might finally have something thats cool enough for you to talk about.

Basically our company, Nonoba.com, just announced that we are releasing an easy to use, fully hosted and free Multiplayer API for flash developers. This should allow pretty much anybody with rudimentary flash skills to create multiplayer games, without any hosting costs.

An example of such a game can be seen here http://nonoba.com/chris/racing

We have been working with multiplayer flash games on our own server technology for a long time, and during that time a lot of flash developers and companies has approached us for access or licensing of that technology. This made us realize that there is a huge demand for a great flash multiplayer API, so we decided to wrap it up into an easy to use API and release it as a free hosted service.

The API supports the full range of multiplayer games, from simple turn based games to more complicated realtime games. To show these capabilities, we have released a new, and in our opinion, awesome game called Nonoba Racer. We have also ported some of our old creations to act as examples in the SDK, such as Fridge Magnets, Multiplayer Asteroids and DrawPad.

We want to make all the things that are currently hard for flash game developers dead easy. Our hosted Multiplayer API is the first big step in that direction. We’ve got more APIs in mind to fix the rest of the stuff that we think is currently too hard.

Since we’re so confident that we’re on the right path with our Multiplayer API, we’re also announcing our first big game competition with $20.000 USD in prices and a first price of $15.000 USD, for the best game to be built on the Multiplayer API.

Sign up for beta access, and more info here:
http://nonoba.com/developers/multiplayerapi/overview

Monetize your Flash game with GameJacket

If you are looking for a new way to monetize your Flash games, then you should take a look to GameJacket, an online game advertising service actually in beta.

GameJacket

According to the faq, to start earning money you upload the game source files (.swf) through the GameJacket Developer Console and output your custom ‘GameJacket’.

Each ‘GameJacket’ .swf is unique and acts as the substitute for the game source files.

This is the file that you can freely submit to game portals and allow to spread virally around the net. When somebody plays your custom ‘GameJacket’, both the advert and the game source file are loaded in dynamically from the GameJacket servers.

You can find some useful information at the developer page http://www.gamejacket.com/developer.asp and in the FAQ http://www.gamejacket.com/developer.asp?devSection=faq#nav_anchor, but I got some exclusive information from Barry White, Founder & Director of Content at GJ

$1000 paid in advance

There are a lot of rumors in the net about the $1000 bonus, so let’s see what Barry says:

The $1000 bonus is not actually a bonus, it’s a guarantee that’s paid in advance on any advertising revenues the developer may earn from their game. If they don’t earn a $1000… we don’t chase you for it! It’s yours to keep and after 6 months, if you want to, you can remove your game entirely from the GameJacket Network. All we ask is that for the first 6 months, every version that appears on the web is in it’s GameJacketed form, unless the developer wishes to sell a site-locked non-exclusive version to another portal.

$0.50 CPM guaranteed

If you are worried about your low CPM when the ad is displayed in non english speaking countries, you should read what Barry has to say:

a) Our version control system also allows you to upload different language versions of the same game and the custom GameJacket detects the users browser settings and serves them the correct localised version of the game.

b) Some of our developers have realised that GameJacket allows them to sell a new kind of license, one in which they can actually place sponsors logos within the game or game menus for a set period of time, when the license expires they simply upload a new version with a new sponsors message! Our technology also allows developers (although no one has done this yet) to upload different sponsorship logos specific to different territories; so for example a developer could sell a 12 month advert for Heineken Beer for all game files served to Dutch users and a 6 month advert for Kronenbourg Beer to French users… all this from the same custom GameJacket .swf

c) Currently we are guaranteeing a minimum of $0.50 CPM for ALL impressions, regardless of which territories they originate from.

d) It’s important to state that developers always have full control over what versions they choose to display or whether they wish to remove their game from our service. (6 months with the $1000 advance)

Sign up for the beta

You can sign up for the beta here http://www.gamejacket.com/developer.asp

It’s useless to say I signed for the beta and I am going to try GJ with my next game, then I’ll made the complete report.

Create a font browser with Flash AS3

When I am looking for an interesting font for my web design, the first site I look at is dafont.com.

What I like of this site is the capability to preview the font I am going to use with a sample text.

We are going to build something like a font viewer with AS3, previewing the fonts currently installed in our computer.

This script is based on a tip found on Cristalab. I suggest to read this site if you can read spanish.

In order to do this (learning spanish? No! The font browser) we need three object on the stage: an input text area instanced as sampletext, where we will write the text to be displayed in the selected font, a List User Interface component instanced as font_list, that we will populate with all fonts, and a dynamic text instanced as displayer to show the result.

Then, in the first frame of the movie timeline, this is the actionscript:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var fonts:Array = Font.enumerateFonts(true).sortOn("fontName");
var fonts_array:Array = new Array();
for (var i:int = 0; i < fonts.length; i++) {
	fonts_array.push(new String(fonts[i].fontName));
}
font_list.dataProvider = new DataProvider(fonts_array);
font_list.addEventListener(Event.CHANGE, change_font);
sampletext.addEventListener(Event.CHANGE,change_text);
function change_font(event:Event):void {
	var font:TextFormat = new TextFormat();
	font.font = new String(font_list.selectedItem.data);
	displayer.setTextFormat(font);
}
function change_text(event:Event) {
	displayer.text = sampletext.text;
}

Line 1: Creation of an array called fonts with all currently available embedded fonts, sorted by font name.

Line 2: Declaring a new array called fonts_array

Line 3: Loop scanning all fonts array. Notice that with AS3 in the for conditions you must declare the index variable, and this code

for (i = 0; i < fonts.length; i++) {}

that worked fine in AS2, does not work anymore with AS3

Line 4: Pushing the ith fontName property of the fonts array into the fonts_array array. What a mess!

I am just passing in the array created at line 2 only the fontName property of the font contained in the fonts array created at line 1.

I need to do this because a font has three properties: fontName, fontStyle and fontType, and I need only the first one.

Line 6: Populating the list with the content of the fonts_array array. Now we have a list with all font names

Line 7: Adding a listener to the list that will call the change_font function when I select a list element

Line 8: Adding a listener to input text that will call the change_text function when I change the text in the input text area

Line 9: Beginning of the function to be executed when I select an item from the list

Line 10: Declaration of a new TextFormat class called font. The TextFormat class is used to stylize both static and dynamic text fields.

Line 11: Assigning to the font TexFormat font the value of the selected item in the list. In this way I am defining the font of the font TextFormat

Line 12: Applying the text format to the displayer text area

Line 14: Beginning of the function to be executed when I change the text in the input text area

Line 15: Changing the text in the displayer text area according to the text actually in the input text area

And that's it...

Download the source code and enhance it.

Jamag: a Flash game you’d better master

While my second one-week game is still under level design, I released this game based on the Eskiv prototype.

It’s called Jamag and it’s Just Another Mouse Avoider Game.

Jamag

What makes this game different than the ohter one million mouse avoider games, is that I am planning to start a contest for all players to make the top score.

And when I say contest, I mean conte$t, I am giving away real cash for playing the game.

At least, that’s what I am planning to do… as soon as I will define some security issues, the contest will take place.

Meanwhile, you’d better start training at this game.

More ramblings about Flash game portals

Do you remember the post Ramblings about Flash game portals? I was wondering why portals spend thousands dollars sponsoring games.

So I decided to create my own Flash games portal called Triqui (read the post Play Flash games on Triqui.com) and as Triqui I sponsored the game Bees n’ Flowers as you can see on Experiment: monetizing a Flash game – Part 9.

Ok… now that you read all these posts, let’s start telling you what happened last Friday, May 16th

That day was a special one because Bees n’ Flowers was added on the Spill Group network. You should know the Spill Group network because of its most famous portal, Agame, but they have localized portals all over Europe.

In order to have my game listed in their portal I had to remove MochiAds, but it was ok, because I wanted to test how many people clicked on the sponsor banner and the revenue that they would generate from Triqui.

That’s what happened from May 16th to May 18th:

People on the Spill Group network played Bees n’ Flowers times about 125,000 times

According to Google Analytics, about 24,000 of them clicked on the banner, linking to a Triqui landing page, generating about 75,000 page views. Jumping to Adsense, I noticed the page eCPM was about $4 (yes! four bucks!)… and I did not count how many people will come back to Triqui.

So, let’s say that I could have sponsored Bees n’ Flowers for $300 without losing my money.

And I am talking about a game I am not very proud of, where people don’t click too much on “play more games” (you aren’t willing to see more games if the game you are playing sucks), and a portal that is just the millionth portal in the web

So, encouraged for the result of this first experiment, I’ll start adding new features to the portal, such as game ratings and comments. I know at the moment a visitor won’t come back to Triqui, but maybe when I’ll add some features, I can fidelize him.

Last but not least, I am planning to make a contest. It’s not a contest for developers, but a contest for players. I would like to pay something like $100 to the player that will make the top score in a game.

Maybe the idea will spread virally… who knows? With 100k players, I should pay the prize and buy me a Coke.

Would you play to win money? Would you talk about it? Would you buy my underpants?

This, and a lot more, coming soon

The worst Google logo ever. EVER!!

Well, what can I say?

worst Google logo ever

This is not only the worst Google logo, but probably the worst logo ever created

That’s what happens when Google artists turn wasted time into logo design and they don’t flush away bad results…

… anyway, they gave me an idea for a game…

Next Page →

flash games company