3 ms·
I always love when something closed source goes open. While I never played this game in particular (looks like I've missed something!), I love to study code. I
by MrGilbert 7y ago
I always love when something closed source goes open.
While I never played this game in particular (looks like I've missed something!), I love to study code. It's always interesting to see how other devs tackled a problem or just structured their code.
Thanks a lot!
- ocdtrekkie 7y agoIndeed. Someone open sourcing their previously closed project will always get my upvote. :) In this case the code is likely pretty messy. The repo explains that it was ported from a Flash game and a lot of the bad hacks used to make it work in Flash were ported to C++ more or less verbatim.
- quietbritishjim 7y agoFrom the article: > For example, maybe my worst programming habit is declaring temporary variables like i, j and k as members of each class, so that I didn’t have to declare them inside functions (which is annoying to do in flash for boring reasons). This led to some nasty and difficult to track down bugs, to say the least. In entity collision in particular, several functions will share the same i variable. Infinite loops are possible.
- lukebitts 7y ago> which is annoying to do in flash for boring reasons Does anyone know what are these boring reasons? I've used AS2 and AS3 extensively and don't remember this ever being an issue
- uhoh-itsmaciek 7y agoSame here. The only thing I can think of is variable hoisting, but I don't think that's annoying enough to prefer this other approach.
- yarrel 7y agoThis isn't open. Studying this code then making anything too much like it might be a problem.