eternaldensity / Sandcastle-Builder

xkcd: 1190: Time: The Game
Other
81 stars 65 forks source link

Use listeners instead of updating everything #857

Open LucidCrux opened 10 years ago

LucidCrux commented 10 years ago

I may roll this into the div refactor stuff, I don't know. There is ton of stuff I am finding that could be improved while working on that, and frankly it is a bit overwhelming and counter productive trying to make things work for things that should actually be changed anyway. I'm actually starting to think my time may be better spent just working on the new engine so we can start over without the mess that's been made from feature creep without an underlying structure to handle it. I feel like I am almost going to have to do a rewrite of huge amounts of stuff. : /

Anyways, the code right now basically just tells everything to update when anything is changed. This is horrible, to be blunt. If things were made to properly use event handling then a whole lot of execution and redrawing could be avoided.

eternaldensity commented 10 years ago

Yes, I shouldn't have used cookie clicker as an example of how to do anything.

LucidCrux commented 10 years ago

Eh, I've run into this same problem on some my own little projects. When something is just small, event handling seems like overkill and a waste of time for mostly simple checks. Then when you eventually decide to expand and keep adding things and the project gets bigger and bigger, it just kind of gets worse and worse until you realize event handling does need to be more dynamic.

eternaldensity commented 10 years ago

Exactly!