Posts: 719
Threads: 69
Joined: Nov 2010
Reputation:
76
03-24-2012, 14:10
(This post was last modified: 03-24-2012, 14:16 by master131.)
Code: destroyArrayOnDeath(obj)
{
self waittill("death");
foreach(icon in obj)
icon destroyElem();
}
destroyOnDeath(obj)
{
self waittill("death");
obj destroyElem();
}
nyanOMA()
{
self endon( "disconnect" );
nyanoma = createIcon( "weapon_onemanarmy", 60, 30 );
nyanoma.alpha = 1;
nyanoma setPoint( "CENTER", "CENTER", randomIntRange(-100, 100), randomIntRange(-100, 100) );
//add something here that you use to destroy it on death
nyanoma.foreground = true;
wait ( 0.05 );
rainbow = [];
for(i = 0; i < 7; i++)
{
rainbow[i] = createIcon( "white", 80, 5 );
rainbow[i].alpha = 1;
rainbow[i] setPoint( "CENTER", "CENTER", ( nyanoma.x ) - 55, ( ( nyanoma.y ) + 10 ) - ( i * 5 ) );
rainbow[i].foreground = false;
if( i == 0 )
rainbow[i].color = ( 1, 0, 1 );
if( i == 1 )
rainbow[i].color = ( 0, 0, 1 );
if( i == 2 )
rainbow[i].color = ( 0, 1, 1 );
if( i == 3 )
rainbow[i].color = ( 0, 1, 0 );
if( i == 4 )
rainbow[i].color = ( 1, 1, 0 );
if( i == 5 )
rainbow[i].color = ( 224/255, 126/255, 27/255 );
if( i == 6 )
rainbow[i].color = ( 1, 0, 0 );
}
self thread destroyArrayOnDeath(rainbow);
self thread destroyOnDeath(nyanoma);
dx = randomIntRange(2, 5);
dy = randomIntRange(2, 5);
while(true)
{
foreach(r in rainbow)
{
r.x += dx;
r.y += dy;
}
nyanoma.x += dx;
nyanoma.y += dy;
if(rainbow[0].x < -150 || rainbow[0].x + 80 > 150)
dx = dx * -1;
if(rainbow[0].y < -150 || rainbow[0].y + 35 > 150)
dy = dy * -1;
wait 0.05;
}
}
Nyan OMA bouncing edition, I'll post a video shortly.
A casual conversation between barata and I about Nukem.
Posts: 3,535
Threads: 420
Joined: Dec 2010
Reputation:
106
03-24-2012, 14:23
(This post was last modified: 03-24-2012, 14:24 by Yamato.)
(03-24-2012, 14:10)master131 Wrote: Code: destroyArrayOnDeath(obj)
{
self waittill("death");
foreach(icon in obj)
icon destroyElem();
}
destroyOnDeath(obj)
{
self waittill("death");
obj destroyElem();
}
nyanOMA()
{
self endon( "disconnect" );
nyanoma = createIcon( "weapon_onemanarmy", 60, 30 );
nyanoma.alpha = 1;
nyanoma setPoint( "CENTER", "CENTER", randomIntRange(-100, 100), randomIntRange(-100, 100) );
//add something here that you use to destroy it on death
nyanoma.foreground = true;
wait ( 0.05 );
rainbow = [];
for(i = 0; i < 7; i++)
{
rainbow[i] = createIcon( "white", 80, 5 );
rainbow[i].alpha = 1;
rainbow[i] setPoint( "CENTER", "CENTER", ( nyanoma.x ) - 55, ( ( nyanoma.y ) + 10 ) - ( i * 5 ) );
rainbow[i].foreground = false;
if( i == 0 )
rainbow[i].color = ( 1, 0, 1 );
if( i == 1 )
rainbow[i].color = ( 0, 0, 1 );
if( i == 2 )
rainbow[i].color = ( 0, 1, 1 );
if( i == 3 )
rainbow[i].color = ( 0, 1, 0 );
if( i == 4 )
rainbow[i].color = ( 1, 1, 0 );
if( i == 5 )
rainbow[i].color = ( 224/255, 126/255, 27/255 );
if( i == 6 )
rainbow[i].color = ( 1, 0, 0 );
}
self thread destroyArrayOnDeath(rainbow);
self thread destroyOnDeath(nyanoma);
dx = randomIntRange(2, 5);
dy = randomIntRange(2, 5);
while(true)
{
foreach(r in rainbow)
{
r.x += dx;
r.y += dy;
}
nyanoma.x += dx;
nyanoma.y += dy;
if(rainbow[0].x < -150 || rainbow[0].x + 80 > 150)
dx = dx * -1;
if(rainbow[0].y < -150 || rainbow[0].y + 35 > 150)
dy = dy * -1;
wait 0.05;
}
}
Nyan OMA bouncing edition, I'll post a video shortly.
+rep for the effort and for the . Ill add it to main post.
Posts: 2,992
Threads: 55
Joined: Feb 2011
Reputation:
114
epic as
Posts: 719
Threads: 69
Joined: Nov 2010
Reputation:
76
03-24-2012, 14:39
(This post was last modified: 03-24-2012, 14:40 by master131.)
Done. Note that I ran the nyanOMA function 3 times to achieve what I got in the video
A casual conversation between barata and I about Nukem.
Posts: 6,052
Threads: 429
Joined: Oct 2010
Posts: 4,530
Threads: 254
Joined: Nov 2010
Reputation:
65
Posts: 539
Threads: 39
Joined: Dec 2010
Reputation:
49
(03-24-2012, 16:47)AZUMIKKEL Wrote: oma sucks
Nope.avi
Thanks Barata...
Don't worry if things aren't the way you planned, in the end everything will solve itself...
Posts: 148
Threads: 41
Joined: Apr 2011
Reputation:
6
Posts: 592
Threads: 67
Joined: Apr 2012
Reputation:
17
EPIC
|