Z
Zelda Hyrule
Guest
Hello everyone,
So my question is about this:
Let's say we've got 3 objects, which represent enemies:
1)obj_run (a guy that runs around),
2)obj_shoot (a guy just sitting at his position and occasionally shooting),
3)obj_run_shoot (a combo of the first two, a guy that runs around and occasionally shoots).
They have got the following Create events:
obj_run:
movespeed = 5;
dir = -1;
obj_shoot:
shotRate = 7;
alarm[0] = shotRate;
obj_run_shoot:
movespeed = 5;
dir = -1;
shotRate = 7;
alarm[0] = shotRate
(The third is just the other two put together)
(Ignore the functionality of the variables, this is just an example)
So what would be the most elegant way to avoid writing double code?
Would it be a script (one initializing the variables of obj_run and one for those of obj_shoot), event_perform_object (called in the create of obj_run_shoot), or some sort of parenting?
Any help is greatly appreciated.
Thanks in advance.
So my question is about this:
Let's say we've got 3 objects, which represent enemies:
1)obj_run (a guy that runs around),
2)obj_shoot (a guy just sitting at his position and occasionally shooting),
3)obj_run_shoot (a combo of the first two, a guy that runs around and occasionally shoots).
They have got the following Create events:
obj_run:
movespeed = 5;
dir = -1;
obj_shoot:
shotRate = 7;
alarm[0] = shotRate;
obj_run_shoot:
movespeed = 5;
dir = -1;
shotRate = 7;
alarm[0] = shotRate
(The third is just the other two put together)
(Ignore the functionality of the variables, this is just an example)
So what would be the most elegant way to avoid writing double code?
Would it be a script (one initializing the variables of obj_run and one for those of obj_shoot), event_perform_object (called in the create of obj_run_shoot), or some sort of parenting?
Any help is greatly appreciated.
Thanks in advance.
Last edited by a moderator: