Help needed
This is what I found today in Google search engine:

I know I shouldn’t talk about attacks because it just made more attacks to happen, but this time I really don’t know what to do.
I receive half of the traffic from Google and really don’t know what to do.
I know my site was hacked but during the last days I manually cleaned the site.
I made all steps required on StopBadware.org but the problem still remains.
If you have any clue or should you find another harmful script from now on, can you please comment the post with your problem/opinion.
Experiment: monetizing a Flash game - Part 7
Multipart tutorial: available parts 1, 2, 3, 4, 5, 6, 7, 8, 9
For those of you that wonder how it’s going with the experiment (read posts from 1 to 6 to know more about it) here’s a quick update:
Circle Chain
Days in the wild: 77
MochiAds impressions: 267,872
MochiBot plays: n/a
MochiBot top 3 sources: n/a
Google Adsense impressions: 33,256
Newgrounds score: 3.56
Kongregate score: 3.05
Hours spent developing: 3
Hours spent promoting: 1
Income: $234.49 ($59/hour)
Notes: It’s the game that started the experiment. I did not embed MochiBot because I thought it was included in MochiAds. At the moment, it’s the game that people liked the most, and it was reviewed on Jay is Games.
Christmas Couples
Days in the wild: 47
MochiAds impressions: 17,648
MochiBot plays: 2,110,171
MochiBot top 3 sources: mindjolt - t45ol.com - jatek.hatekonyan.hu
Google Adsense impressions: 4,024
Newgrounds score: 2.60
Kongregate score: 2.33
Hours spent developing: 6
Hours spent promoting: 1
Income: $14.40 ($2/hour)
Notes: It’s my most played game, with over two millions plays. Unfortunately, I suck so I sent a couple of versions without MochiAds around the web so my income is very very poor. At least I am in the million players club. It’s also the game that people liked the less and the game that costed me the most hours of development. I’ll never thank enough Richard Fields at Mindjolt for the big exposure. Mindjolt rocks!
Tileball
Days in the wild: 28
MochiAds impressions: 27,106
MochiBot plays: 29,450
MochiBot top 3 sources: freeworldgroup.com - daflax.com - t45ol.com
Google Adsense impressions: 743
Newgrounds score: 3.52
Kongregate score: 2.91
Hours spent developing: 6
Hours spent promoting: 1
Income: $14.42 ($2/hour)
Notes: I spent the most time designing the levels because the game is based on an engine I already developed. It’s not going well but I have some ideas to promote it in a better way. This game has to generate more than $400, that’s what a sponsor paid for a game based on the same engine.
GuessNext
Days in the wild: 15
MochiAds impressions: 106,008
MochiBot plays: 112,003
MochiBot top 3 sources: mindjolt - kongregate - newgrounds
Google Adsense impressions: n/a
Newgrounds score: 3.12
Kongregate score: 2.15
Hours spent developing: 4
Hours spent promoting: 0
Income: $85.33 ($21/hour)
Notes: I made this game to test if including any API in Kongregate would change its revenue. Revenues and impressions on Kongregate remain low if you do not hit the frontpage, but I modified two rows and submitted it to mindjolt. It’s now featured in the most popular scored games so I think it will be a success
Glomb
Days in the wild: 2
MochiAds impressions: 799
MochiBot plays: 665
MochiBot top 3 sources: newgrounds - kongregate - zupagames
Google Adsense impressions: n/a
Newgrounds score: 3.24
Kongregate score: 2.68
Hours spent developing: 3
Hours spent promoting: 0
Income: $0.79 ($0/hour)
Notes: no income yet but I made this game yesterday. It’s the first game that features MochiAds Leaderboards and I plan to spread it massively during next days.
Total hours spent developing: 22
Total hours spent promoting: 3
Total income: $349.43 ($14/hour)
An average freelance programmer in Italy is paid about $44/hour so in my opinion the experiment is not going well.
But, it’s not over ’til it’s over… I am sure I’ll pass the mark of $44/hour and a lot more.
Stay tuned!
Multipart tutorial: available parts 1, 2, 3, 4, 5, 6, 7, 8, 9
Glomb - The first Flash game to use MochiAds Leaderboards
Update: MochiAds Leaderboards released - let’s see how does it work - read this post too!
I am very happy to introduce you Glomb, the first Flash game to use MochiAds leaderboards to track highscores.
The game was built upon the idea of a Prototype of a Flash game like Biggification, but I changed some concepts and rules in order to try and make a rather original game.
But even if I will release the code and the tutorial about the game, this is not the topic of this post.
Today I will talk about the upcoming MochiAds Leaderboards.
I would like to thank Ada Chen and Ryan Nichols to let me test and try and mess around with their API and give me the permission to publish something about it.
MochiAds system lets you setup a new leaderboard in minutes, with these main features:
- Create as many leaderboards as you need
- Store any kind of score (sort by highest, lowest, and store integers or time)
- Only one line of code to show an in-game leaderboard
- Track player Countries
- Customize the leaderboard look to match your game graphics
As you can see in this screenshot (that may vary a bit once the leaderboard will be released since Mochi team is still working on it) you can crate a leaderboard just entering a couple of information.

