# 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

Line 1: Hiding the mouse

Line 2: Defining the interval, in frames, between the creation of a ball and the next one

Line 3: Counting frames passed from the creation of the last ball

Line 4: Defining a variable to check if it’s game over or not

Line 5: Creating the array that will store all balls in game

Line 6: Function to be executed at every frame

Line 7: If it’s not game over…

Line 8: The core variable of the game. The game is playable because every new ball is placed at a distance from existing balls that allows the player to run and chatch it. So I am going to create a variable that will state if I can place a new ball in the random position I will create or not.

Line 9: Incrementing the number of frames passed since the creation of the last ball

Line 10: Checking if it’s time to create a new ball

Line 11: Resetting the frame counter

Lines 12-13: Generating a random x and y position

Lines 15-17: Calculating the distance from the x-th ball and the ball that’s about to be created

Line 18: If the distance between the balls is less than 50 (a number decided by me, changing it will affect gameplay)…

Line 19: … then the new ball cannot be placed… a new one will be created in the next frame, in another position

Line 22: If the ball can be placed…

Line 23: Pushing the new ball in the balls array

Line 24: Creating the ball

Line 25: Stopping the ball timeline to a frame that ranges from 1 to 3. Every frame contains a color

Line 26: Functions that the ball will execute at every frame

Line 27: If it’s not game over…

Line 28: Increase ball width by 0.25

Line 29: Set the height to the same value of the width

BUG?: In Flash Professional 8.0 if you change `this._height = this._width;` with `this._height += 0.25;`, you will notice a strange behavior

Lines 30-32: Calculating the distance from the ball and the and the one controlled by the player

Line 33: If the distance is less than the sum of both balls radius…

Line 34: Stop the timeline of the ball controlled by the player to the same frame of the ball just touched. In this way, the ball controlled by the player will have the same color as the ball just touched

Line 35: Setting a variable called `remove` to the ball’s depth. Why am I doing this instead of simply removing the ball? I have to remove the ball and splice the array with all the balls in game, or the array will continue growing and making the game slower. In this way, I am marking the ball and I will remove its movieclip and its reference in the array next time I will scan the array

Line 37: Scanning the array of balls

Lines 39-41: As explained at line 35, if the ball’s depth is the one to be removed, then remove the ball movieclip and splice the array with all balls in game.

Lines 42-49: Checking collisions between a ball and the remaining ones in the same way as explained at Managing multiple collision detection with Flash. If there is a collision, then set the `game_over` flag to `true`

Line 57: Attaching the movieclip of the ball controlled by the player

Line 58: Stopping the ball’s timeline to the 1st frame (1st color)

Lines 59-64: If it’s not game over, make the ball follow the mouse

And that’s all. The game does not include score, but it’s a quite good replica of Biggification

When it’s game over, you can’t move anything and you must reload the page.

Now I am going to change some gameplay parameters, add a couple of powerups and another one-day game will be ready to hit the masses. Download the source code and do the same

• Ed

I’d make lots of games in one day but I can’t think of any good ideas like this. :(

• David

amazing!

i wish i could do stuff like that. could you do a tutorial on functions (if you already have, then i apologise), because i still get confused by them

• Frederik J

Good tutorial!

Ed:
Yeah, when you make games its about creativity, :( Some people is not born with it, inclusive me. But just keep trying!

• Hi, Emanuele, I think your
Flash Game Creation Tutorial Part 5.3
is not working. Could you check it, please?

Thanks

• I’m flattered that someone would take the time to dissect my game like this.

I’ve been thinking about rewriting it in AS3, and then maybe add some new gameplay concepts.

• Marukomu

Now this is pretty cool! I was reading this site at work because I love the tutorials. It gives me something to work on. I began showing some of my cubicle mates and low and behold the game of the day was done by one of me mates. Now that was unexpected coolness!

PS. He was shocked to see his game being recreated.

• junior

just thought id brag about just getting the high score on that game. Thanks for the link emanuele

• junior

ok, now ive been destroyed. :(

• I dont know why, but its not working.

• Great tutorial, as always. I’ve tested your code, and is working really fine.

Congrats

• Nice tutorial. Are you going to do a game like this?

And… I’m doing a game based on your Security tutorial. I’m creating some new things. And I did something wrong and i don’t know what.

This is some of the “hero” AS.

[CODE]

if (_root.wall.computer1.hitTest(_x, _y, true)){
if (Key.isDown(Key.SPACE)) {
_root.cam2.gotoAndStop(145);
}
}

[/CODE]

Whit this, the player should press play near the computer1, and the cam2 should go to frame 145, so he can go further…

But it doesn’t work… Whats wrong?

• I didn’t really look into it but if you let one or two sphere grow while “killing” the others, eventually, no new ones will begin to appear on the screen.

I’m guessing they are always for the preceeding one to get popped before being placed on the game board.

• Good code by the way.

I don’t know if I’m the only one but sometimes the site kills my browser and I get an alarm that I got a virus.

• fine i got it working!

• Ed

Monkios I got a trogan aswell :(

• Well, Emanule I’ve seen something in Newgrounds by you:
http://www.newgrounds.com/portal/view/419882

Glomb!

Highscores work very very well.

• WOW i played the actual game bigification its simple but strangly addictive i couldnt stop playing

P.S: please can you post a tutorial about ho to make a game like stick rpg