To my eternal amusement, I've managed to use my wits and endless (yeah right) charm to reshape this code to do my bidding (for now). Altering code that isn't your own can be really tricky, because often other people have a totally different "style" of writing their code. For example, it aggravates me when people don't leave spaces between calculations. Despite the fact that it saves space, I find it makes things harder to read and structure.
I managed to re-write the code so that now only one tree grows, in the background format that I want, and the tree progresses in growth based on mouse clicks, rather than the whole tree growing instantly based on one mouse press.
In theory, this should allow me to connect the growth element to the presence of suns beyond a certain size, encouraging the tree to grow based on that. It should be relatively simple, but with coding you can never tell. I'm still slowly working towards a stage of ultimate synergy with Processing, but I predict that with the current amount of time spent on learning it, that could be a few years out.
Having the single tree also grow from the point that I have decided is the top of the hill is also really useful, because in theory then I should just be able to copy this code over, and with some small alterations, apply it to my solar creation code with the awesome setting that I have.
The only concern that I have so far is that this code here that I've re-written is due to the background refreshing itself in my solar creation code, while in this code, the background doesn't refresh. I can see this causing some issues, and at present I'm really not sure how to rectify it.
No comments:
Post a Comment