ok my entire post just got deleted. oh my god how terrible I was right at the end.
Ill speak from the last thing I said and move back up...
relative to component objects. Currently the way I handle them is entirely abstract, without the creation of objects. So there is an engine_health variable, and max speed is calculated based on its health, so if it is damaged less than full health, the max speed is slower. Is it best to make each component an object, so then that if it is destroyed it can truly be destroyed, deleted, because you shouldn't be able to repair a destroyed system.
Or I could add if enginehealth < 0 then destroyed = true
and in my repair function I could put up front,
if destroyed = false, so that no repair code will execute once destroyed is true.
currently turning on/off systems is done with a button press, and booleans... so say
if keyhit key W
weapon systems = true
end if
and in firing weapons a check is first made,
if weapon systems = true
otherwise if false, nothing happens.
currently the code is separated by types.bmx
functions.bmx and etc... globals
i have my repair() as a standalone function, but ive been wondering if it isnt better for the future to put everything the ship Type can do to itself, inside the ship type as a method. Especially for AI programming.
because otherwise, repair() can only modify the fields of one object, because you have to refer to that object because its a function not a method...
ship.engine_health REPAIR IT
ship.system REPAIR it
so only the object SHIP would be getting repaired no matter who is damaged :)
finding lots of errors in the logic here.. :)
Ill speak from the last thing I said and move back up...
relative to component objects. Currently the way I handle them is entirely abstract, without the creation of objects. So there is an engine_health variable, and max speed is calculated based on its health, so if it is damaged less than full health, the max speed is slower. Is it best to make each component an object, so then that if it is destroyed it can truly be destroyed, deleted, because you shouldn't be able to repair a destroyed system.
Or I could add if enginehealth < 0 then destroyed = true
and in my repair function I could put up front,
if destroyed = false, so that no repair code will execute once destroyed is true.
currently turning on/off systems is done with a button press, and booleans... so say
if keyhit key W
weapon systems = true
end if
and in firing weapons a check is first made,
if weapon systems = true
otherwise if false, nothing happens.
currently the code is separated by types.bmx
functions.bmx and etc... globals
i have my repair() as a standalone function, but ive been wondering if it isnt better for the future to put everything the ship Type can do to itself, inside the ship type as a method. Especially for AI programming.
because otherwise, repair() can only modify the fields of one object, because you have to refer to that object because its a function not a method...
ship.engine_health REPAIR IT
ship.system REPAIR it
so only the object SHIP would be getting repaired no matter who is damaged :)
finding lots of errors in the logic here.. :)