Fangames > Programming Questions
Affecting Existing Objects
Kyir:
Is there a more elegant/simple/whatever was to affect objects that already exist when something occurs other than making them all check for variables in their step events? For example: if object A and B exist, and I want to make something happen to object B when object A gets shot.
I feel like there's gotta be something, but finding it in the depths of game maker's help feature is beyond me.
YoSniper:
This would have to be on a case-by-case basis, but something you could do is:
On Event in objectA when objectA gets shot:
--- Code: ---with(objectB) {
//React to shot
}
--- End code ---
Kyir:
Would that make both objects react that way, or just Object B?
pieceofcheese87:
Just to clarify, object A and object B are two of the same object?
Kyir:
Preferably not, but if that's what's necessary I can probably still make it work.
Navigation
[0] Message Index
[#] Next page
Go to full version