Computer Science Canada A very weird problem that delays movement of my red square! |
Author: | DanceMacabre [ Sat May 06, 2006 8:19 pm ] | ||
Post subject: | A very weird problem that delays movement of my red square! | ||
ok! This is the weirdest thing thats ever happened and I'll try my best to explain it. I want this red square to move fluidly and not all screwed up like. as the square moves, it leave red behind it and thats ok, I want that to happen. but sometimes the red behind the square disappears and the squares movement lags like mad. Please look at the code to see if you can figure it out, cause I can't, let alone explain my problem properly. Thank you so much ![]()
much appreciated |
Author: | Cervantes [ Sat May 06, 2006 9:10 pm ] | ||||
Post subject: | |||||
Loops nested within if statements within loops is a pretty hefty structure. What's more, it's entirely unecessary. Instead, use one variable to store the current direction of the box.
You could even get rid of that second if structure if you used some trig:
|
Author: | DanceMacabre [ Sun May 07, 2006 9:22 pm ] |
Post subject: | |
Thanke me matey. Makes sense. |