Retired Document
Important: This sample code may not represent best practices for current development. The project may use deprecated symbols and illustrate technologies and techniques that are no longer recommended.
CoreSource/Document.c
#include "CoreGlobals.h" |
#include "ZAM.h" |
#include "MenuDispatch.h" |
//#define NETWORK_HELL 1 |
void UpdateGameWindow(WindowPtr graf, gamePtr game) |
{ |
SpriteUpdateEvent(); |
} |
void OpenGameWindow(WindowPtr wp, gamePtr game) |
{ |
} |
void CloseGameWindow(WindowPtr wp, gamePtr game) |
{ |
} |
void SaveGameWindow(WindowPtr wp, gamePtr game) |
{ |
} |
void ClickGameWindow(WindowPtr wp, gamePtr game) |
{ |
#if 0 |
Point click; |
short dir; |
GrafPtr savePort; |
fixPt vel; |
Fixed velH,velV; |
GetPort(&savePort); |
SetPort(wp); |
click = gEvent.where; |
GlobalToLocal(&click); |
dir = Random() % kNumShotFrames; |
if(dir < 0) dir = -dir; |
//StartExplosionHere(game, ff(click.h), ff(click.v)); |
FireMissile( dir, ff(click.h), ff(click.v), false); |
{ |
short i; |
for(i = 0; i < 10; i++) { |
dir += i; |
if(dir >= kNumShotFrames) dir = 0; |
FireMissile( dir, ff(click.h), ff(click.v), false); |
} |
for(i = 0; i < 5; i++) { |
dir += i; |
if(dir >= kNumShotFrames) dir = 0; |
FireMissile( dir, ff(click.h), ff(click.v), false); |
} |
} |
SetPort(savePort); |
#endif |
#ifdef NETWORK_HELL |
FireNetworkMissile(game, dir, click); |
#endif |
} |
void KeyGameWindow(WindowPtr wp, gamePtr game) |
{ |
} |
void AdjustMenuGameWindow(WindowPtr wp, gamePtr game) |
{ |
} |
void IdleGameWindow(void) |
{ |
ProcessXThingTask(10); |
CheckMissileColissions(gGame); |
AnimateSprites(); |
SoundKeeper(); |
CheckTankDead(); |
} |
void NewGameWindow(void) |
{ |
NewGame(); |
} |
void ForceRefreshGameWindow(WindowPtr wp, gamePtr game) |
{ |
GrafPtr savePort; |
GetPort(&savePort); |
SetPort(wp); |
ValidRect(&wp->portRect); |
UpdateGameWindow(wp, game); |
SetPort(savePort); |
} |
Copyright © 2003 Apple Computer, Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2003-01-14