This is BattleView.h in view mode; [Download] [Up]
/* Copyright 1992, Stefanos Kiakas. All rights reserved. You may not delete this notice. */ #import <appkit/View.h> #import <dpsclient/event.h> #include <sys/param.h> #include "HighScoreTable.h" #import "SoundEffect.h" #define BOMB 1 #define SPLITTER 0 #define INCOMINGBASEV 1 typedef struct cityBasestruct { NXPoint coord; int type; } cityBaseRec; typedef struct mNode { NXPoint startPos,destPos,currentPos; float delta_x, delta_y; struct mNode *next; } MSLE_NODE, *MSLE_NODE_PNTR; typedef struct eNode { NXPoint currentPoint; float rad,maxrad; BOOL maxReached; struct eNode *next; } EXP_NODE, *EXP_PNTR; typedef struct maNode { NXPoint startPos, destPos, currentPos; int targetLoc, missileType; float delta_x, delta_y; struct maNode *next; } MA_NODE, *MA_NODE_PNTR; typedef struct smartNode { NXPoint destPos, currentPos; int targetLoc; struct smartNode *next; } SMART_NODE, *SMART_NODE_PNTR; #define CITY 1 #define BASE 2 #define CITIES 9 #define TARGETS 11 static cityBaseRec cityBasearray[TARGETS] = { {10.0,5.0,CITY}, {100.0,5.0,CITY}, {140.0,5.0,CITY}, {185.0,10.0,CITY}, {280.0,10.0,CITY}, {320.0,5.0,CITY}, {360.0,5.0,CITY}, {460.0,5.0,CITY}, {230.0,13.0,CITY}, {405.0,15.0,BASE}, {55.0,15.0,BASE} }; @interface BattleView:View { id toButtonMatrix; id outScore; id outMissiles; id toRightMissiles; id levelText; id highScoreTable; DPSTimedEntry gameTimer; float xpos, ypos, rad; BOOL maxReached, playSound, rflag, displayBase1, displayBase2; struct mList { int launched; MSLE_NODE_PNTR next; } defensiveMissiles; struct maList { int launched, splitters; MA_NODE_PNTR next; } offensiveMissiles; struct eList { int exploding; EXP_PNTR next; } defensiveExplosions, surfaceExplosions; struct bList { int launched, bombs; NXPoint hotspots[5]; NXPoint destPos, currentPos, bombPos; float delta_x, delta_y; } bomber; struct smartList { int launched; SMART_NODE_PNTR next; } smartBombs; BOOL cityStatus[CITIES]; int phaseOne, startNewGame, gameRunning, gamePaused, gameLevel; int activeCities; float dFactor; /* difficulty factor speed of attack missiles */ unsigned int aTimeBefore; id cursorImage; int score, missiles1, missiles2, lastBonusAt; id cityBitmap; id launcherBitmap; id bomberBitmap; id smartbombBitmap; NXRect cBounds; SoundEffect* redAlertSound; SoundEffect* exploSound; SoundEffect* surfExploSound; SoundEffect* launchSound; SoundEffect* countCitySound; SoundEffect* countRocketSound; SoundEffect* smartBombSound; SoundEffect* emptyBaseSound; SoundEffect* missileAlertSound; SoundEffect* bonusCitySound; } - initFrame:(const NXRect *)frm; -newGame:sender; -showHighs:sender; -pauseGame:sender; -resetCursorRects; -drawSelf:(const NXRect *)r :(int)c; -mouseDown:(NXEvent *)theEvent; - (void) airExplosionAt:(NXPoint*)p withRadius:(float)r; - (MA_NODE_PNTR) addToIncoming:(NXPoint)startPoint :(int)number :(MA_NODE_PNTR) next; - (void) airExplosionAt:(NXPoint*)p; - (void) surfaceExplosionAt:(NXPoint*)p; - (void) surfaceExplosionsDraw; - (void) expDraw; - (void) doBomber; - (void) doSmartBomb; - (void) missilePath; -newGame:sender; -switchSound:sender; - (void)step; - (void)drawCityBM:(NXPoint)dcPt; - (void)drawLaunchPad; - (void) attackMissilesPath; -nextLevel; -bonusPoints; -selectTargets; @end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.