M
Makai Post
Guest
Is there a way to use constructors for objects? I need to have each instance of the same object have different values. I need to be able to put these variables in before it is created so that other variables below it can use them as the object is being created.
instance_create(16, 25, objEnemy(125, c_red, true))
-->///objEnemy(max_health, body_color, can_run)
max_health = argument0
health = max_health
body_color = argument1
can_run = argument2
if (can_run) {
right now the only way I can think to do it is create the instance, change the values, and have it do an alarm that then adds the rest of the values, but that is really messy.max_health = argument0
health = max_health
body_color = argument1
can_run = argument2
if (can_run) {
//do stuff...
}