hi folks,
I would like to know what's the difference when I write a temporary variable like this (these are just examples):
version1
or this:Code:for each tempEnemy in enemyManager.enemies { var tempX:int = tempEnemy.x; }
version2
What's wrong and right? Currently I write it like version 2 and I'm not sure if I should change it to version 1. Can someone help me out with this please? I know most developers write like version 1 but I'm a little bit confused because I am totally unaware about version 1. If I use version 1 does that mean that my value is stored explicitly in a temporary variable that is cleared in every cycle?Code:for each tempEnemy in enemyManager.enemies { tempEnemy.oldX = tempEnemy.x; }




Reply With Quote