Prev | Current Page 726 | Next

Frank Zammetti

"Practical DWR 2 Projects"


playerExplosionDir This indicates whether we are incrementing or decrementing an
index into the explosionImages array, in other words, whether the
explosion is expanding or contracting for the player.
opponentFlippedTile1 This is the tile number of the first tile the computer opponent
currently has flipped.
opponentFlippedTile2 This is the tile number of the second tile the computer opponent
currently has flipped.
opponentExplosionInterval This is a pointer to a JavaScript interval that is used to do the
explosion animation cycle for the opponent, one tick per frame.
opponentExplosionFrame This is the current animation frame being shown for exploding tiles
for the opponent.
opponentExplosionDir This indicates whether we are incrementing or decrementing an
index into the explosionImages array, in other words, whether the
explosion is expanding or contracting for the opponent.
First Things First: init()
The first method we come across in this class is init(), which we saw in index.jsp is called
upon page load. Here??™s that code now:
this.init = function() {
// Kick off DWR reverse-ajax (Comet).
dwr.engine.setActiveReverseAjax(true);
// Preload tile images. 0 is always unflipped.


Pages:
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738