Placing ads before a game loads with jQuery
When you run a Flash game portal or a Flash game official site, you normally place ads everywhere hoping someone will notice it.
Obviously the most interesting place where to place ads is already taken by the game itself, so we are going to create a javascript preloader that will show an ad for 15 seconds before the game starts loading.
In order to do it, you need jQuery and swfobject
Now let’s suppose the game has to be embedded in a div called the_game, just like I did in my BarBalance official site.
Just create the div this way:
<div id = "the_game">
<h1>BarBalance game is loading</h1>
<SCRIPT language="Javascript">
var cpmstar_rnd=Math.round(Math.random()*999999);
var cpmstar_pid=10016;
document.writeln("<SCR"+"IPT language='Javascript' src='http://server.cpmstar.com/view.aspx?poolid="+cpmstar_pid+"&script=1&rnd="+cpmstar_rnd+"'></SCR"+"IPT>");
</SCRIPT>
</div>I used some SEO like an h1 tag and relevant content, and a CPMStar because it’s animated and we suppose won’t bore the player during the 15 seconds.
If you don’t have a CPMStar account, feel free to use my code :)
Then the jQuery part:
<script type="text/javascript">
$(document).ready(function(){
setTimeout(function(){
$("#the_game").fadeOut(2000,function(){
swfobject.embedSWF("barbalance.swf", "the_game", "640", "480", "9.0.0");
});
},15000);
});
</script>It’s just a 15000 milliseconds timeout fading out with a callback replacing the existing content with the Flash game.
Look at BarBalance official site to see it working.
I can’t wait to know this ad eCPM… did you already use something similar?
Way of an Idea Box2D prototype
Did you enjoy Way of an Idea?
Nice physics game… besides the joints and motors used in level design, the most interesting part is the chalk drawing.
We are going to do it in three steps
Step 1 – Freehand drawing
Let’s start with a simple script with some mouse listeners to let the player draw when he presses and moves the mouse:
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 | package { import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; public class draw extends Sprite { public var drawing:Boolean=false; public var canvas:Sprite = new Sprite(); public function draw():void { addChild(canvas); canvas.graphics.lineStyle(5) stage.addEventListener(MouseEvent.MOUSE_DOWN,mouse_pressed); stage.addEventListener(MouseEvent.MOUSE_MOVE,mouse_moved); stage.addEventListener(MouseEvent.MOUSE_UP,mouse_released); } public function mouse_pressed(e:MouseEvent):void { drawing=true; canvas.graphics.moveTo(mouseX,mouseY); } public function mouse_moved(e:MouseEvent):void { if (drawing) { canvas.graphics.lineTo(mouseX,mouseY); } } public function mouse_released(e:MouseEvent):void { drawing=false; } } } |
And this is the result: Read more
Triqui’s Picks #11
Six new games this last 2009 week:
Back2Back: Control a troop trapped in an hostile planet and try to escape. I am sure I played something similar when I had an Amiga. And enjoyed it a lot
What I liked: It could be a budget PC game.
Programming difficulty: The basics are very easy, but it’s a very complete and polished game. 5/5
PhysBallz: Connetc balls of the same color in this original physics game
What I liked: Nice concept
Programming difficulty: Physics game with custom gravity, some pathfinding to manage adjacent balls… 3/5 Read more
Ononmin Flash prototype – step 2
I added some features to the Ononmin Flash prototype I showed you some days ago.
Now the mushroom moves along the x axis in a field with a customizable number of bad circles and can fire a bullet. At the moment the bullet keeps on flying until it reaches stage’s edges, then it’s removed and the mushroom can shoot another bullet.
In order to keep classes and variables well organized, I changed some class names. These are the new classes/objects:
ball_mc: the rotating cannon
bullet_mc: the bullet fired by the cannon
field_mc: the battlefield
madball_mc: the spheres your bullet can’t touch
mushroom_mc: the moving mushroom
onon_mc: the game itself
The main class is obviously onon.as that simply creates a battlefield:
1 2 3 4 5 6 7 8 9 10 11 | package { import flash.display.Sprite; public class onon extends Sprite { // field_mc has a parameter determining the number of big circles // on the stage public var field:field_mc = new field_mc(15); public function onon():void { addChild(field); } } } |
field_mc.as manages the circles you cannot touch, the mushroom and the firing routine Read more
35+ game portals that can give your game at least 100K views
We all know when you released a game, submitting it to game portals is a very important task if you want your game to be popular.
So the question is: where should I submit my game?
You can find a lot of game portals lists around the web, but this one includes only portals able to give at least 100,000 views, according to MochiBot stats.
Having your game on half of the portals listed here should grant you some millions visits. Don’t even bother submitting your game to portals able to give you only a few thousands visits.
Just follow this list and let the game virally spread through minor portals.
More than 1,000,000 views
www.addictinggames.com
www.agame.com
www.mindjolt.com
www.oyunlar1.com
More than 100,000 views
www.7k7k.com
www.andkon.com
www.ejocurigratis.ro
www.fastgames.com
www.flasharcadegamessite.com
www.flashgames.it
www.freeonlinegames.com
www.freeworldgroup.com
www.funnygames.nl
www.gamegarage.co.uk
www.games2girls.com
www.gamesfreak.net
www2.jeux.com
www.jogosjogos.com
www.juegos10.com
www.juegosdiarios.com
www.killsometime.com
www.kongregate.com
www.micoia.net
www.minijuegos.com
www.net-games.biz
www.net-games.co.il
www.newgrounds.com
www.onemorelevel.com
www.oyunskor.com
www.physicsgames.net
www.playedonline.com
www.puffgames.com
www.spele.nl
www.thegamehomepage.com
www.wyspagier.pl
www.xiaoyouxi.cn
www.yougame.com
Happy submission… (did I forget some portals?)
Ononmin Flash prototype
I want you to play a bit Ononmin.
It’s a simple and addictive game that does not require any physics or 3D library to work.
So it’s the best candidate to be prototyped.
In this first part we’ll create the “mushroom” you control. In the original game, you can’t move the mushroom, allowing the player to just move the launchable ball.
To change the game a bit, in this version you can move the “mushroom” along the x axis with the mouse, and the launchable ball will move from left to right just like in Create a Flash game like Gold Miner.
So at the moment I created these two objects: Read more
Triqui’s Picks #10
Six new games this week:
Ice Breaker: Slice ice and free frozen vikings. The game isn’t that new but it has been enabled for distribution in these days.
What I liked: one of the few games using slicing feature
Programming difficulty: You can make something similar following The engine behind Splitter Flash game : working code. 3/5
Roly-Poly Monsters: Get rid of evil monsters blowing them up with bombs in this physics game
What I liked: Nice concept
Programming difficulty: Not that hard using Box2D. 3/5 Read more
Case study: Vadim Starygin’s total revenue from last two years
If Vadim Starygin does not sould familiar, then you’ll probably know this guy as Badim, the owner of Elite Games and the guy behind Elite Forces series.
Badim allowed me to publish his recap of two years as indie developer and I think you’ll find it very interesting.
Introduction
Two years I have worked as an Indie. Two years fighting for good on behalf of developers, sharing about my earnings and achievements every month. So far I can say this for sure – going off from offices to become an indie was the best decision I’ve made. Another one – sharing my stats with you, my dear colleagues.
Some History
I have released 21 Flash games, 3 iPhone games, launched 1 portal, 1 blog, a forum and a support group. Meanwhile, my personal life has also seen an increase in quality – no crunches, no 16-hour work days. I became a father for a second time. I was able to spend 31 days outside Russia, and two weeks inside Russia =). Read more
Interview with Nick Pearce, the guy behind Shrink it
Do you remember Shrink it? You should, because it’s a very popular game and because it inspired me to write Scaling objects with Box2D – part 1 and 2.
The blog interviewed Nick Pearce from NPGames to share with you some interesting information… Read more
Scaling objects with Box2D – part 2
In the first part I showed you how to scale a circle.
Now it’s time to scale a square… but before entering in the tutorial, I would like to do some cut/paste theory :)
In Euclidean geometry, uniform scaling or isotropic scaling is a linear transformation that enlarges or increases or diminishes objects; the scale factor is the same in all directions.
In Box2D, I said you can’t scale an object but you can replace the shape with a similar one
Two geometrical objects are called similar if they both have the same shape. More precisely, one is congruent to the result of a uniform scaling (enlarging or shrinking) of the other. Corresponding sides of similar polygons are in proportion, and corresponding angles of similar polygons have the same measure. One can be obtained from the other by uniformly “stretching” the same amount on all directions, possibly with additional rotation and reflection, i.e., both have the same shape, or one has the same shape as the mirror image of the other. For example, all circles are similar to each other, all squares are similar to each other, and all equilateral triangles are similar to each other. On the other hand, ellipses are not all similar to each other, nor are hyperbolas all similar to each other. If two angles of a triangle have measures equal to the measures of two angles of another triangle, then the triangles are similar.
Source: scaling and similarity on Wikipedia.
Now, even with my poor geometry skills, I know you can scale all the kind of shapes as long as you scale the triangles forming them… and you can scale every triangle with a bit of trigonometry.
But this is not the meaning of this tutorial… now I just want to have the same routine scaling both a circle and a rectangle.
The first thing to do when you select a body, is determining the kind of the shape attached to the body. This can be solved with GetType(): applied to a shape, it returns 0 if it’s a b2CircleShape (a circle) and 1 if it’s a b2PolygonShape, such as a rectangle in our example.
Another useful function is GetVertexCount()… it will return the number of vertex, and it’s very useful to determine if you are dealing with triangles, rectangles, or more complex polygons. Remember you should use regular polygons if you don’t want to drive yourself mad with geometry.
Last but not least, GetVertices() will return an array with all vertices… very useful to determine current width and height of our rectangle.
So the code used in the first part becomes: Read more
- Get up to $100,000 for your next Flash game with Mochi GAME Developer Fund
- Create a dynamic content animated footer ad for your site in just 9 jQuery lines – 17 lines version
- Sell sitelocked version of your Flash games and even .fla sources to Free Online Games
- Protect your work from ActionScript code theft with SWF Protector
- Create a dynamic content animated footer ad for your site in just 9 jQuery lines
- Understanding Box2D’s one-way platforms, aka CLOUDS
- Triqui MochiAds Arcade plugin for WordPress upgraded to 1.2
- Box2D Flash game creation tutorial – part 2
- 11 Flash isometric engines you can use in your games
- Monetize your Flash games with GamesChart
- Create a Lightbox effect only with CSS - no javascript needed
- Flash game creation tutorial - part 1
- Create a Flash Racing Game Tutorial
- Flash game creation tutorial - part 2
- Make a Flash game like Flash Element Tower Defense - Part 2
- Flash game creation tutorial - part 3
- Make a Flash game like Flash Element Tower Defense - Part 1
- Create a flash draw game like Line Rider or others - part 1
- Triqui MochiAds Arcade plugin for WordPress official page
- Create a flash artillery game - step 1
- Flash game creation tutorial – part 5.2 (4.88/5)
- Create a flash artillery game – step 1 (4.79/5)
- Create a Flash Racing Game Tutorial (4.76/5)
- Create a flash artillery game – step 2 (4.74/5)
- Create a survival horror game in Flash tutorial – part 1 (4.73/5)
- Creation of a Flash arcade site using WordPress – step 2 (4.73/5)
- Flash game creation tutorial – part 2 (4.71/5)
- Flash game creation tutorial – part 1 (4.70/5)
- Create a flash draw game like Line Rider or others – part 1 (4.69/5)
- Creation of a platform game with Flash – step 2 (4.68/5)








