Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Community Boards > Just for Kicks Challenges

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-05-2004, 11:49 AM   #1
stealthelephant
The Thread Collector
 
Join Date: May 2003
Location: the far side
Posts: 1,410
Send a message via AIM to stealthelephant Send a message via MSN to stealthelephant
Default Atomic!

i have been thinking about this for ages now and have a nice idea layed out & came in here by mistake 1 day and was very impressed with the flower posts and want to see what the gurus are capable of with this 1, wont have anything posted for a while (aprox 3 weeks) cos i'm waiting for my powerbook to arrive
Theme is Atomic!
normal rules
happy flashing
stealthelephant is offline   Reply With Quote
Old 02-15-2004, 10:31 AM   #2
stealthelephant
The Thread Collector
 
Join Date: May 2003
Location: the far side
Posts: 1,410
Send a message via AIM to stealthelephant Send a message via MSN to stealthelephant
Default

i feel like i cheated
this is an alpha sample

PHP Code:
//fps = 50
Mouse.hide();
_root.createEmptyMovieClip("centre_mc"1);
centre_mc._x 100;
centre_mc._y 100;
centre_mc.lineStyle(100x123443100);
centre_mc.lineTo(10);

_root.createEmptyMovieClip("electron_mc",2);
electron_mc.lineStyle(5,0xFF0000,100);
electron_mc.moveTo(100,100);
electron_mc.lineTo(100,101);

onEnterFrame = function(){
    
electron_mc._rotation += 5;
    
electron_mc._x centre_mc._x _xmouse;
    
electron_mc._y centre_mc._y _ymouse;

hope u guys dont find this challenge too easy

Last edited by stealthelephant; 02-15-2004 at 10:33 AM..
stealthelephant is offline   Reply With Quote
Old 02-15-2004, 05:12 PM   #3
stealthelephant
The Thread Collector
 
Join Date: May 2003
Location: the far side
Posts: 1,410
Send a message via AIM to stealthelephant Send a message via MSN to stealthelephant
Default

PHP Code:
_root.createEmptyMovieClip("centre_mc"1);
centre_mc.lineStyle(100x123443100);
centre_mc.lineTo(10);
_root.createEmptyMovieClip("innerelectron_mc"2);
innerelectron_mc.lineStyle(50xFF0000100);
innerelectron_mc.moveTo(2530);
innerelectron_mc.lineTo(2430);
innerelectron_mc.moveTo(-25, -30);
innerelectron_mc.lineTo(-25, -29);
_root.createEmptyMovieClip("outerelectrons_mc"3);
outerelectrons_mc.lineStyle(50xff0101100);
outerelectrons_mc.moveTo(0100);
outerelectrons_mc.lineTo(0101);
outerelectrons_mc.moveTo(1000);
outerelectrons_mc.lineTo(1001);
outerelectrons_mc.moveTo(0, -100);
outerelectrons_mc.lineTo(0, -99);
outerelectrons_mc.moveTo(-1000);
outerelectrons_mc.lineTo(-100, -1);
onEnterFrame = function () {
    
innerelectron_mc._rotation += 15;
    
outerelectrons_mc._rotation += 5;
    
outerelectrons_mc._x innerelectron_mc._x=centre_mc._x=_xmouse;
    
outerelectrons_mc._y innerelectron_mc._y=centre_mc._y=_ymouse;
}; 
thats the last of it with cheating, going to do a 3d version using vectors (which is was i was thinking of first )
stealthelephant is offline   Reply With Quote
Old 02-16-2004, 05:12 PM   #4
splict
ruby on rails fan :)
 
splict's Avatar
 
Join Date: Oct 2003
Location: tampa, fl
Posts: 1,139
Send a message via AIM to splict Send a message via MSN to splict Send a message via Yahoo to splict
Default

okay, not exactly Atomic Kitten, but here's my first entry. Its a little messy 'cause I cut out some features and some cheating to get it properly at 25 lines. I will probably mess with it some more (add color changing effects), but I'm gonna eat dinner now.

