Tutorial: How to create a game like Angry Birds in Flash with Box2d- Part 2 – Create the world

Part 2 – Create the world with Box2D

Instroduction

Here the second tutorial to learn how to create a physic based game like Angry Birds in Flash.

You can download the complete sources here: How_to_create_a_game_like_angry_birds_part2.zip

If you missed the first tutorial you can find it here: https://benoitfreslon.com/fr/tutorial-how-to-create-a-game-like-angry-birds-with-box2d-world-construction-kit-flash-part-1

In this tutorial I will show you how to create an object like an indestructible metal board.
We will use this object in a simple level with a simple structure.

Stage modification

From the Properties pannel, modify the width of the stage to 800px.

Capture d’écran 2013-04-01 à 20.27.19

Floor creation

Let’s start to create the floor MovieClip.

Insert > New Symbol > Name: Floor > Type: MovieClip > Export for ActionScript > Class: Floor > Base Class: shapes.Box > OK

Capture d’écran 2013-04-01 à 21.12.18

Now draw a simple green square.

Capture d’écran 2013-04-01 à 20.31.51

NB: The World Construction Kit engine always uses the center of the object as a gravity center.

Always center the shape with the Align pannel:

Capture d’écran 2013-04-01 à 20.32.03

Now click on the “Scene 1” to go back on the main stage then double click on the World MovieClip to get inside.

You must construct your level into the World MoieClip only.

From your library drag and drop an instance of Floor in the stage:

Capture d’écran 2013-04-01 à 20.33.33

Then scale the floor box to make a beautiful floor with the Free tool transform from the toolbar on the left.

Delete the old grey floor and use the new one. Place the floor in the bottom like this:

Capture d’écran 2013-04-01 à 20.34.35

To set all physic parameters you have 2 solutions. By using ActionScript code (later) or using the Flash component properties.

Let’s define a Flash component on the Floor object.

From the library  > Select the Floor MovieClip > Right click > Define component

Capture d’écran 2013-04-01 à 20.39.14

Class: wck.BodyShape > OK.

Capture d’écran 2013-04-01 à 20.41.06

Now you can see the component properties if you click on the Floor instance in the stage. Look at the component parameters in the properties pannel.

Use this settings:

Capture d’écran 2013-04-01 à 20.44.23

Create a dynamic board

We will create an iron board.

Insert > New Symbol > Name: IronPlate > Type: MovieClip > Export for ActionScript > Class: IronPlate > Base class: shapes.Box > OK

Capture d’écran 2013-04-01 à 20.45.08

Draw a grey board: width:200px and height: 10px. Then center the shape like this:

Capture d’écran 2013-04-01 à 20.45.41

We will set the same settings to all boards in the game with only one class.

We this method you can win a lot of time and you don’t have to set one by one. Otherwise it’s pain in the ass.

That’s why we have to create the IronPlate class.

File > New > AcitonScript 3.0 Class > Class name: IronPlate > OK

Capture d’écran 2013-04-01 à 20.46.39

Then > File > Save as > IronPlate.as (in the same folder as the .fla folder).

Capture d’écran 2013-04-01 à 20.47.05

Copy and paste this code in the IronPlate.as file to define a generic behavior for all metal boards.

Finally add several IronPlate instances into the World MovieClip on the stage.

Build a simple structure like this to test the game. I reuse the grey box to destroy my test structure.

Capture d’écran 2013-04-01 à 20.54.20

Test the animation > CTRL + Enter

If you have several mistakes or if the boards are static check if IronPlates MovieClip are in the Wolrd MovieClip.

Scene > World > IronPlates

See you !

The WTF Game Experience Released!

Hello,

Now you can play “The WTF Game Experience” on Kongregate

The WTF Game Experience is a classic physic based puzzle game with WTF features, famous internet meme references and funny twists.

During a boring party night 2 guys decide to create a giant puzzle game with bottles of beer a funnel, a baseball ball and various accessories.
Find a way to flow the beer into the funnel.

Level Editor: Build your levels and share them. Play thousand original levels made by the community.

Share it, like it, create your levels, and please rate the game.

Thanks ;).

The WTF Game Experience: private beta test

Hello everyone!

I’m working on a new Flash based game with physic engine and original gameplay.
The game is still under development but you are welcome to playtest the beta version.

To play the game click here and type the password: beta

Post your comments and report bugs with the google form at the bottom of the page.
I hope you will enjoy this “new approach”!

Have fun ! ;).

Rolling Jump version 1.1 with new features was free yesterday.

Rolling jump version 1.1 was released last week.
Yesterday my game was available for free.

There are about 2000 reviews with ★★★★★. :)

It was 1st on the top 25 on several appstore in Europe. (France, Spain, Belgium, …)

Download Rolling Jump on the appstore.

Download Rolling Jump free on the appstore.

Description

Help Lighty save the light of the world by escaping from the dark evil creatures in this incredibly FUN and ADDICTING game! Simply jump from each wheel up into the sky and stars to protect the light of the world.

In Rolling Jump, your goal is to help the hero, Lighty, jump up into the sky and away from the dark evil creatures as fast as possible. Learn secrets of the game like double tapping, jumping onto walls, and discover how to attain the rainbow path to help Lighty save the light of the world, and ultimately prove his worth.