Then, you can customize it by choosing colors, columns, and there will be a preview window to test your leaderboard

Once you finished setting up the leaderboard, this is the control panel where you can ban users or clear scores.

Leaderboards can be daily, weekly or monthly… at the moment I don’t know if there will be an “all time” leaderboard, but I am strongly asking for it!
With all these features, there is no reason to look for other highscoring system.
Now all you have to do is wait a couple of weeks until the API will be released for the public, meanwhile Mochi guys are asking for feedback, so it’s your time to request anything you would like to find in a leaderboard.
Update: MochiAds Leaderboards released - let’s see how does it work - read this post too!
Flash game level editor
All big game industries use game editors to design the levels of their games. Just think about games like Unreal Tournament 3… its maps are designed with a level editor. It would be impossible to design such accurate maps just inserting array values or XML tags or whatsoever.
We aren’t creating games like UT3, but even games with much simpler level design like Tileball needed a level editor to design the tracks.
I used a prototype made by OutsideOfSociety… and if you don’t know this name… it’s the guy that inspired Tony Pa’s tutorials.
Unfortunately, OOS is not active for a long time, and I am afraid he won’t come back more than a couple of times in a year
So I decided to continue his project about Flash tile game editors.
Don’t let the name confuse you… with a tile map editor you can design a lot more than platform levels… as I said, Tileball was designed with an editor, and with the same editor you can design, for example, Bloons levels, or some tile-based Nitrome games, and so on.
The editor provided by OOS is very poor, but it’s a good start to design a complete one, with all features a modern editor must have.
This is the to-do list I plan to… ehm… do.
- Saving in progress levels in your hard disk
- Loading levels from your hard disk
- Exporting levels both as array and as XML files
- Creating virtually infinite maps with zoom and pan
- Managing virtually an infinite number of tiles
I’ll start coding it very soon. Do you have any other idea about the features the editor should have?
Prototype of a Flash game like Biggification
Do you know a game called Biggification?
It's the perfect example of an one-day game that made a great success, scoring a 3.78 on Newgrounds and being reviewed by 151 people with an average score of 8.3
The aim of the game is very simple, as shoud be any one-day game: collect expanding orbs by hitting them with your orb before they hit another orb and end the game. Collecting same color orbs consecutively give you a multiplier.
That's all.
Well, I created a prototype of this game in 64 rows
-
Mouse.hide();
-
delay_in_frames = 5;
-
frames_passed = 0;
-
game_over = false;
-
balls_array = new Array();
-
_root.onEnterFrame = function() {
-
if (!game_over) {
-
can_place = true;
-
frames_passed++;
-
if (frames_passed == delay_in_frames) {
-
frames_passed = 0;
-
x_pos = Math.floor(Math.random()*400)+50;
-
y_pos = Math.floor(Math.random()*300)+50;
-
for (x in balls_array) {
-
dist_x = x_pos-_root[balls_array[x]]._x;
-
dist_y = y_pos-_root[balls_array[x]]._y;
-
distance = Math.sqrt(dist_x*dist_x+dist_y*dist_y);
-
if (distance-_root[balls_array[x]]._width<50) {
-
can_place = false;
-
}
-
}
-
if (can_place) {
-
balls_array.push("ball_"+_root.getNextHighestDepth());
-
ball = _root.attachMovie("ball", "ball_"+_root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:x_pos, _y:y_pos, _width:1, _height:1});
-
ball.gotoAndStop(Math.floor(Math.random()*3)+1);
-
ball.onEnterFrame = function() {
-
if (!game_over) {
-
this._width += 0.25;
-
this._height = this._width;
-
dist_x = this._x-_root.my_ball._x;
-
dist_y = this._y-_root.my_ball._y;
-
distance = Math.sqrt(dist_x*dist_x+dist_y*dist_y);
-
if (distance<(this._width+my_ball._width)/2) {
-
my_ball.gotoAndStop(this._currentframe);
-
remove = this.getDepth();
-
}
-
for (x in balls_array) {
-
if (_root[balls_array[x]].getDepth() == remove) {
-
_root[balls_array[x]].removeMovieClip();
-
balls_array.splice(x, 1);
-
}
-
if (this.getDepth()>_root[balls_array[x]].getDepth()) {
-
dist_x = this._x-_root[balls_array[x]]._x;
-
dist_y = this._y-_root[balls_array[x]]._y;
-
distance = Math.sqrt(dist_x*dist_x+dist_y*dist_y);
-
if (distance-(_root[balls_array[x]]._width+this._width)/2<0) {
-
game_over = true;
-
}
-
}
-
}
-
}
-
};
-
}
-
}
-
}
-
};
-
_root.attachMovie("ball", "my_ball", _root.getNextHighestDepth(), {_width:25, _height:25});
-
my_ball.gotoAndStop(1);
-
my_ball.onEnterFrame = function() {
-
if (!game_over) {
-
this._x = _root._xmouse;
-
this._y = _root._ymouse;
-
}
-
};
Line 1: Hiding the mouse
Line 2: Defining the interval, in frames, between the creation of a ball and the next one Read more
How to embed MochiAds highscores in your game
As you should know, MochiAds is not only the largest ad network for Flash games, but it also provides additional - and free - services to its users.
One interesting feature is highscores management.
In the MochiAd.as file you must include in your game in order to show ads, there are two functions, without any documentation but some inline comments, that manage highscores.
Mochi people are developing a new highscores API and it would be ready to be released in January, but I think a little guide about current API will be useful anyway for three reasons:
1) As a web developer, I know that sometimes "January" means "February"
2) At the moment there is not documentation at all about the current API
3) Probably the new API, as all new software, will need some time to be optimized when released
So, let's see how to use the current API.
Somewhere in your movie, in order to embed MochiAds ads, you have to put this line
MochiAd.showPreGameAd({id:"xxxxxxxxxxxxxxxx", res:"wwwxhhh"});
where xxxxxxxxxxxxxxxx is the 16 figures id Mochiads gives you when you submit a new game and wwwxhhh is the width of your game, the x character and the height of your game (es 550x400). Remember your xxxxxxxxxxxxxxxx id.
Now the entire basic process can be made in a few lines. When the game is over and it's time to submit the score, write:
-
var highscoreobj:Object = new Object();
-
highscoreobj.highscoremet = function(scores, position) {
-
for (x=0; x<50; x++) {
-
name = scores[x][0];
-
score = scores[x][1];
-
timestamp = scores[x][2];
-
}
-
};
-
MochiAd.sendHighScore({id:"xxxxxxxxxxxxxxxx", name:your_name, score:your_highscore},highscoreobj,"highscoremet");
Line 1: Defining a new object called highscoreobj
Line 2: Defining a new method for the highscoreobj called highscoremet. The method has two parameters. The first is the array storing the highscores, the second is the position of the last submitted score, or -1 if it's not in the top 50. MochiAds will store "only" the top 50 scores.
Line 3: Beginning a loop from 0 to 49. The API will save the top 50 scores, but it's not mandatory to display them all. If you want to display only the top 10, change the 50 with a 10. Just remember highscores are stored in an array, so the first element is at idex 0.
Lines 4-6: Retrieving the xth ranked name, score and timestamp.
We can represent the scores array in this way
[[name of the 1st, score of the 1st, millisecond timestamp of the 1st], [name of the 2nd, score of the 2nd, millisecond timestamp of the 2nd], ...]
after line 6 and before line 7 you will have to insert your code to display the highscores with an optional message like "congratulations you ranked position-th in top 50" or "oh no! you are not in top 50", according to position value.
Line 9: This is how we submit the score achieved by the player. The only things you have to change, if you simply cut/paste my code, is your_name with the name of the player and your_highscore with the score of the player.
Change the xxxxxxxxxxxxxxxx with the id provided by MochiAds and you are ready to host an highscore table. The remaining two parameters refer to the object and method to call when the score is submitted.
That's all... a complete and global higscores table in just a few rows... thanks to MochiAds.
Complete Flash pool game with highscores
Today is a very important day. For three reasons.
First: For the first time (as far as I know) a coder that published a complete game with MochiAds released the full source code of its game.
Second: It's a damn good and complete game with loading, splash, gameplay, game over, and highscore table.
Third: I am the first to publish the source code, with the full permission of Alejadro Quarto, from Argentina
Alejandro runs a blog mainly about Flash Examples, and even if the blog is running only since october 2007, it's full of useful tutorials. The name of the blog is alejandroquarto.com and I think it will be a "must read everyday" very soon.
Unfortunately some of the content is written in spanish, but even spanish posts contain a link to english content published by the aouthor elesewhere.
But let's get back to the game.
As said, Alejandro is releasing the full source code of his pool game. I really want you to play it because you must see how good is the game. It's called PocketPool
That's how he describes his work:
I have to say, the physics are not real, cos it can take a long while to play with all the Newton’s laws. Anyway, simulation is playable, and compared with any webgame arround. If you want to play real pool, development can take more than few hours.
This is the game screenshot:Art is based on pics i found on google, and some Flash edition, you know, filters like shadow, glow, etc. The game is complete, with loading, splash, gameplay, game over, and highscore. All the highscore system is provided by MochiAds. Really simple to integrate and it works really cool.
He is trying to monetize the game with MochiAds, and that's how it's going:
after 2 weeks of bad luck, im having between 1300 and 1700 impressions at day.
Alejandro made this game in a day (!!!), so the source code may be not the cleanest ever, and some variables and functions have spanish names, but I found it very clear and it's amazing how he made the entire game in a bit more than 700 lines of code.
On his blog, he plans to make a step by step tutorial of the game as soon as he can
But what makes this entry a special one is that a developer is releasing the source code of a game he is trying to monetize.
I would like it to be an example for all game developers out there... if we share our knowledge and experience, this will lead to better games and higher earnings.
Download the source and give Alejandro feedback and deserve him good luck with his game.
Now it's my time to dive into 700+ lines of actionscript and learn as much as I can.
Win $3,500 with the Casual Gameplay Design Competition #5
Jay is Games is hosting his 5th Casual Gameplay Design Competition, sponsored by Gimme5games, Mochi Media and Adobe.