The idea started as "splitting atoms." Roll your mouse over my very crude atom to split it in two. you may repeat this until you get bored. comment out the specified line to allow the original atom to be split again before it has come to a complete rest (makes for faster mayhem ) Valentine's Day themed.
PHP Code:
part _root.createEmptyMovieClip("part0"i++);
part.beginFill(0xcd185c100);
part.curveTo(1001010);
part.curveTo(1010010);
part.curveTo(-1010, -1010);
part.curveTo(-10000);
part.endFill();
split = function () {
    
delete this.onRollOver// comment me out to allow multiple splits
    
newpart part.duplicateMovieClip("part" i++, i);
    
newpart.xdist Math.random() * 300 150;
    
newpart.ydist Math.random() * 300 150;
    
newpart.startx newpart._x this._x;
    
newpart.starty newpart._y this._y;
    
newpart.friend this;
    
newpart.onEnterframe = function() {
        if (
Math.abs(this._x this.startx) < Math.abs(this.xdist)) {
            
this._x += this.xdist 10;
            
this._y += this.ydist 10;
            
this.friend._x -= this.xdist 10;
            
this.friend._y -= this.ydist 10;
        } else {
            
delete this.onEnterFrame;
            
this.friend.onRollOver this.onRollOver split;
        }
    };
};
part.onRollOver split
splict is offline   Reply With Quote
Old 02-16-2004, 05:33 PM   #5
McGiver
Goldmember
 
McGiver's Avatar
 
Join Date: Feb 2003
Location: bavaria in germany
Posts: 1,627
Default

I nominate my cells from the AI thread
http://www.actionscript.org/forums/s...5&pagenumber=1
and declare them as ... err ... growing instable atoms?

btw.: nice codes both
I will make an own if I find the time and interest
McGiver is offline   Reply With Quote
Old 02-16-2004, 06:11 PM   #6
stealthelephant
The Thread Collector
 
Join Date: May 2003
Location: the far side
Posts: 1,410
Send a message via AIM to stealthelephant Send a message via MSN to stealthelephant
Default

Quote:
Originally posted by McGiver
I nominate my cells from the AI thread
http://www.actionscript.org/forums/s...5&pagenumber=1
and declare them as ... err ... growing instable atoms?

btw.: nice codes both
I will make an own if I find the time and interest
i accept, have a nice idea for that one too

will not be doing any coding until m'puter arrives, but will have to do some AI research and some recursion techniques research!!
[death voice]
U must challenge me to a duel heh? Nobody has ever won [/death voice]
stealthelephant is offline   Reply With Quote
Old 02-28-2004, 11:20 AM   #7
stealthelephant
The Thread Collector
 
Join Date: May 2003
Location: the far side
Posts: 1,410
Send a message via AIM to stealthelephant Send a message via MSN to stealthelephant
Default vectored approach

this 1 is a side on view

PHP Code:
_root.createEmptyMovieClip("electron_mc"1);
electron_mc.lineStyle(100x123443100);
electron_mc.lineTo(10);
_root.createEmptyMovieClip("centre_mc"2);
centre_mc.lineStyle(100x123443100);
centre_mc.lineTo(10);
electron_mc.theta 50;
electron_mc.radius 100;
setInterval(spin1);