★ 7 levels to discover the stars
★ Increasing difficulty and real challenge for the hardcore gamers
★ Get a Boost bonus after eating suns and reach the space faster!
★ Avoid the air-ballons that won’t let you jump on a new wheel
★ “Slime” wheels that bump Lighty
★ Multiply your score x10 with perfect jumps
★ Use wall to bounce and reach upper wheels
★ Compete in a worldwide ranking via Game Center
★ Compare your score with your friends and challenge them !
★ Cute Retina graphics

Get free tips and be the first to hear updates about Rolling Jump on Facebook :
http://www.facebook.com/rollingjump

Follow us on Twitter: @Chugulu_US

Thanks for playing and enjoy!

ActionScript: Protect your Flash games on the web, sitelock all your games.

If you want to submit your games on one game portals DO NOT UPLOAD YOUR GAMES WITHOUT A SITELOCK SCRIPT.

WHY ?

Your games can be “stolen” by game portals. Or if you didn’t finish your game it’s a really a “pain in the ass” to update your games spread on all the web.

I tried lot of code for sitelocking my games but some of them are in ActionScript 2.0 or totally out of date. Some of them can’t work with the “https” or without the “www” characters.
Another example when you to want to test your game on your local computer you have to comment the script. And you can forget to uncomment the sitelock script when you submit your game on the web.

So I decided to create my own script.

This is a short version of my script.
But this one is perfect for all uses.

Installation

Copy and Paste this code and add your domains into the array “[ ]” separated by commas :

[“kongregate.com”, …, …]

You can lock the local mode by adding a second parameter : false
The default value is set to true.

Rolling Jump – iOS highly addicting game

Hello, I’m proud to present you my last game on iOS: Rolling Jump. The Flash version was designed and developed in may 2009.

The new version is co-published by Chugulu.

You can download the free version here. The free version is limited by the score : 10 000 pts max. Or buy the full version here for $1.49.

Enjoy! And thanks to the Chugulu Team.

Description

Help Lighty save the light of the world by escaping from the dark evil creatures in this incredibly FUN and ADDICTING game! Simply jump from each wheel up into the sky and stars to protect the light of the world.

In Rolling Jump, your goal is to help the hero, Lighty, jump up into the sky and away from the dark evil creatures as fast as possible. Learn secrets of the game like double tapping, jumping onto walls, and discover how to attain the rainbow path to help Lighty save the light of the world, and ultimately prove his worth.

★ 7 levels to discover the stars
★ Increasing difficulty and real challenge for the hardcore gamers
★ Multiply your score x5 with perfect jumps
★ Use wall to bounce and reach upper wheels
★ Compete in a worldwide ranking via Game Center
★ Compare your score with your friends and challenge them !
★ Cute Retina graphics

Get free tips and be the first to hear updates about Rolling Jump on Facebook :
http://www.facebook.com/rollingjump

Nano War 2 finally playable

Finally the sequel of Nano War 1 released in november 2007.

I hope that new game will be a great success llike the first episode.

Every humans own billons of nanoscopic cells.
Some of these cells are doomed to protect our organism and fight foreign organisms.
Even confined to smaller and unlikely places the war is present.

Welcome on Nano War 2.

Play Nano War 2 on Kongregate.

What’s news ?

  • Solo mode
  • 25 levels: play against 1, 2 or 3 computers.
  • Upgrade your cells
  • 3 difficulty levels
  • Multiplayer: play against 1, 2 or 3 players.
  • Skirmish mode
  • 21 Achivements
  • The White blood cell: Increase your cells and capture opponent’s cells.
  • The Fat cell: Protect your cells or infect opponent’s cells
  • The Antibody cell: The most powerfull cell, increase your production or capture opponent’s cells and units instantly.

Have fun!

Roll n Jump : android, on the market

You are welcome to download my game Roll n Jump for free from the Android Market:
https://market.android.com/details?id=air.com.benoitfreslon.rollnjump

Game Description

Roll n Jump is a skill game where the goal is to climb as high as possible.
Roll and Jump is a skill game where the goal is to climb as high as possible by jumping from a rolling circle to another.
Tap to jump from a wall or a circle or do a double jump in the air.
Clim and do the highest score as possible.

Screenshots

ActionScript: Move an object with keyboard with absolute controls

In this tip I will show you how to move an object with keyboard with absolute controls.

See also how to move an object with keyboard relative-camera control.

What is the absolute controls?

The direction of your object will be calculated depending the object orientation. (Biohazard, Micro Machines, Gears of War). This code is very usefull if you design a car game.

How to make an absolute control in Flash?

  • Get the arrow key status (key is up/key is down);
  • Move or rotate the object on enter frame with the new velocity (Left and Right keys: rotate, Up key: forward, Down key: backward);

Download source: www.benoitfreslon.com_Move_an_object_with_keyboard_with_absolute_controls

Vote for Nano War and Take Something Literally

Hello,
If you like Nano War or Take Something Literally you will be very helpfull if you can vote for my games on the Inde Pub Game contest.
Register here http://www.indiepubgames.com/register.php
And vote here http://www.indiepubgames.com/vote.php

Only 5 minutes needed :). Thank you very much.

Edit: The contest is over. Actually my game was submited one day before the end. Thank your IndiePub.