In-game banner experiments: 10k views results

In my latest game, Red Flowers, I introduced a new way to show ads.

At the bottom of the level-select screen, I am showing three ads. One linking to this blog, one asking for a PayPal donation, and one linking to Triqui.com.

Now it’s the time to publish some stats after 10k views.

First, I have to say banners appear randomly, and I did not count how many times every banner has been shown.

But, according to probability theory, in a large number of views each banner should have been shown the same number of times.

Let’s see the results:

Banner to this blog: 280 clicks
Banner to PayPal: 238 clicks
Banner to triqui.com: 339 clicks

Total clicks: 857

Click ratio: 857/11,055*100 = 7.75% (11,055 is the exact number of views I managed to look at the stats… it’s quite hard to stop at 10,000 sharp…)

It’s a great click-through in my opinion, and sponsors should have more interest in showing their ads in level-select screen rather than in useless fancy preloaders.

Now you may think: OMG you got 238 PayPal donations!!!

You’re wrong. I just got 2, for as much as $7… but it’s still a $0.63 eCPM that adds to $0.23 MochiAds is giving me at the moment.

At the moment I am completing another game with a different way to show banners (yes! another one!)

Stay tuned, as usual…

Understanding AS3 shared objects

This is the AS3 version of Managing savegames with Flash shared objects.

In this post I’ll explain the basic of shared objects, then later I’ll add the feature to Designing the structure of a Flash game – AS3 version in order to have a game template more complete.

Let’s start with the result: that’s what we are going to create:

As you will see, the counter increases when you reload the page.

Let’s take a look at the script: Read more

Sudoku creator/solver with AS3

At the beginning of this month I published the Sudoku creator/solver with PHP.

Now, after a little hassle due to a strange way AS3 manages arrays (in my opinion), I am ready to post the AS3 version of the solver.

This is what you will get

Results may vary if you don’t have Lucida Console font installed in your system, anyway the complete solved sudoku is in the sudoku array, so feel free to modify the code in order to display the sudoku in a more eye catching way.

Here it is the script: Read more

A strange way AS3 manages arrays

Today I was porting my Sudoku creator/solver with PHP in AS3 when I found this strange behavior.

I am calling it “strange behavior” because it’s not properly a bug… let’s say an issue.

Look at this script and its comments…

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
package {
	import flash.display.Sprite;
	public class wtf extends Sprite {
		public function wtf() {
			var my_array = new Array(1,2,3);
			var my_saved_array = new Array();
			trace(my_array);
			// 1,2,3 ... of course
			my_saved_array.push(my_array);
			trace(my_saved_array);
			// 1,2,3 ... of course
			my_array[2] = 4;
			trace(my_array);
			// 1,2,4 ... of course
			trace(my_saved_array);
			// 1,2,4 !!!! WHY? WHY?
			my_saved_array.push(my_array.slice())
			trace(my_saved_array);
			// 1,2,4,1,2,4 ... dirty trick...
			my_array[2] = 5;
			trace(my_saved_array);
			// 1,2,5,1,2,4 ... yeah!
		}
	}
}

I wanted to save various instances of my_array in my_saved_array in order to make some backtracking, when I found push() does not save the array content but the array itself, so if I change some my_array values, the pushed array will also change.

You can prevent it by saving a copy of your original array like I did with slice().

This does not happen neither with Php nor, as far as I remember, with C

What I know, I had an hard time debugging the script I was writing…

10 most popular Flash games of 2008 (from a PROgrammer point of view)

Ten days ago CNN published an article about Mochi Network: 10 Most Popular Flash Games of 2008.

Where normal people just see a list of funny games, a PROgrammer sees a list of funny games he could take as inspiration when making his next game.

The one that follows, is the top 10 list, with my personal considerations from a PROgrammer point of view.

The aim is to determine which game could easily be developed to make the next game of the year

1) BLOONS

It’s a simple game with a monkey popping balloons with darts, boomerangs and some other weapons. I also made a tutorial about the basics of this game in Create a Flash game like Bloons tutorial. Beside this, some weapons and bricks require some skills in coding.
Great level design.

Skills needed in coding: 2/5
Skills needed in graphics: 1/5
Skills needed in level design: 4/5
Overall difficulty: 2/5

2) Jane’s Hotel

