1 Attachment(s)
[Performance] Getter/Setter vs static
I'm staring to make an AS3 game. I want to know something about performance. Here is my (theoretical) case.
Classes
Main.as Hero.as Ghost.as
http://board.flashkit.com/board/atta...1&d=1326801088
The game action is simple: the Ghost must chase the Hero (and has to know its X Y position).
1. How to send the Hero X Y position to the Ghost(s) ?
1. Using getter/setter
2. Using static var - this seems easier
2. How many enterFrames events to use
Instead of making classes with their own enterFrame events maybe i should keep one class Game.as and search for collisions using a loop
Or maybe I should use one single Timer event ?