E
Erick is not unique
Guest
hello! Pre beginner coding enthusiast here!
So i've been triying to create a script that can basically allow me to spawn "bullet hell" type proyectiles with simple trayectories to avoid the use of bullet generators that spawn and get destroyed via alarms. So that i can pretty much fill up scr(object,speed, direction, quantity, spacing, xpos, ypos) easily.
Problem is that "quantiy" is spawning N number of instances in a single frame, rather than every step event.
I was wondering if it's posible to code a step verification of sorts from within the script. Or if that's imposible and i should just run the script from within the step event of an object which pretty much defeats the whole purpose.
Thanks in advance!
So i've been triying to create a script that can basically allow me to spawn "bullet hell" type proyectiles with simple trayectories to avoid the use of bullet generators that spawn and get destroyed via alarms. So that i can pretty much fill up scr(object,speed, direction, quantity, spacing, xpos, ypos) easily.
Problem is that "quantiy" is spawning N number of instances in a single frame, rather than every step event.
I was wondering if it's posible to code a step verification of sorts from within the script. Or if that's imposible and i should just run the script from within the step event of an object which pretty much defeats the whole purpose.
Thanks in advance!
Code:
/// @description Get attack inputs
/// @param object
/// @param speed
/// @param direction
/// @param quantity
/// @param spacing
/// @param xpos
/// @param ypos
// capture input from the user and set up default values as required
var attack_part = []; if( argument_count >= 1) attack_object = argument[0];
var attack_object = ""; if( argument_count >= 2) attack_speed = argument[1];
var attack_speed = ""; if( argument_count >= 3) attack_direction = argument[2];
var attack_direction = true; if( argument_count >= 4) attack_quantity = argument[3];
var attack_quantity = ""; if( argument_count >= 5) attack_spacing = argument[4];
var attack_spacing = ""; if( argument_count >= 6) attack_ypos = argument[5];
var attack_xpos = ""; if( argument_count >= 7) attack_ypos = argument[6];
var attack_ypos = "";
// Spawn bullets in quantity
if (argument[3] > 0)
{
while argument[3] > 0
{
inst = instance_create_layer(argument[5], argument[6], "Bullets", argument[0]);
argument[3] -= argument[4];
with inst
{
speed = argument [1];
if argument[2] = true
{
direction = (point_direction(argument[0].x,argument[0].y,oArrowC.x,oArrowC.y));
}
else if argument[2] = false
{
argument[2] = argument[0].direction;
}
}
}
}