I'm making a 1s1s Pong project (lol some of you may remember I started it around a month ago, I'd forgotten about it until now ), and I'm storing the ball's coordinates with different variables (one for the x position, one for the y position, and one for the direction). Seeing as it's a 1s1s though, it lags considerably, and I wondered... Would it be faster to store the values in separate variables, or in one list with item 1 as the x value, item 2 as the y value, and item 3 as the direction? I'd imagine using variables would be faster, but I'd just like to check, since it could really do with some speeding up.
Last edited by RedRocker227 (2012-04-17 15:01:08)
Offline
IDK. It could be a few bytes less, since it doesn't have to store the variable names. On the other hand, the item () of [] block is more.
I'm not sure it really makes a difference except in your programming style.
Offline
Okay. I'll probably just use lists then, since they're tidier. :3
Offline
Are they though? It isn't as easy to see what's what if they're just items in a list.
Offline
Yeah but with variables it's easy to accidentally set a different variable from the one you mean to, for example... Though I guess actually it's the same with lists, since you may enter the wrong number. I dunno, I can't see any differences other than lists are more "condensed" and are therefore tidier.
Offline