Gimme5Games may seem the million-th games portal in the net, but it's owned by Eidos (Tomb Rider guys), while Mochi Media is the company behind MochiAds and MochiBot. Adobe is... well... Adobe.
To enter, you have to submit a Flash game before Sunday, March 3rd, 2008 at 11:59PM (GMT-5:00). Tjere are no strict guidelines, but your game must incorporate the upgrade theme. How to include this theme is up to you: during JiG past competitions, I noticed that they encourage creative interpretations of the theme.
Prices range from $3,500 and one Adobe Flash CS3 Professional license for the 1st place to $500 for the Audience award.
In order to enter the competition you have to sign up with MochiAds, so you will earn money even when the game is under judgement.
You'll find full instructions at the official competition page.
Good luck!
Managing savegames with Flash shared objects
How many times did you find an option to save the game in Flash? How many times did you see a game that keeps track of your previously solved levels, like Nitrome's Snow Drift?
Today you'll learn how to do it... and it's very simple!
We can do it with just a couple of instructions thanks to the SharedObject class. This class is used to read and store limited amounts of data on a user's computer. The class does not create cookies, but something very similar, and the concept is the same.
It's very important to understand that local shared objects maintain local persistence. This means that you can play a game, beat some levels, save the game, turn off your computer, and next time you'll play that game on the same computer, you'll start from the first unbeaten level.
But... less words and more action(script)
-
lets_call_it_cookie = SharedObject.getLocal("feronato");
-
if (lets_call_it_cookie.data.counter == undefined) {
-
lets_call_it_cookie.data.counter = 1;
-
} else {
-
lets_call_it_cookie.data.counter++;
-
}
-
counter_text.text = "You visited this page "+lets_call_it_cookie.data.counter+" times!";
Line 1: A variable called lets_call_it_cookie gets the reference to a locally shared object called feronato. If the shared objects does not exists, a new one is created.
Line 2: Looking for a variable called counter inside the shared object
Line 3: If the variable does not exists (it's the first time we are running the movie), then set the counter variable inside the shared object to 1
Line 5: If the variable exists (it's not the first time we are running the movie), then increase the counter variable
Line 6: Display some text on a dynamic text I created
And this is the result: Read more
5 tips for a better dynamic text management in Flash
I am starting the new year with a post about commons mistakes when using a dynamic text in Flash, and how to manage it
1) Give your text an instance name
Giving your text an instance name will make your dynamic text to be changed more easily than using the Var field.
For instance, if you instanced your text as my_text, you can simply change its content with _root.my_text.text = "Hello World", and you text will be independent from any variable
If you use the Var field, your text depends on the variable you will assign.
It's not a big difference, but I prefer to change the text no matter any other variable has changed

2) Make it Multiline
Even if you don't plan to have a multiline text, it's better to have a Multiline text with a single line than a Single line text with multiple lines. To write on a new line, simply use the \n, for example _root.my_text.text = "Hello World\nLine 2".

3) Don't make it selectable
This is a very common mistake... in almost all cases you don't need selectable text. The problem is Flash sets a dynamic text to be selectable by default.
This is the result... I am showing you the issue on a game of a blog reader but it's full of these errors in Flash games... mine too...
The game is Wobble Dodge and the error is the one marked in red.

There is no need to make the score selectable... isn't it?

4) Think about antialiasing
Talking about antialiasing, there are two types of fonts: pixel fonts and non-pixel fonts. On pixel fonts you don't have to use antialiasing, while on non-pixel fonts you must use it.
Look at the example for a better understanding

So choose wisely when to make a text with or without antialiasing

5) Embed the fonts
Ok, you found a really good-looking font and want to use it in your next project... very well... too bad you are the only one to have that font. You must embed the font, or at least the characters you plan to use or in most cases your font will lose antialiasing (that means looking bad) or in some players will be replaced by a default font (that means looking even worse)

In most cases embedding Uppercase, Lowercase, Numbers and Punctuation should be enough

Ok, that's all. Let's make our texts look better
How many times did you mess up fonts?



