HartistaPipebomb Wrote:Ironvein Wrote:You mentioned 'by reference' a lot, so I thought I warn you to make sure you are truly 'deleting' monsters when they no longer need to exist. If you simply 'let go' of a monster's reference when you sell them, it is NOT deleting them, they are just inaccessible, but still remain in memory until the program closes. This cause 'memory leaks' and the game with run fine at first, but then things will slow down and eventually crash.
this is a preventative warning. Its harder to fix the later in development you are.
AS3 is like Java where it does "garbage collecting" and deletes objects that don't have any references to them. I actually couldn't straight up manually delete them even if I wanted to without jumping through some hoops (one of the bigger flaws with this kind of programming language).
Ouch, good luck then. I was worried, because if one of my pens had a lot of monsters in there; the animations slow down a lot. And then I saw the 'reference' comment and thought (oh no). That's why I'm not fond of a lot of languages out there; they let you get away with a lot of crap and can make you sloppy.
By the way, is AS3 or something like it freeware? I've been kicking around ideas for a game of my own for a while now and wanted to write something that is not 'platform specific' (I'm a Mac). Java and Flash are the only ones I know of that are not tied to the machine and have not been able to find any SDL freeware for Flash, so limits me to Java atm.