Hello,
Here a quick designed game created just for fun in few hours.
Play here: La Danse de l’épaule
Make the character dance with the arrow keys. Gameplay based on Dance Dance Revolution. With a crazy french song.
Have fun!
Hello,
Here a quick designed game created just for fun in few hours.
Play here: La Danse de l’épaule
Make the character dance with the arrow keys. Gameplay based on Dance Dance Revolution. With a crazy french song.
Have fun!
I’m proud to annonce the release of the multiplayer mode of Nano War iOS (update 1.05).
The Multiplayer mode is FREE!
The multiplayer mode uses Game Center and the matchmaking service. The online game works very well. The gameplay is very smooth. I didn’t see any lags.
You can invite your friends and play against them up to 4 players.
IT’S REALLY FUN! :)
10 seconds after tapping the matchmaking button a player joined the game.
I played against 4 different players and each battle was different.
Here my first victory against a human player. :)
There are 2 different maps for 2, 3 and 4 players. But I will to add more maps and more features.
Please rate and write a short review again! Thanks
Enjoy ! ;)
Here the 4th 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_part4.zip
If you missed the first tutorial you can find it here: http://www.benoitfreslon.com/tutorial-how-to-create-a-game-like-angry-birds-with-box2d-world-construction-kit-flash-part-1
In this tutorial we will create the the ennemies: the Pigs. We will detect the collision to destroy it.
Create the Pig MovieClip:
Draw a beautiful green pig like this with this dimensions: 30×30
Or get my sprite:
Create the Pig class.
Copy and paste this code:
package {
import flash.events.Event;
import flash.utils.*;
import flash.geom.*;
import Box2DAS.*;
import Box2DAS.Collision.*;
import Box2DAS.Collision.Shapes.*;
import Box2DAS.Common.*;
import Box2DAS.Dynamics.*;
import Box2DAS.Dynamics.Contacts.*;
import Box2DAS.Dynamics.Joints.*;
import cmodule.Box2D.*;
import wck.*;
import shapes.*;
import misc.*;
import extras.*;
public class Pig extends Circle {
/** Constructor method, called when the bird instance is created */
public function Pig() {
// constructor code
super();
}
/** Called when the pig is added to stage by box2d */
override public function create():void {
trace("pig created");
// Physic properties
density = 10;
friction = 1;
type = "Dynamic";
reportBeginContact = true;
reportEndContact = true;
reportPostSolve = true;
reportPreSolve = true;
allowDragging = false;
super.create();
// Start the collision detection in 1000ms.
// Sometimes the collision is detected at start so I delayed the collection detection
setTimeout(initCollision, 1000);
}
private function initCollision():void {
// Init the collision handler
listenWhileVisible(this, ContactEvent.POST_SOLVE, postSolveContactHandler, false, 0, true);
}
/** Set the physic shapes and the size */
override public function shapes():void {
// 15 px of raduis
circle(15);
}
/** Method called when this physic object collides */
private function postSolveContactHandler(e:ContactEvent):void
{
// Get the impulse the contact
var impulse:b2ContactImpulse = e.impulses
// Get the normal lenght of the contact
var normalLength:Number = Math.sqrt((impulse.normalImpulse1 * impulse.normalImpulse1) + (impulse.normalImpulse2 * impulse.normalImpulse2));
trace("normalLength", normalLength);
// Check if the contact is strong
if (normalLength > 1) {
// Remove the pig
remove();
return;
}
}
}
}
Finally add pigs in the World MovieClip like this:
And test your level.
The tutorial is over. If you want more features and more tutorials about the Angry birds engine please post a comment :).
Have fun !
Hello,
I’m actually designing and developing games alone. I can’t do everything myself.
That’s why I need your help to improve my last games.
Don’t forget ! My games are also YOUR GAMES. :)
One of my game: Take Something Literally has been translated in 20 different languages. (de, nl, fr, it, es, pl, ru, he, hu, slo,uk, cn,…). And played all around the world 15 millions times !
I would like to tanks all translators and all players !
Today I need help to translate Nano War iOS.
This game has been released in march and players like the game.
(You can download the game for free on iPad and iPhone: Download)
And Think Outisde The Box. The Take Something Literally sequel on iPhone.
(Still in development)
See the IndieGameDB page of Think Outside The Box.
It doesn’t take long. All is ready to add the new translation.
Thanks you very much !
Benoît
Here the third tutorial to learn how to create a physic based game like Angry Birds in Flash.
You can download the complete sources here: http://www.benoitfreslon.com/wp-content/uploads/2013/04/How_to_create_a_game_like_angry_birds_part3.zip
If you missed the first tutorial you can find it here: http://www.benoitfreslon.com/tutorial-how-to-create-a-game-like-angry-birds-with-box2d-world-construction-kit-flash-part-1
In this tutorial we will create the Bird character. We will add some very simple interactions like: shooting, repositioning.
I modified the world settings in order to have a smooth moving.
Click on the World MovieClip in the stage and set this properties:
Create a new symbol:
You also can download my sprite:
Great now add an instance of Bird in the World:
Now create the Bird class file:
Finally replace the code in the class by this one:
package {
import flash.events.Event;
import flash.utils.*;
import flash.geom.*;
import Box2DAS.*;
import Box2DAS.Collision.*;
import Box2DAS.Collision.Shapes.*;
import Box2DAS.Common.*;
import Box2DAS.Dynamics.*;
import Box2DAS.Dynamics.Contacts.*;
import Box2DAS.Dynamics.Joints.*;
import cmodule.Box2D.*;
import wck.*;
import shapes.*;
import misc.*;
import extras.*;
public class Bird extends Circle {
/** State of the bird. preparing, shooting */
public var state:String;
/** Check if the player press the button to shoot */
private var willShoot:Boolean = false;
/** Check if the player press the button to reset the bird position */
private var willReset:Boolean = false;
/** Power of the shoot */
private var power:Number = 0;
/** Get the angle in radians between the mouse cursor and the bird */
private var angleRadian:Number = 0;
/** Init x position of the bird */
private var initX:Number = 0;
/** Init t position of the bird */
private var initY:Number = 0;
/** Constructor method, called when the bird instance is created */
public function Bird() {
// constructor code
}
/** Called when the bird is added to stage by box2d */
override public function create():void {
// Init position
initX = x;
initY = y;
trace("create");
// Physic properties
density = 10;
friction = 1;
reportBeginContact = true;
reportEndContact = true;
reportPostSolve = true;
reportPreSolve = true;
allowDragging = false;
super.create();
// Reset the bird at the begining
reset();
// Add a loop, called 30 times per second
listenWhileVisible(world,StepEvent.STEP, step,false, 0);
trace("create end");
}
/** Set the physic shapes and the size */
override public function shapes():void {
// 15 px of raduis
circle(15);
}
/** Reset the bird */
private function reset():void {
trace("reset");
// In order to move the body physic shapes we have to set the type to Animated
type = "Animated";
// Set the init position
x = initX;
y = initY;
rotation = 0;
// State when the bird is ready to be shooted
state = "preparing";
// Reset booleans
willReset = false;
willShoot = false;
}
/** Loop method */
public function step(e:Event):void {
// If the bird is ready to be shooted and the player press the mouse button
if (state == "preparing" && Input.mouseIsDown) {
// Mouse down
trace("mouse is down");
prepareShoot();
} else if (state == "preparing" && !Input.mouseIsDown && willShoot) {
// If the player release the button when the bird is ready to be shooted
shoot();
} else if (Input.mouseIsDown && state == "shooting") {
// If the bird is shooted and the player press the mouse button
willReset = true;
} else if (!Input.mouseIsDown && willReset) {
// If the bird is shooted and the player release the mouse button
reset();
}
}
/** Prepare to shoort method */
private function shoot():void {
trace("shoot power:", power);
// The bird will be moved by the physic engine with type: Dynamic
type = "Dynamic";
// Get the impulse force
var powerX:Number = - power * Math.cos(angleRadian);
var powerY:Number = - power * Math.sin(angleRadian);
// Aplly the impulse force
b2body.ApplyImpulse(new V2(powerX, powerY), b2body.GetWorldCenter());
// Switch state to shooting
state = "shooting";
}
/** Prepare to shoot method */
private function prepareShoot():void {
// Get the mouse position in the world MovieClip
var mouse:Point = Input.mousePositionIn(world);
// Get the distance between the mouse and the bird
var distanceMouse:Number = Point.distance(mouse,new Point(x,y));
// Limit the distance to 150px in order to limit the impulse force
if (distanceMouse > 150) {
distanceMouse = 150;
}
// Set the boolean willShoot to true
willShoot = true;
// Convert distanceMouse to impulse force
power = distanceMouse / 13;
// Get the radians angle between the mouse and the bird
angleRadian = Math.atan2(mouse.y - y,mouse.x - x);
// Orient the sprite to the shoot direction
rotation = angleRadian * 180 / Math.PI + 180;
}
}
}
See the previous tutorial about how to install the TweenMax libraries in Flash IDE.
We will try to test some tweens and easing only with TweenMax to make this animation:
Click on Insert > New symbol
Enter in the Apple symbol from your library:
Then draw an beautiful apple :).
Let’s the origin in the center of this image
Click on the “Stage” from the navigator on the top.
Now you are in an empty main stage.
Hit the right click from the frame on the timeline and select : Actions to open the Actions pannel.
Then just add this line in the Actions pannel.
import com.greensock.TweenMax;
If the library is correctly added in your Flash animation. Flash will autocomplete the package like this:
The TweenMax.to method can interpolate a tween with any properties.
For example this line can move an object to x and y coordinates.
TweenMax.to(theObject, theTimeInSeconds, {x:100, y:100});
Now add this lines of code:
// Import the TweenMax classes
import com.greensock.TweenMax;
import com.greensock.easing.*;
// Mouse event
stage.addEventListener(MouseEvent.MOUSE_UP, mouseUp);
function mouseUp (e:MouseEvent):void {
// Create an apple on the stage
var apple:Apple = new Apple();
// Set the position to the mouse coordinates
apple.x = stage.mouseX;
apple.y = stage.mouseY;
// Add a tween with TweenMax
// The apple will move to the bottom with a bounce tween.
// When to tween is complete the apple will be removed
TweenMax.to(apple, 2, {y:apple.y + 150, ease:Bounce.easeOut, onComplete:removeApple, onCompleteParams:[apple]})
// Add the apple to the stage
addChild(apple);
}
function removeApple(apple:Apple):void {
trace("Remove apple");
removeChild(apple);
}
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: http://www.benoitfreslon.com/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.
From the Properties pannel, modify the width of the stage to 800px.
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
Now draw a simple green square.
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:
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:
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:
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
Class: wck.BodyShape > OK.
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:
We will create an iron board.
Insert > New Symbol > Name: IronPlate > Type: MovieClip > Export for ActionScript > Class: IronPlate > Base class: shapes.Box > OK
Draw a grey board: width:200px and height: 10px. Then center the shape like this:
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
Then > File > Save as > IronPlate.as (in the same folder as the .fla folder).
Copy and paste this code in the IronPlate.as file to define a generic behavior for all metal boards.
package {
import shapes.Box
public class IronPlate extends Box {
public function IronPlate() {
// constructor code
}
override public function create():void {
super.create();
//trace("iron plate created");
this.type = "Dynamic";
this.friction = 0.2;
this.density = 1;
this.restitution = 0;
this.isGround = true;
this.allowDragging = false;
this.reportBeginContact = true;
this.reportEndContact = true;
this.reportPostSolve = true;
this.reportPreSolve = true;
}
}
}
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.
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 !
I decided to write a tutorial every friday. :)
Today I will show you how to make a game like Angry Birds with a physics engine with Flash.
The famous Physics engine is named Box2D. 95% of 2D games with physic use this engine. (Angry Birds, Limbo, Bad piggies, etc.).
The original engine is written in C++ language. Look at the Box2D C++ website. But this engine was ported in ActionScript 3.0 his codename is box2DFlash.
Box2DFlash is a powerful engine but it’s very difficult to use if you are not a good programmer or if you don’t have a level editor to create your levels with a WYSIWYG layout.
That’s why I suggest to use the World Construction Kit framework.
See the Wolrd Construction Kit Framework website: http://www.sideroller.com/wck/
Summary: World Construction Kit is is a toolset / framework for rapidly developing physics based games / websites within the Flash IDE. WCK allows you to layout your 2d worlds / game levels entirely within Flash and have them hook into the physics simulation without writing any code
In the next tutorial I will show you how to construct a basic level with box2D Flash and WCK.
I will show you how to hide the mouse cursor and how to replace it by another image.
It’s really simple but you need one at least one MovieClip.
You also can download the source file: Hide_mouse_cursor_and_custom_cursor.fla.
// http://www.benoitfreslon.com // Hide the mouse cursor Mouse.hide(); // Use the custom cursor // cursor is the instance name in the stage // Tip: Add the cursor always on top. stage.addChild(cursor); // Drag the cursor to the mouse coordinates cursor.startDrag(true); // Show the mouse cursor //Mouse.show();
That’s all :).
In Nano War, you must save a human body from viruses that have infected its cells. To do so you have to send your cells into battle to beat enemy cells, whilst setting up and maintaining your own defense.
Now with a deeper gameplay, more colorful design and highly intuitive tactile ergonomics, Nano War remains very simple to learn yet requires a real development of skill and strategy for later levels in the game.
The game offers four trails – the 4 main zones of the human body split over 40 levels. The first 10 levels are free to play, the rest unlocked by in-app purchase. At the end of each level the playter must beat a Boss …no mean feat.
The Battle mode allows you to play and unlock personalisable battles in-app and an online multiplayer mode is in development and will be released for free in the coming months.
Since 2008 billions upon billions of cells have been saved, making Nano War a Top 10 ranking game on Kongregate as well as Game of the Week on IndieGames.com. The game collected 3 Awards (SACD Award 2008, Florilège du Web Flash Festival 2008, Winner of WhoseGame) was soundly praised by Mac4ever.com who stated:
★ “…one of most addictive little flash games you’ll ever find.” ★
Is available on iPhone and iPad: http://bit.ly/NanoWar
Trailer videos: http://youtu.be/n-z5TRyKsg0
To keep up to date on this project and on other topics, have a look at facebook.