As an inn-keeper, you must make your hotel gain popularity by satisfying your customers. Cool graphics and some advanced game mechanics make this game quite difficult to clone.

Skills needed in coding: 4/5
Skills needed in graphics: 5/5
Skills needed in level design: 2/5
Overall difficulty: 4/5

3) Bubble Struggle 2

It’s a Pang clone (also known as Buster Bros). Great game, but not so hard to code.

Skills needed in coding: 2/5
Skills needed in graphics: 2/5
Skills needed in level design: 2/5
Overall difficulty: 2/5

4) Papa’s Pizzeria

As a Pizzeria owner, you must make you customers happy. Very complex game mechanic with a lot of variables such as ingredients, timing and pizza slicing. Cool graphics and a great intro make this game a pain to clone

Skills needed in coding: 4/5
Skills needed in graphics: 5/5
Skills needed in level design: 3/5
Overall difficulty: 4/5

5) The Fancy Pants Adventure: World 2

Great game that reminds Sonic the Hedgehog with great graphics. The game with the best level design in this chart, and the hardest to clone.

Skills needed in coding: 5/5
Skills needed in graphics: 5/5
Skills needed in level design: 5/5
Overall difficulty: 5/5

6) Tower Bloxx

Build your tower by stacking blocks. The basics are simple to clone, but some visual effects require skill at drawing. The full game, featuring some managerial issues, adds some difficulty to coding.

Skills needed in coding: 4/5
Skills needed in graphics: 3/5
Skills needed in level design: 2/5
Overall difficulty: 3/5

7) Cube Crash

Clone of SameGame, this game can be easily written in any language, from javascript to Php. Basic graphics.

Skills needed in coding: 1/5
Skills needed in graphics: 1/5
Skills needed in level design: 1/5
Overall difficulty: 1/5

8) Bricks Breaking

Same thing as Cube Crash

9) Paris oh Paris

Feed Paris Hilton without letting her dog eat your meal. The most difficult thing when making this game is not getting sued by Paris Hilton

Skills needed in coding: 1/5
Skills needed in graphics: 2/5
Skills needed in level design: 1/5
Overall difficulty: 1/5

10) Stunt Bike Deluxe

Great game based on an old C64 game called Kick Start with improved graphics and gameplay.
Very hard to clone without a physics enginem and still quite hard even with Box2D or another similar tool.

Skills needed in coding: 5/5
Skills needed in graphics: 4/5
Skills needed in level design: 4/5
Overall difficulty: 5/5

That’s all. Now it’s up to you: should I start with an AS3 tutorial about Bloons or Bubbe Struggle?

Understanding how Box2D manages collisions

Box2D is a great library because you don’t have to care for collisions, the library manages all by itself.

But sometimes, specially in games, you may need to know when the player hits the coin, or the enemy, or whatever.

Box2D has a class called b2ContactListener that you have to rewrite to make it work as you want.

Let’s take the old crate test example explained at Dragging objects with Box2D Flash, and rewrite the code this way: Read more

Play Red Flowers

You are all invited to play my new game, Red Flowers

Red Flowers

It’s the classic “click and toggle” game, in this one you have to turn all gray flowers into red ones.

I got the permisson from Locomalito to import levels from his Red Spheres.

It took me 5 hours to made this 267 lines game, and at first I posted it on Flash Game License to look for a sponsorship when I had another idea.

All in all, I am running an experiment so I must try the weirdest things.

So, think about the game screen you see for the most of the time you are playing.

Well, that’s the game itself, but you are too busy in blasting aliens, slaying enemies, popping bloons and so on to care for anything else.

So let’s think about the runner-up… maybe the preloader? No, while the game loads I am checking for new emails. The splash screen? No way, I am just looking for the “play” button.

What about the level-select screen, when you sit proudly on you chair thinking you almost completed the game, preparing yourself for the last bunch of unlocked levels?

That’s it! You are relaxed enough to pay attention to ads. And you go to this screen everytime you complete a level…

That’s why in my level-select screen I included three randomly showing banners.

At the bottom of the level-select screen, I am showing three ads. One linking to this blog, one asking for a PayPal donation, and one linking to Triqui.com.

All clicks are saved and stored in a mysql database so I can have realtime statistics.

Obviously I will make them public as soon as I’ll get 1k, 10k, 100k and 1M plays.

