• Content Count

  • Joined

  • Last visited

Reputation Activity

  1. Like
    jilonor reacted to fillmoreb in sprite rotation. Get updated position?   
    The sprite's position never actually changes, which is why you don't get a change in the coordinates.  If you want the apparent position of the planet use something like this:
    apparent_x = x + Math.cos(rotation)*orbit_radius*scale;
    apparent_y = y + Math.sin(rotation)*orbit_radius*scale;
    EDIT: Needing to multiply by scale depends on whether you want scale to affect the orbit radius or not.  That's probably obvious, I just wanted to clarify.
  2. Like
    jilonor reacted to megmut in Question around structure to order states   
    My advice, would be to have a single game state, then a map class, which deals with dynamic generation which extends area classes. This way, each area can have it's own update loop and other over riding methods.
    Using seperate states is possible, but using ECMA6 (ES6) you won't have to use require.js.
    Hope this helps!
  3. Like
    jilonor reacted to jmp909 in event listeners on sprites with limited context   
    Thats wrong
    this.selectorGroup.alpha = 0;
    that would just set the group alpha to 0, not the children's alpha
    either use setAll or forEach