You can do pretty much anything with arrays. But the push/pop thing can be a bit daunting when using more than a dimension. You can't push complete rows, you have to push a single value on the X/Y axis, then modify every cell in subsequent actions, because the value is pushed to all cell of the added row/column.
simplisto ramones I just tried creating a simple plugin to retrieve the type name and it seems I was wrong. Type names get aliased on publish (with or without minifying), to something like "t0", "t1", "t2"... It seems using your own instance variable is the only way. Guess it's back to the drawing board for you simplisto.
ramones It certainly won't work after obfuscating. It would still work though if we created a behavior with the sole purpose of providing an expression to retrieve the instance type name. Variable names get obfuscated, but string literals doesn't.
I always wondered why there wasn't any mean to retrieve the type name at runtime. It's not like the variable isn't there...
Using the Browser object's ExecJS expression, you can easily retrieve it though, it's just unconvenient.
To be fair, Regex would probably be the route I'd take to enable multi-dimensional "one-line" initialization. But as pokeapache said, that's just a silly amount of work just for the instantiation of a simple object.
Function object to the rescue !
First parameter is the value to match to the closest between all other parameters.
What you can do is use the Function object to do something similar. It's not quite a "one line" initialization but it's as close as you can get.
Can you isolate the issue in a capx and share it with us ?
Develop games in your browser. Powerful, performant & highly capable.
You probably want to do this in separate events. One determine the type of hit : miss, hit, critical hit. The other set the damage accordingly.
Yes, and that is most of the magic that comes with the containers functionality !
This should help you.
You first load the Dictionnary with the JSON, then you simply iterate through each key and display them along with the stored value.
What exactly are you looking for, a way to parse the JSON out of Construct or a Construct way of reading all your values ?
Member since 4 Jul, 2011