Meanwhile try to guess the click/play rate.

Hint: don’t stay under 4%…

Understanding custom polygons in Box2D

Last week I explained The magic of compound objects with Box2D, now it’s time to understanding custom polygons.

First, let me tell you the difference between a compound object and a custom polygon.

A compound object is an object made by two or more primitive objects (like the maze I created in this tutorial).

A custom polygon is a primitive object which is different from the standard box and circle we usually find on Box2D, such as a triangle, a pentagon or any other regular or irregular polygon you can imagine.

There is only a limit: the polygon must be convex. Box2D won’t handle collisions properly with concave polygons.

From Wikipedia: « A convex polygon is a simple polygon whose interior is a convex set.
The following properties of a simple polygon are all equivalent to convexity:
Every internal angle is less than 180 degrees or equal to 180 degrees.
Every line segment between two vertices of the polygon does not go exterior to the polygon (i.e., it remains inside or on the boundary of the polygon).

A polygon that is not convex is called concave or reentrant. A concave polygon will always have an interior angle with a measure that is strictly greater than 180 degrees.

It is possible to cut a concave polygon into a set of convex polygons. »

Ok… now we are ready to write some code… Read more

Designing the structure of a Flash game – AS3 version

Abot a year ago I published Designing the structure of a Flash game with everything you needed to know to design the structure of a game.

Now it’s time to make the same thing with AS3, using classes.

With classes the whole thing seems less intuitive, but once mastered the base concept, you will use this example as a template for your games.

In this game, we have four screens: the splash screen, the info screen (how to play), the game itself and the game over screen… but you can easily add as many screens as you want.

First, let’s make a diagram of the game:

In the picture you can see the four game screens, and arrows indicate the possible transitions between a screen and another… so from the splash screen you can go to the info screen but you can’t go directly to the game over screen.

The main class is the_game (so our main file will be the_game.as) while all other objects and classes are listed in the library table. Refer to red numbers to see where I used the objects during the game.

Looking at the linkage column, it’s clear we’ll have four more actionscript files: game_over.as, how_to_play.as, splash.as and the_game_itself.as.

Let’s see them all: Read more

Improve your brand with a logo

Every company should have one little (and sometimes not so little) graphic displayed next to its name, and sometimes this graphic becomes so famous that people will recognize the brand just looking at the graphic.

Just look at these logos

There isn’t any name next to the graphic, but you surely recognized the companies just with a brief look at their logo.

So if a logo is important for a big company, it must be important for a small company too, or even for a personal website.

Having a polished, well designed logo will make your page look more professional. The more polished and original your logo, the more chances people will remember it.

That’s why I wanted a logo for the blog.

I designed about a dozen logos for some companies around here in my career, but I wanted to try a company that is specialized in logo design. So I googled for “logo design” and started watching the portfolios of some companies listed in the results page.

I was impressed by logos made by The Logo Company so I decided to buy a logo from them.

I purchased the basic package for $149 that included 5 mock-ups to choose from, unlimited revisions and initial concepts in three business day.

Let’s see what happened:

December, 7th

I placed the order. I had to fill a form with some information about the logo I wanted, such as the style (illustration, text based, …), the feel (high tech, corporate, …), my preferred colors and so on.

I wanted something like an avatar, so I sent them a picture of me.

Then I had to pay in advance. It was sunday, so nothing else happened.

December, 8th

A project manager was assigned to my logo, and wrote me an email saying he would send me the initial designs in a couple of days.

December, 9th

After only one business day, I got five design concepts. Being just concept, they wasn’t that polished, but I liked this one:

I liked the deformed look… but I don’t have blonde hair nor I like green shirts… so I wrote them about it.

December, 12th

I got four revisions of the logo I choosed, and I had an hard time having to choose between these two logos:

I loved them both but I decided to continue with the rightmost one because it looks more like me. I just asked to change the font, but I already decided to use the logo without my name, or with my name written by me. A geek always has to mess around with everything.

December, 15th

I got my logo in various formats, included the master I can edit with Adobe Illustrator.

Now that’s my logo:

Expect to see it on the new blog design coming “soon” and in my next Flash games.

» A well designed logo be be very important when it comes to branding your name, and a good logo can be used for all kinds of great promotional products and other types of marketing strategies to increase brand awareness.

Next Page →

flash games company