Got a shooting system working, uses 13 parameters so I wrapped it up with a function instead of using another dozen of instance variables (do not know if this is a good idea). Works if it is given numbers, but it does not if given function.param(number). I've read both entries in the manual and looked around, but I cannot figure it out.
I'd appreciate any help!
Capx: https://www.dropbox.com/s/jp6a7sn0w37bu ... .capx?dl=1
You shouldn't use Wait in a function, as the function will return immediately, and the parameters are lost. A Timer is the better way to do this.
Ugh... The point of the system was to avoid creating more instance booleans/variables and make it compact. Isn't there a more clean workaround? Making a timer seems messy. I'll try it out, anyway. Thanks, blackhornet
This is what I meant to do (I did it quite a while ago, but it works), with parameters instead of instance variables.
That's what instance variables do - I don't know why you are fighting it.
Wouldn't having 20+ instance variables in 50+ instances constantly changing affect performance? This method made it more compact to design weapon stats too, but oh well ~
But those values have to exist somewhere, and I'd think passing 13 parameters to a function call would be more time consuming than accessing preallocated memory values. Seems like a minor thing to worry about.
https://www.scirra.com/blog/83/optimisa ... -your-time
Develop games in your browser. Powerful, performant & highly capable.
Absolutely not at all