Mouse avoider/Biggification remix prototype

Just a quick uncommented prototype involving growing (and moving) spheres and a sphere you control with the mouse.

Click the mouse to change color, if you touch a sphere of the same colour as yours, you’ll make it disappear.

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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Mouse.hide();
speed = 30;
passed = 0;
placed = 0;
growth = 0.1;
velocity = 5;
player = _root.attachMovie("ball", "ball", _root.getNextHighestDepth());
player.gotoAndStop(1);
player.onEnterFrame = function() {
	this._x = _root._xmouse;
	this._y = _root._ymouse;
};
_root.onMouseDown = function() {
	if (player._currentframe == player._totalframes) {
		player.gotoAndStop(1);
	} else {
		player.gotoAndStop(player._currentframe+1);
	}
};
_root.onEnterFrame = function() {
	passed++;
	if (passed>speed) {
		passed = 0;
		collect = _root.attachMovie("ball", "ball_"+placed, _root.getNextHighestDepth(), {_x:Math.random()*500, _y:Math.random()*500});
		collect.gotoAndStop(Math.floor(Math.random()*collect._totalframes)+1);
		collect.angle = Math.random()*6.28318531;
		collect.xspeed = velocity*Math.cos(collect.angle);
		collect.yspeed = velocity*Math.sin(collect.angle);
		collect.onEnterFrame = function() {
			this._width += growth;
			this._height += growth;
			this._x += this.xspeed;
			this._y += this.yspeed;
			x_dist = this._x-player._x;
			y_dist = this._y-player._y;
			if (this._x<0) {
				this._x = 0;
				this.xspeed *= -1;
			}
			if (this._x>500) {
				this._x = 500;
				this.xspeed *= -1
			}
			if (this._y<0) {
				this._y=0
				this.yspeed *=-1
			}
			if (this._y>500) {
				this._y=500
				this.yspeed *=-1
			}
			distance = x_dist*x_dist+y_dist*y_dist;
			touch_distance = ((player._width+this._width)/2)*((player._width+this._width)/2);
			if (distance<touch_distance) {
				if (this._currentframe == player._currentframe) {
					this.removeMovieClip();
				}
			}
		};
	}
};

Tell me if you have some good ideas to turn it into a game and I’ll improve it as you want

Download the source code.

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (6 votes, average: 5.00 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 6 comments

  1. Scarybug

    on September 2, 2008 at 11:56 pm

    Suggestions: Touching a sphere of a different color shrinks your ball by an amount that is a function of the size of the sphere. Touching a sphere of the same color grows your sphere by the same function. Your score goes up continuously based on how big your sphere is. If your sphere shrinks too much it is destroyed (game over)

  2. Scarybug

    on September 2, 2008 at 11:59 pm

    Also: Spheres should fade in, so they don’t appear on your sphere and affect you without giving you a chance to move. Your ball should look slightly different from the other balls. The game should start with only 2 colors and gradually add new colors as time passes.

  3. Superdean

    on September 3, 2008 at 12:42 am

    Scarybug…all of those ideas are great!

  4. Rory

    on September 5, 2008 at 6:59 am

    Yeah, awesome ideas!

    Also you get some pretty crazy stuff if you just leave it. A screensaver maybe?

  5. daniel

    on September 7, 2008 at 9:38 pm

    Same as the game of collecting coins the player can get an score rating that tell quantity of spheres colour and time playing. Or if at an specified time can collect the maximum quantity of spheres.Ideal winner is who can get an empty scenary.

  6. Rose

    on March 19, 2010 at 11:59 am

    Wow. This post is nearly 2 years old, and I just came up with a game idea like this one a couple weeks ago. Sooooo late! I had a heck of a time re-learning Flash, so I couldn’t get my game to work properly… and then I stumbled onto your site for about the 20th time and saw this. Even the rough version looks nice. Good job.