Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This code will use all the spawn point objects in the room to create an array of spawn points
- //First, declare the variables (global variables too)
- globalvar i, spawn;
- var object;
- i = 0;
- object = noone;
- //Now to initilize the array
- //First, set the initialze variable to the number of spawn points the array will contain
- spawn = instance_number(P1_coin_spawn);
- //Now to set the actual array values
- repeat(spawn)
- {
- //First get the spawn object
- object = instance_find(P1_coin_spawn,i);
- //Now set the array to the object's position
- spawn[i,0] = object.x;
- spawn[i,1] = object.y;
- //Now to increment i by one
- i += 1;
- }
- //And all done!
Advertisement
Add Comment
Please, Sign In to add comment