home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Games #12
/
GEGA012.iso
/
violencia
/
StickRPG_Combat.swf
/
scripts
/
DefineSprite_565_itemC4MC
/
frame_1
/
DoAction.as
Wrap
Text File
|
2006-01-11
|
2KB
|
75 lines
function addExplosion()
{
rand = random(3) + 1;
_parent.attachMovie("explosion" + rand,"explosion" + count,layer + count);
with(eval("_parent.explosion" + count))
{
x = (random(3) - 1) * count * dispersal * ((random(50) + 50) / 100);
y = (random(3) - 1) * count * dispersal * ((random(50) + 50) / 100);
_x = _parent.atvMC._x + x;
_y = _parent.atvMC._y + y;
_rotation = random(360);
_xscale = _yscale = random(100) + 100;
if(_parent.optChunks)
{
addChunk(x,y);
}
}
count++;
}
function addChunk(x, y)
{
_parent.attachMovie("chunkMC","chunkMC" + chunkCount,123000 + chunkCount);
with(eval("_parent.chunkMC" + chunkCount))
{
_x = _parent.atvMC._x + x;
_y = _parent.atvMC._y + y;
}
chunkCount++;
}
function removeTiles()
{
podX = int((_parent.atvMC._x - _parent.earthMC._x) / 50 + 0.5);
podY = int((_parent.atvMC._y - _parent.earthMC._y) / 50 + 0.5);
var _loc3_ = -2;
while(_loc3_ < 3)
{
var _loc2_ = -2;
while(_loc2_ < 3)
{
if(_parent.earth[podX + _loc3_][podY + _loc2_][0] != 0)
{
if(_parent.earth[podX + _loc3_][podY + _loc2_][0] > -3)
{
if(podX + _loc3_ > -1 && podX + _loc3_ < _parent.earthWidth - 2 && podY + _loc2_ > -1 && podY + _loc2_ < _parent.earthHeight - 2)
{
_parent.earth[podX + _loc3_][podY + _loc2_][0] = 0;
}
}
}
_loc2_ = _loc2_ + 1;
}
_loc3_ = _loc3_ + 1;
}
_loc3_ = -3;
while(_loc3_ < 4)
{
_loc2_ = -3;
while(_loc2_ < 4)
{
if(podX + _loc3_ > -1 && podX + _loc3_ < _parent.earthWidth - 2 && podY + _loc2_ > -1 && podY + _loc2_ < _parent.earthHeight - 2)
{
_parent.reloadTile(podX + _loc3_,podY + _loc2_);
}
_loc2_ = _loc2_ + 1;
}
_loc3_ = _loc3_ + 1;
}
}
layer = 9988776700;
chunkCount = 0;
count = 10;
explosions = 100;
dispersal = 1.5;
_parent.SFXc4.start(0,1);