A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: [Performance] Getter/Setter vs static

Threaded View

  1. #1
    PlayerForever adi4x's Avatar
    Join Date
    Feb 2005
    Posts
    753

    Question [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

    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 ?
    Attached Images Attached Images
    Card Games - play many card games free
    Free Games many free online games

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center