648DFSsdQ#$4 (08-21-2010),Hassan (08-04-2010),Jakob (06-25-2011),Janot (06-20-2015),NextGen1 (08-21-2010)
Create a AS2 file, draw two circles on the stage, a 50x50 circle, and a 10x10 circle.
Select the 50x50 ball, and turn it into a movieclip (F8), name it "cleaner", registration in the center, export for actionscript (click the checkbox), identifier "cleaner" (if not automatically done).
Do the same for the 10x10, but name it "target" this time.
Now, delete everything off the stage, don't worry they are in the library.
Make sure you are in the root scene, and select the first frame from the timeline, and paste this code into the actionscript manager (press F9 to open and close it), everything is straightforward telling which each command does in the code.
Here's the result:Code://Create the big cleaner circle attachMovie("cleaner", "cleaner", getNextHighestDepth(), {_x: _xmouse, _y: _ymouse}); //Make the cleaner follow the mouse startDrag(cleaner); //Hide the mouse Mouse.hide(); //enemy count var enemies = 50; //Create the enemies for (var i = 0; i < enemies; i++) { //place the enemies on the screen attachMovie("target", "target_"+i, getNextHighestDepth(), {_x: random(Stage.width), _y: random(Stage.height)}); //dynamically attach the behavior for the targets _root["target_"+i].onEnterFrame = function() { //Check for hitting the cleaner if (this.hitTest(cleaner)) { //remove the movie clip if it hits the cleaner removeMovieClip(this); } } }
As you can imagine, I can clear the screen with my mouse.
If theres enough interest, I might continue a part two, on how to transform it into an addicting mini-game.
Last edited by arunforce; 08-04-2010 at 02:44 AM.
BRING BACK BT, BRING BACK SAGA, BRING BACK VF, BRING BACK MPGHCRAFT, BRING BACK HABAMON
648DFSsdQ#$4 (08-21-2010),Hassan (08-04-2010),Jakob (06-25-2011),Janot (06-20-2015),NextGen1 (08-21-2010)
W00T!
1 Thank in two weeks.
Thats enough hype. PART TWO PART TWO
Ex Middleman
Thanked. Mini game may be interesting.
Keep in mind, Adobe Flash CS5 makes native Flash games for I-Phone. So I am interested
Poor guy. No part 2
/Thanked for his optimism
/GIB the Damn MiniGame!