function 
spin() {    
    var 
electron_mc;
    
x._y =x._x x.radius *  Math.cos(x.theta) ;
    
    
x.theta+=.05;


    
updateAfterEvent();

variation
PHP Code:
_root.createEmptyMovieClip("electron_mc"1);
drawElection(electron_mc);
_root.createEmptyMovieClip("electron2_mc"4);
drawElection(electron2_mc);
_root.createEmptyMovieClip("electron1_mc"3);
drawElection(electron1_mc);
_root.createEmptyMovieClip("centre_mc"2);
drawElection(centre_mc);
electron_mc.theta 0;
electron_mc.radius 30;
electron1_mc.theta 3.14127;
electron1_mc.radius 30;
electron2_mc.theta = -1.6;
electron2_mc.radius 70;
setInterval(run10);
function 
run() {    

    
electron_mc._y electron_mc._x electron_mc.radius *  Math.cos(electron_mc.theta) ;
    
electron1_mc._y electron1_mc._x electron1_mc.radius *  Math.cos(electron1_mc.theta) ;
     
electron2_mc._y =  electron2_mc._x =  electron2_mc.radius *  Math.coselectron2_mc.theta) ;
    
electron_mc.theta+=.09;
    
electron1_mc.theta+=.09;
     
electron2_mc.theta+=.045;
    
updateAfterEvent();
}
function 
drawElection(elec_mc){
    
elec_mc.lineStyle(100x123443100);
    
elec_mc.lineTo(10);


Last edited by stealthelephant; 02-28-2004 at 11:54 AM..
stealthelephant is offline   Reply With Quote
Old 02-28-2004, 11:23 AM   #8
stealthelephant
The Thread Collector
 
Join Date: May 2003
Location: the far side
Posts: 1,410
Send a message via AIM to stealthelephant Send a message via MSN to stealthelephant
Default vectored approach

frontal view
PHP Code:
_root.createEmptyMovieClip("electron_mc"1);
electron_mc.lineStyle(100x123443100);
electron_mc.lineTo(10);
_root.createEmptyMovieClip("centre_mc"2);
centre_mc.lineStyle(100x123443100);
centre_mc.lineTo(10);
electron_mc.theta 0;
electron_mc.radius 100;
setInterval(run10);
0;
function 
run() {

    
    var 
electron_mc;
    
x._x x.radius *  Math.cos(x.theta) ;
    
x._y x.radius Math.sin(x.theta) ;
    
x.theta+=.05;

    
updateAfterEvent();

stealthelephant is offline   Reply With Quote
Old 02-29-2004, 11:05 AM   #9
stealthelephant
The Thread Collector
 
Join Date: May 2003
Location: the far side
Posts: 1,410
Send a message via AIM to stealthelephant Send a message via MSN to stealthelephant
Default Finished vertored approach

shot way over on the number of lines thought

ActionScript Code:
i = 0; _root.createEmptyMovieClip("centre_mc", 2); drawElection(centre_mc); _root.createEmptyMovieClip("electron_mc", 1); drawElection(electron_mc); _root.createEmptyMovieClip("electron2_mc", 4); drawElection(electron2_mc); _root.createEmptyMovieClip("electron1_mc", 3); drawElection(electron1_mc); _root.createEmptyMovieClip("electron3_mc", 5); drawElection(electron3_mc); electron_mc.theta = electron_mc.phi = 0; electron_mc.radius = 60; electron1_mc.theta = electron_mc1.phi = 3.14127; electron1_mc.radius = 60; electron2_mc.theta = electron_mc2.phi = 3.14127; electron2_mc.radius = 130; electron3_mc.theta = electron_mc3.phi = 0; electron3_mc.radius = 130; x = setInterval(run, 10); function run() {        var x = electron_mc;     var x1 = electron1_mc;     var x2 = electron2_mc;     var x3 = electron3_mc;     //calculate vectors     x._x = x.radius * Math.sin(x.phi) * Math.cos(x.theta);     x._y = x.radius * Math.sin(x.phi) * Math.sin(x.theta);     x._xscale = x._yscale = (130 - (x.radius * Math.cos(x.phi)) / 2) ;     x1._x = x1.radius * Math.sin(x1.phi) * Math.cos(x1.theta);     x1._y = x1.radius * Math.sin(x1.phi) * Math.sin(x1.theta);     x1._xscale = x1._yscale = (130 - (x1.radius * Math.cos(x1.phi)) / 2) ;     x2._x = x2.radius * Math.sin(x2.phi) * Math.cos(x2.theta);     x2._y = x2.radius * Math.sin(x2.phi) * Math.sin(x2.theta);     x2._xscale = x2._yscale = (130 + (x2.radius * Math.cos(x2.phi)) / 2) ;     x3._x = x3.radius * Math.sin(x3.phi) * Math.cos(x3.theta);     x3._y = x3.radius * Math.sin(x3.phi) * Math.sin(x3.theta);     x3._xscale = x3._yscale = (130 - (x3.radius * Math.cos(x3.phi)) / 2) ;     x.theta += .07;     x.phi += .03;     x1.theta +=.08;     x1.phi += .3;     x2.theta +=.001;     x2.phi += .05;     x3.theta+=.01;     x3.phi += .05;         updateAfterEvent(); } function drawElection(elec_mc){     if(i == 0){elec_mc.lineStyle(30, 0x777777, 100);         i++;}     else elec_mc.lineStyle(5, 0x111111, 100);     elec_mc.lineTo(1, 0);     elec_mc._xscale = elec_mc._yscale = 100; }
stealthelephant is offline   Reply With Quote
Old 02-29-2004, 06:22 PM   #10
stealthelephant
The Thread Collector
 
Join Date: May 2003
Location: the far side
Posts: 1,410
Send a message via AIM to stealthelephant Send a message via MSN to stealthelephant
Default

variation
ActionScript Code:
i = 0; mouse.hide(); _root.createEmptyMovieClip("Atomic_mc", 1); Atomic_mc.createEmptyMovieClip("centre_mc", 2); drawElection ( Atomic_mc.centre_mc ); Atomic_mc.createEmptyMovieClip("electron_mc", 1); drawElection ( Atomic_mc.electron_mc ); Atomic_mc.createEmptyMovieClip("electron2_mc", 4); drawElection ( Atomic_mc.electron2_mc ); Atomic_mc.createEmptyMovieClip("electron1_mc", 3); drawElection ( Atomic_mc.electron1_mc ); Atomic_mc.createEmptyMovieClip("electron3_mc", 5); drawElection ( Atomic_mc.electron3_mc ); Atomic_mc.electron_mc.theta = Atomic_mc.electron_mc.phi = 0; Atomic_mc.electron_mc.radius = 60; Atomic_mc.electron1_mc.theta = Atomic_mc.electron_mc1.phi = 3.14127; Atomic_mc.electron_mc1.phi = 0; Atomic_mc.electron1_mc.radius = 60; Atomic_mc.electron2_mc.theta = Atomic_mc.electron_mc2.phi = 3.14127; Atomic_mc.electron_mc2.phi = 0; Atomic_mc.electron2_mc.radius = 130; Atomic_mc.electron3_mc.theta = Atomic_mc.electron_mc3.phi = 0; Atomic_mc.electron_mc3.phi = 0; Atomic_mc.electron3_mc.radius = 130; x = setInterval ( run, 10 ); function run() {     var x = Atomic_mc.electron_mc;     var x1 = Atomic_mc.electron1_mc;     var x2 = Atomic_mc.electron2_mc;     var x3 = Atomic_mc.electron3_mc;     //calculate vectors     x._x = x.radius * Math.sin ( x.phi ) * Math.cos( x.theta );     x._y = x.radius * Math.sin ( x.phi ) * Math.sin( x.theta );     var temp = rotateX (10, x._y, ( x.radius * Math.cos( x.phi ) ) );     x._y = temp.y;     x._xscale = x._yscale = temp.z + 130;     x1._x = x1.radius * Math.sin (x1.phi) * Math.cos(x1.theta);     x1._y = x1.radius * Math.sin (x1.phi) * Math.sin(x1.theta);     temp = rotateX ( 10, -x1._y, x1.radius * Math.cos ( x1.phi ) );     x1._y = -temp.y;     x1._xscale = x1._yscale = temp.z - 130;     x2._x = x2.radius * Math.sin( x2.phi ) * Math.cos ( x2.theta );     x2._y = x2.radius * Math.sin( x2.phi )* Math.sin (x2.theta );     temp = rotateX (10, x2._y, (x2.radius * Math.cos (x2.phi ) ) );     x2._y = temp.y;     x2._xscale = x2._yscale = temp.z + 130;     x3._x = x3.radius * Math.sin ( x3.phi ) * Math.cos ( x3.theta );     x3._y = x3.radius * Math.sin ( x3.phi ) * Math.sin ( x3.theta );     var temp = rotateX (10, -x3._y, ( x3.radiusMath.cos (x3.phi) ) );     x3._y = -temp.y;     x3._xscale = x3._yscale = temp.z - 130;     x.theta += .016;     x.phi += .05;     x1.theta += .016;     x1.phi += .05;     x2.theta += .009;     x2.phi += .05;     x3.theta += .009;     x3.phi += .05;     Atomic_mc._x  = _xmouse;     Atomic_mc._y = _ymouse;     updateAfterEvent (); } function drawElection(elec_mc) {     if (i == 0) {         elec_mc.lineStyle ( 30, 0x777777, 100 );         i++;     } else elec_mc.lineStyle ( 5, 0x111111, 100 );     elec_mc.lineTo ( 1, 0 );     elec_mc._xscale = elec_mc._yscale = 100; } function rotateX(angle, inY, inZ) {     var ca = Math.cos ( angle );     var sa = Math.sin ( angle );     var tempY = (inY * ca) - (inZ * sa);     var tempZ = (inY * sa) - (inZ * cs);     return { y:tempY, z:tempZ }; }
the number lines can be reduced by bout 20 i think,

anyone else wanna give it a shot?
stealthelephant is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:40 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.