I have a question about script codes.
Is there a command in the script editor to set the xvelocity and Y-coördinate of all my enemies?
Because I have to set the xvelocity and Y-coördinate of my enemies manually for each one.
This is the code I am using at the moment.
- Code: Select all
if(enemy_001.x < -120 && enemy_001.xvelocity < 0)
{enemy_001.xvelocity *= -1;
enemy_002.xvelocity *= -1;
enemy_003.xvelocity *= -1;
enemy_004.xvelocity *= -1;
enemy_005.xvelocity *= -1;
enemy_006.xvelocity *= -1;
enemy_007.xvelocity *= -1;
enemy_008.xvelocity *= -1;
enemy_009.xvelocity *= -1;
enemy_010.xvelocity *= -1;
enemy_011.xvelocity *= -1;
enemy_012.xvelocity *= -1;
enemy_013.xvelocity *= -1;
enemy_014.xvelocity *= -1;
enemy_015.xvelocity *= -1;
enemy_016.xvelocity *= -1;
enemy_017.xvelocity *= -1;
enemy_018.xvelocity *= -1;
enemy_019.xvelocity *= -1;
enemy_020.xvelocity *= -1;
enemy_021.xvelocity *= -1;
enemy_022.xvelocity *= -1;
enemy_023.xvelocity *= -1;
enemy_024.xvelocity *= -1;
enemy_001.y = enemy_001.y +15;
enemy_002.y = enemy_002.y +15;
enemy_003.y = enemy_003.y +15;
enemy_004.y = enemy_004.y +15;
enemy_005.y = enemy_005.y +15;
enemy_006.y = enemy_006.y +15;
enemy_007.y = enemy_007.y +15;
enemy_008.y = enemy_008.y +15;
enemy_009.y = enemy_009.y +15;
enemy_010.y = enemy_010.y +15;
enemy_011.y = enemy_011.y +15;
enemy_012.y = enemy_012.y +15;
enemy_013.y = enemy_013.y +15;
enemy_014.y = enemy_014.y +15;
enemy_015.y = enemy_015.y +15;
enemy_016.y = enemy_016.y +15;
enemy_017.y = enemy_017.y +15;
enemy_018.y = enemy_018.y +15;
enemy_019.y = enemy_019.y +15;
enemy_020.y = enemy_020.y +15;
enemy_021.y = enemy_021.y +15;
enemy_022.y = enemy_022.y +15;
enemy_023.y = enemy_023.y +15;
enemy_024.y = enemy_024.y +15;
}
So is there a command, so I can set the xvelocity and the Y-coördinate of all my enemies at once, because i want to make more enemies and this is gonna be a hell of a job, if I continue using this code.