Points to Remember


  • Don't let a player make a move until both he and his opponent are ready to receive a move. Otherwise, the game's synchronization will be affected.

  • Given the same input on two SWF instances of the same game, Flash may not calculate the exact same result twice, although the numbers will be very close to each other. In some cases, like 9-ball, rounding will help you avoid synchronization issues.

  • All of the possible collisions during a frame are calculated, stored, and sorted from earliest time to latest time . Then the script goes back and calculates the reaction for the first collision (lowest time). We run the collision-detection script again to see if there are any more collisions. This is done until there are no more collisions, or ten times whichever comes first.

  • For speed optimization, we use two arrays to store the state of the balls a moving array and a notMoving array. We then perform collision detection between every ball in the moving array and then between every ball in the moving array with the balls in the notMoving array. We do not check for collisions between balls in the notMoving array.

  • When the moving array is empty, the turn is over.



Macromedia Flash MX Game Design Demystified(c) The Official Guide to Creating Games with Flash
Macromedia Flash MX Game Design Demystified: The Official Guide to Creating Games with Flash -- First 1st Printing -- CD Included
ISBN: B003HP4RW2
EAN: N/A
Year: 2005
Pages: 163
Authors: Jobe Makar

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net