Multiple Use for one Object?

H

heanfry

Guest
I have

spr_title: it has 3 subimages (not for animation)
obj_title: every instance for a subimage has been created in room

i want to know if there i way to code every single instance of the object in the event.

Thankyou
 

NicoDT

Member
I have

spr_title: it has 3 subimages (not for animation)
obj_title: every instance for a subimage has been created in room

i want to know if there i way to code every single instance of the object in the event.

Thankyou
Yeah, it´s possible.

In the create event of the object:
image_speed = 0 //this is so it doesn´t look through all the subimages of the spr_title

Then in the room editor, select each object, right click, and go to creation code, and put the code
image_index = 0 (or the subimage you want for that particular instance)

If each instance is going to have a different step even deppending on the image_index, you could do the following in the step event:

Code:
if image_index=0 {
  //code
} else {
  if image_index=1 {
    //code
     else if ... {
   }
}
 
H

heanfry

Guest
I want to change the x and y position of each instance. is this possible?
 
H

heanfry

Guest
Ah i thought it will change it for all instances at once, so all my problems have been solved.
Thanks
 

Xer0botXer0

Senpai
If you want to handle instances individually then store their instance IDs into a list. Or create them using code then set their instance variables or local variables that way.
 
Top