T
tiberionx
Guest
Ok so i didnt want to necro an old thread
so this is what i derived from that thread, instead of placing the code in the player events i wanted it to be in the orbiting object
now I wanted to place like 2 or 3 of these objects but they all start at the same place in the orbit
in the old Thread Erik had this code
but i couldnt derive it to my code , like rot_mod and instance_create seems to be a variable i dunno where to place
appreciate the help
so this is what i derived from that thread, instead of placing the code in the player events i wanted it to be in the orbiting object
GML:
orbit_dir+=3;
if (orbit_dir>359) { orbit_dir=0; }
orbit_x= o_ship.x+(lengthdir_x(64, orbit_dir));
orbit_y= o_ship.y+(lengthdir_y(64, orbit_dir));
x = orbit_x;
y = orbit_y;
in the old Thread Erik had this code
Code:
// Value that store how many shields to use.
// Three for example. You can change this value to as many shields
// as you want or need. ;)
shield_num=3;
// Setup orbit_dir variable for future
orbit_dir=0;
// For loop to create each shield
for(num_s=0;num_s<shield_num;num_s++){
with(instance_create(x,y,obj_orbit)){
//Setting a value that will be used to alter the
//degrees of rotation in relation to the other shields.
rot_mod=((360 div other.shield_num)*other.num_s);
// setting mother id
mother=other.id;
}
}
appreciate the help