BallPusher: new Flash game prototype
Filed Under Flash, Game design, Users contributions • 14 Comments
Here it is another fresh Flash game prototype by FrozenHaddock, that jumps from the forum to the blog. FrozenHaddock was playing around with Flash as he says, when he come out with an interesting prototype.
Something I was fiddling about with, might work well as a puzzle game of some
sort. Some people might find it interesting :)
I found it very interesting... and probably I'll turn it into a complete one-day game.
In this prototype actionscript is not in a single frame but every object has its own code.
This is the code for the pusher (that's not a drug dealer in this case)
-
onClipEvent (load) {
-
rad = 100;
-
r = 15;
-
}
-
onClipEvent (enterFrame) {
-
xdis = (this._x-_root._xmouse);
-
ydis = (this._y-_root._ymouse);
-
distance = Math.sqrt((xdis*xdis)+(ydis*ydis));
-
this._x = _root._xmouse += xdis/distance*rad;
-
this._y = _root._ymouse += ydis/distance*rad;
-
angle = Math.atan2(ydis, xdis);
-
this._rotation = angle*57.2957795;
-
for (i=0; i<5; i++) {
-
bi = _root["b"+i];
-
bi.r = (_root["b"+i]._width)/2;
-
xbidis = _root["b"+i]._x-this._x;
-
ybidis = _root["b"+i]._y-this._y;
-
bidis = Math.sqrt((xbidis*xbidis)+(ybidis*ybidis));
-
if (bidis<(this.r+bi.r)) {
-
force = bidis-(r+bi.r);
-
_root["b"+i]._x -= xbidis/bidis*force;
-
_root["b"+i]._y -= ybidis/bidis*force;
-
}
-
}
-
}
While every ball has this code
-
onClipEvent (load) {
-
r = this._width/2;
-
this._x = random(400)+50;
-
this._y = random(300)+50;
-
}
-
onClipEvent (enterFrame) {
-
for (i=0; i<5; i++) {
-
bi = _root["b"+i];
-
bi.r = (_root["b"+i]._width)/2;
-
xbidis = _root["b"+i]._x-this._x;
-
ybidis = _root["b"+i]._y-this._y;
-
bidis = Math.sqrt((xbidis*xbidis)+(ybidis*ybidis));
-
if (bidis<(this.r+bi.r) && bidist != 0 && this.r>=bi.r && !_root["b"+i].hitTest(_root.pusher.inner)) {
-
force = bidis-(r+bi.r);
-
_root["b"+i]._x -= xbidis/bidis*force;
-
_root["b"+i]._y -= ybidis/bidis*force;
-
}
-
}
-
}
And this is the result:
Download the source code and make it a playable game!
Special thanks to FrozenHaddock for sharing this code. He also runs a site, check it out.
They can be easily customized to meet the unique requirements of your project.
14 Responses to “BallPusher: new Flash game prototype”
Leave a Reply
Trackbacks
-
Ballpusher concept | FrozenHaddock on
April 13th, 2008 1:11 pm
[...] yes, and it was featured on Emanuele Feronato, so I must be doing something [...]
Posts
- Rick Triqui: my first PlayCrafter game
- Prototype of a Flash game like Meeblings
- Games for the game developers!
- The art of debugging
- How to embed a text file in Flash
- Create a Flash game in minutes with PlayCrafter
- Upgrade your Flash CS4 to 10.0.2
- Play Mazeroll, my latest Box2D game
- Triqui MochiAds Arcade plugin for WordPress Released!!
- The MochiAds funnel
- Flash game creation tutorial - part 1
- Create a Lightbox effect only with CSS - no javascript needed
- Flash game creation tutorial - part 2
- Make a Flash game like Flash Element Tower Defense - Part 2
- Flash game creation tutorial - part 3
- Create a flash draw game like Line Rider or others - part 1
- Create a Flash Racing Game Tutorial
- Make a Flash game like Flash Element Tower Defense - Part 1
- Create a flash artillery game - step 1
- Create a flash draw game like Line Rider or others - part 5
- Flash game creation tutorial – part 5.2




(4.9 out of 5) - Flash game creation tutorial – part 3




(4.86 out of 5) - Creation of a platform game with Flash – step 2




(4.84 out of 5) - Create a survival horror game in Flash tutorial – part 1




(4.82 out of 5) - Create a flash artillery game – step 1




(4.82 out of 5) - Create a Flash Racing Game Tutorial




(4.8 out of 5) - Create a flash artillery game – step 2




(4.75 out of 5) - New tile based platform engine – part 6 – ladders




(4.74 out of 5) - Flash game creation tutorial – part 2




(4.73 out of 5) - The experiment – one year later




(4.7 out of 5)


does anyone have any ideas of what kind of game to make with this prototype?
the best i can think of is like to get the balls in a certain area in a limited amount of time…i’m not even going to bother making that cuz i know it will be boring
you need to push the balls speed and get them to certain area, something curlinglike… all i can think of
The direct link to the forum post is…
http://www.triquitips.com/viewtopic.php?f=23&t=150
… for impatient people :D
Modifying this to use x and y speeds so the balls slide and bounce would make for an interesting avoidance game.
Perhaps you have 3 balls in the centre, and other enemy balls come in from the side and try to knock your balls out of a ring. You use the rod/ballpushery thing to defend against the enemies and to reposition your defendable balls.
Just a thought.
Seems kinda……boring.
lol nice little engine though.
balls are flying around and you have to keep one safe?
2 ideas that require minor changes…
1) You can swing the “pusher” around really fast with your mouse and wack balls into targets.
2) #1 turned into a slingshot. You hold the mouse down and the ball sticks to the end. When you let go it flies off.
And Mar’s Idea seem cool , especially the scond part. I believe that in that case the speed of the pusher in the frame you release the mouse button should be directly proportional to the power and speed of the launched object. That can make something good.
This could also be the bases of a shepherds game.
Nice suggestions, guys :D
I loved this prototype, it’s just fascinating!
Yeah!
I like it…Does anybody like this prototype?
http://eagleproductions.wordpress.com/2008/03/05/brand-new-flash-prototypemake-a-ball-bounce-on-things/
You can, stump on things.Just remember to make the green box alpha…fun?
Hey emanuele(or someone else who can help me)
ive got a question can i make a hittest with two objects and then flash shows me cordinats where the two are hittesting?
Hi, everybody!
Here you can play my game named Polar Solar which is based on BallPusher prototype:
http://www.askforgametask.com/games/polarsolar/
Although the game is pretty simple, it has got an exclusive sponsorship. Of course, FrozzenHaddock and LuizZak as authors of the prototype are credited in the game.