Friday, June 3, 2011
...Insert Title Here...
So last night was rather fun then frustrating. I did something insane, to me, programming wise that worked. I actually put pointers to the array a class is in, in the class. And it worked. I had to for the producers to work or it was at least my fix. Since I couldn't tag an image with an array. Not surprising really but it meant that I couldn't an array of producers to an image to link for float over. Since the images and the actual item are two different things it created a bit of an issue. My solution was to add an id number to them matching the id number of the item in the array. But that added one new problem... what array do I look in for the ID number? add a pointer and were done. But still some weird backwards logic. I'm sure there was a better answer and someone is going to give me a complicated correct one, that I don't understand. But my way works.
Definitely think my programming has gone up a few more levels in the last weeks.
Then of course I tried to implement into the main game. And everything broke... for some reason the sorter is converting all my classes in the array into strings... I still don't know why its tonight's project. Then hopefully once that is up and running can get the stacker working.
Daisy
Subscribe to:
Post Comments (Atom)
I don't know ActionScript, but it sounds to me like you're writing spaghetti code because you didn't plan properly. I've found that making a nice UML diagram before you begin really helps.
ReplyDeleteThe question here is, is the ID number array an array of pointers or is it an array that has a pointer aimed at it? Either way this isn't spaghetti code as its not a jump to line nor is it a pointer to a pointer to a pointer with no end in sight.
ReplyDeleteSpaghetti code is anything that is unnecesarilly complex. On the other hand, Daisy_Strike is atleast producing RESULTS, which is more than can be said for a lot of other people I know, even if the solutions aren't the best available.
ReplyDeleteThe details of programming will make themself known only by practise.
I agree with both of you it is a bit Spaghetti. Mainly because I use the blinking light method. (OOOH blinking light, OOH blinking Light!) It's getting better and better believe it or not with a better organization.
ReplyDeleteDaisy