// BLOWN EYE was designed by Impression89 and this is the end my only friend ..

#include <math.h>
#include <sound.h> 
#include <CursorDevices.h>

#include <Types.h>
#include <Memory.h>
#include <Quickdraw.h>
#include <OSEvents.h>
#include <Desk.h>
#include <Events.h>
#include <StandardFile.h>
#include <Resources.h>
#include <Windows.h>
#include <Fonts.h>
#include <TextEdit.h>
#include <Menus.h>
#include <Dialogs.h>
#include <ToolUtils.h>
#include <Sound.h>
#include <AIFF.h>

#include <Gestalt.h>

/* MUSIC IS ON */
#include <QuickTimeComponents.h>
#include <Components.h>

#include "Hollywood.h"
#include "Hollywood.c"

enum
{
	kWaitIfFull = true,
	kSoundComplete = 1
};


/* Constants */

#define kSleep		5
#define BallWidth		20
#define BallHeight		20
#define BobSize			8		/* Size of text in each ball */
#define SHOWX		    10
#define SHOWY           10 
/* Globals */
#define			NUMSTRS 20					/* number of strings in dialog	 */
#define			SCROLLDELAY 10000			/* to slow down scrolling a little*/
#define         TIL 0L
#define         Tex "\p ANOTHER SCROLLTEXT"
/* MUSIC */
#define kStereoPanCount		30		// the amount of change during a stereo pan
#define kStereoDelay		4L		// amount of ticks to pass before changing the stereo position
#define kPanVoice			1		// which voice to work with durning the pan test

/* SCROLL.h  */
#define windowID    128
#define ErrorAlert  256
#define AdviseAlert 257

#define appleID 1958
#define fileID  1959
#define editID  1960
#define DialogID 1961

#define undoCommand   1
#define cutCommand    3
#define copyCommand   4
#define pasteCommand  5
#define clear Command 6

#define appleM  0
#define fileM   1
#define editM   2
#define dlogM   3

/* WICHTGES */
// MIDIMUSIC AVAIBLE (QUICKTIME INSTALLIERT ?)
int quicktimei=0; /* LADEN DER MUSIC mit PICTURTE !! ANZEIGEN */
int mus=0;
 // vorhanden
int CHEAT		   = 0;  /* CHEAT MODUS */
int speedv=5,speedvv=4;

/* GLOBAL VARIABLES */
int schiessz=80; //wie oft soll geschossen werden ?
int vulkanz=15;


int easy=0,easyz=0;       // EASY TO GO
int flugge=4;       // Fluggeschwindigkeit
long speedl,lau,speedt=4;  // DER SPEED DES DREHENS !!
short refnum,refnumm;
long sc[11]={110810,74390,59860,18840,18080,10420,6480,4920,3140,2960};
char nm[11][10]={{"   KGB    "}, // DEFAULT SCORE
                   {"IMPRESSION"},
                   {" SIMON  D "},
                   {"    ADI   "},
                   {" ROBERTO  "},
                   {" NAMELESS "},
                   {"  PRESOLE "},
                   {" NOT EASY "},
                   {"SECOND TRY"},
                   {"FIRST  TRY"},
                   {" OH NO NO "}};     
int  lv[11]={41,31,26,12,9,9,7,5,4,3};
  /* ABSPEICHERUNG */
  int beginz=0,timesp=0,musicf=0,aru,aruu,bru,bruu;

/* FOR MOUSE CONTROL */
Point integerPosition, position;	/* The position of our object, in integer and fixed-point*/
Point centerOfScreen;			/* The center of the screen*/
Point theMouse;					/* A Point that we get the mouse position in*/
Rect drawingRectangle;			/* A rectangle used for drawing*/
//Point speed;					/* The accumulated speed*/


CGrafPtr        bsack, muriel, anima,nima;
EventRecord		myEvent;
DialogPtr		myWindow;					/*ptr to the dialog window*/
WindowPtr 		EvWindow;					/* Event window*/
WindowPtr       firstWin,firstWn;
MenuHandle		myMenus[4];
Rect	windRect,rec,maxrec,trec;
SndChannelPtr sndc0,sndc1,sndc2,sndc3;
EventRecord	theEvent;
KeyMap theKeys;
Rect tect;
long seg,vol;
char coden[11]={"          "};          
char codet[11]={"          "};          
char codel[11]={"          "};
long senum,before;
  
int test=0; // TEST==0 -> ORGINAL
int VERSION=1; //VOLLVERSION

 // kontroll =1
int kontrol=1,auswt=1,nt,clerk=0;
int retus[200][30]; //21 22 Zhler 23  maximum 25
int les[500][10];
long rt;
int rtz,endef=0;
SoundVolume nv;

 
/* MUSIC */
// Variables
static Boolean		appDoneFlag;
static Boolean		movieInProgress;
static WindowPtr	theMovieDisplayWindow = NULL;
static Movie		theMovie;

static char		theDate[] = __DATE__;
static char		theTime[] = __TIME__;

static Boolean		processStereoPan;
static short int		stereoPos, stereoDirection;
static long			lastProcessTick;
OSErr			theErr,theError;
long 			result;

SndChannelPtr mySndChannel;
int		sndProgress,alt,ru,ruu,aint,aaint;
char txt[30]="CODE AND DESIGN BY IMPRESSION";
char tot[10]="          ";
char txl[54]="MACINTOSH NORMAL VERSION    SMILE TO BANDIT  I SAW YOU";
GDHandle         thisGDevice;

TEHandle		theText;						/* Handle to the text edit record */
	
/* Prototypes */
void Initialize(void);
void NewBall(void);
void CreateOffScreenPixMap (Rect *theRect, CGrafPtr *offScreen);
void CreateOffscreens (void);
void KillOffScreenBitMap (GrafPtr offScreen);
short RandomInt (short range);
int Buttan(void);

Boolean SndChannelBusy(SndChannelPtr sndChannelP);
OSErr InstallSoundCallBack(SndChannelPtr sndChannelP);
Handle  GetSoundResource(
	short soundResourceID,
	OSErr* err);

void CreateOffScreenBitMap (Rect *theRect, GrafPtr *offScreen); 
unsigned short GetRandom(unsigned short min, unsigned short max);
void HideMenuBar(GrafPtr grafPort);
void ShowMenuBar(GrafPtr grafPort);
void CenterRect(
	Rect* srcRect,
	Rect* dstRect);
void checksum(void);
void KillOffScreenPixMap (CGrafPtr offScreen);
extern pascal UniversalProcPtr NGetTrapAddress(short trapNum, TrapType tTyp);
static void SetMouse(Point newMousePosition);
// Functions
static void StartQuickTimeMovie(void);
static void ProcessQuickTimeMovie(void);
static void EndQuickTimeMovie(void);

static void StartQuickTimeMovie(void)
{
	SFTypeList		theTypeList;
	
	short int 			myRef;
	Rect				wRect;
	FSSpec			theMidiFile;
	StandardFileReply theReply= 
	{  1,
	   0,
	   1299148630,
	   {-2,
	   42272,
	   "\pMSX"},
	   0,
	   256,
	   0,
	   0,
	   0,
	   0 };
  

	if (movieInProgress)
	{
		EndQuickTimeMovie();
		movieInProgress = FALSE;
	}
	theTypeList[0] = MovieFileType;
	theTypeList[1] = 'Midi';
    
//    theErr=FSMakeFSSpec(0,0,"\pMSXT.MSX",&theMidiFile);
   	if (mus==0) theErr=FSMakeFSSpec(0,0,"\pMSXT.MSX",&theMidiFile);
   	if (mus==1) theErr=FSMakeFSSpec(0,0,"\pMSX0.MSX",&theMidiFile);
   	if (mus==2) theErr=FSMakeFSSpec(0,0,"\pMSX1.MSX",&theMidiFile);
   	if (mus==3) theErr=FSMakeFSSpec(0,0,"\pMSX2.MSX",&theMidiFile);
   	if (mus==4) theErr=FSMakeFSSpec(0,0,"\pMSX3.MSX",&theMidiFile);

		/* initialize movie toolbox */
		theErr = EnterMovies();
		if (theErr == noErr)
		{
			if (theReply.sfType == 'Midi')
			{
			};
					
			if ( (theErr == noErr) && (OpenMovieFile(&theMidiFile, &myRef, fsRdPerm) == noErr) )
			{
				if (NewMovieFromFile(&theMovie, myRef, NULL, NULL, newMovieActive, NULL) == noErr)
				{
					/* Find out the size of the movie. */
					GetMovieBox (theMovie, &wRect);
					
					/* If the movie has no video, don't display any window. */
					if (wRect.bottom)
					{
						wRect.top += 48;
						wRect.left += 48;
						wRect.bottom += 48;
						wRect.right += 48;
						theMovieDisplayWindow = NewCWindow (NULL, &wRect, "\pMovie Window", TRUE, plainDBox,
										(WindowPtr) -1L, TRUE, 0);
						SetMovieGWorld (theMovie, (CGrafPtr) theMovieDisplayWindow, 0);
					}
				
					/* Tell QuickTime we're playing from the beginning. */
					GoToBeginningOfMovie(theMovie);
					PrerollMovie(theMovie, 0, 0x10000);
					
					/* Start playing forward. */
					StartMovie(theMovie);
					movieInProgress = TRUE;
				}
				CloseMovieFile(myRef);
			}
		} else { quicktimei=0; musicf=0; };
}

static void ProcessQuickTimeMovie(void)
{
	if (movieInProgress)
	{
		if (IsMovieDone(theMovie))
		{

					GoToBeginningOfMovie(theMovie);
					PrerollMovie(theMovie, 0, 0x10000);
					
					/* Start playing forward. */
					StartMovie(theMovie);
					movieInProgress = TRUE;
			
//					EndQuickTimeMovie();
		}
		else
		{
			/* Your event loop should call MoviesTask very regularly for smooth playback.
			   The second parameter to MoviesTask is the maximum number of milliseconds
			   QuickTime may use when playing multiple movies.  Pass 0 to allow QuickTime
			   to service every movie properly. */
			MoviesTask(theMovie, 0);
		}
	}
}

static void EndQuickTimeMovie(void)
{
	if (movieInProgress)
	{
		/* Throw away the window if there was one. */
		if (theMovieDisplayWindow)
		{
			DisposeWindow(theMovieDisplayWindow);
			theMovieDisplayWindow = NULL;
		}
		/* Make this call to free up resources used by QuickTime and the movie. */
		DisposeMovie(theMovie);
		movieInProgress = FALSE;
		ExitMovies();
	}
}



static void PlayQuickTimeNotes(void)
{
	NoteAllocator theNoteAllocator;	/* The music note allocator component */
	NoteChannel myNoteChannel;		/* A channel to play notes through */
	NoteRequest myNoteRequest;		/* A structure describing the instrument we want to play */
	short int i, velocity, instrument_index;
	unsigned long current_tick_count;
	/* This is a list of General MIDI instrument numbers we want to play. */
	static int instrument_list[6] = {1, 5, 7, 8, 12, 13};

	/* Open the note allocator component */
	theNoteAllocator = OpenDefaultComponent(kNoteAllocatorType, 0);

	/* Walk through our list of available instruments. */
	for (instrument_index = 0; instrument_index < 6; instrument_index++)
	{
		/* Set up a NoteRequest structure with a request for a piano with polyphony of 1. */
		myNoteRequest.polyphony = 1;
		myNoteRequest.typicalPolyphony = 1<<16;
	
		/* We can request a specific instrument by name.  If it's not found, the gmNumber field
		   provides the General MIDI fallback instrument. */
		myNoteRequest.tone.synthesizerType = 0;
		myNoteRequest.tone.synthesizerName[0] = 0;
		myNoteRequest.tone.instrumentName[0] = 0;
		myNoteRequest.tone.instrumentNumber = 0;
		myNoteRequest.tone.gmNumber = instrument_list[instrument_index];
	
		/* Allocate a note channel with our desired instrument as filled out in the NoteRequest */
		NANewNoteChannel(theNoteAllocator, &myNoteRequest, &myNoteChannel);
		
		/* Load the resources needed by the instrument */
		NAPrerollNoteChannel(theNoteAllocator, myNoteChannel);
	
		/* Perform a loop, playing notes at increasing pitch and velocity, using TickCount()
		   as a timebase.  You can play notes at interrupt time, so you can schedule note
		   events with the Time Manager, or through your own schemes. */
		current_tick_count = TickCount() + 6;
		for (i = 32; i < 90 && Button() == false; i += 3)
		{
			velocity = i + 10;
			/* Play the Note */
			NAPlayNote(theNoteAllocator, myNoteChannel, i, velocity);
			
			/* Wait awhile */
			while (current_tick_count > TickCount()) {};
			current_tick_count += 6;	/* Prepare to do this again in another 1/10th-second. */
			
			/* Stop playing the note. */
			NAPlayNote(theNoteAllocator, myNoteChannel, i, 0);
		}

		/* Wait for the last note to decay away to silence. */
		current_tick_count += 20;
		while (current_tick_count > TickCount()) {};
	
		/* Dispose the note channel when we're done with it. */
		NADisposeNoteChannel(theNoteAllocator, myNoteChannel);
	}
	CloseComponent(theNoteAllocator);
}


static void FilePlayCallback(short int voiceNumber, short int what, long userData)
{

}

/*
static void PlayFile(void)
{
	OSType	types[2];
	FSSpec	theFile;
	OSErr	theErr;

	types[0] = AIFFID;		// from AIFF.h
	types[1] = AIFCID;		// from AIFF.h

	if (GetReadFileName((char *)theFile.name, &theFile.vRefNum, types, 2))
	{
		theFile.parID = 0;
		theErr = HY_StartFilePlay(kPanVoice, &theFile, FilePlayCallback, 0, 40000L, TRUE);
	}
}



static Boolean GetReadFileName(char *pName, short *pVRef, OSType *pType, short typeCount)
{
	static Point anchor = {100, 7};	
	SFReply reply;

	SFGetFile(anchor, NULL, NULL, typeCount, pType, NULL, &reply);

	if (pType)
	{
		pType[0] = reply.fType;
	}
	BlockMove((void *)reply.fName, pName, 63L);
	*pVRef = reply.vRefNum;
	return(reply.good);
} 

static Boolean GetWriteFileName(void *pName, short int *pVRef, void *pSaveText)
{
	static Point anchor = {50, 105};	
	SFReply reply;

	SFPutFile(anchor, (ConstStr255Param)pSaveText, (ConstStr255Param)pName, NULL, &reply);
	if (reply.good == FALSE)
	{
		return(FALSE);	
	}
	
	*pVRef = reply.vRefNum;
	BlockMove(reply.fName, pName, 63L);
	return(TRUE);
} */

// 
//	Main body of program SillyBalls
//

//MW specified argument and return type.
void main(void)
{
	Initialize();
	
	//do {
		NewBall();
	//} while (!Button());
	
}

// 
//	Initialize everything for the program, make sure we can run
//

//MW specified argument and return type.
void Initialize(void)
{
	WindowPtr	mainPtr;
	OSErr		error;
	SysEnvRec	theWorld;
		

	error = SysEnvirons(1, &theWorld);
	if (theWorld.hasColorQD == false) {
		SysBeep(50);
		ExitToShell();					/* If no color QD, we must leave. */
	}
	
	/* Initialize all the needed managers. */
	InitGraf(&qd.thePort);
	InitFonts();
	InitWindows();
	InitMenus();
	TEInit();
	InitDialogs(nil);
	InitCursor();

	GetDateTime((unsigned long*) &qd.randSeed);


	windRect = qd.screenBits.bounds; // absolute Grsse !!
	

}


void NewBall(void)
{  PixPatHandle u2,leerw,leerwa,leers,leerspec,leerg,leerl,lee,le,hint;
   Rect roi,rec,re,ri,ro;
   PicHandle apple,pple,lep,por[40];
   EventRecord eventRec; 
   Handle gerausch;
   short refnum;
   short refnumII;
   SFReply  reply;
   SFReply  replyII;
   EventRecord evt;
   		
   int enl,levnt,ii=0;
   RGBColor col[8];
   Ptr  soptr[10];
   int infozlr,block,doit;
   int  toota[400][8];
   int lz,tootazlr;
   int ret,waitus,zaniz; 
   int fay=7;
   RgnHandle  ha;  
   PolyHandle pol;
    
    int smbomb=0;
    double wia,wib;
    int winl,winll;
    int win5;
    int p, wieder, showc;
    int steinw;
    int  time=0,timed,timezlr,timey; 
   int schppx,schppy;  
   int obenx,obeny;
    int handx,handy;
   int  batgo,pacgo,puatx,puaty,puax,puay;
                                               
   int tscroll=50; // von 50 - 0
   int tnom=10,trol;
   int spritezlr,ql=0;
                                       
   int sx,sy,grx,gry;
   int zg_gameover,zg_didit,zg_score;
   long score,bcore;
   int untenz, noup,aa;
   int steinu,z,az ,power,iii;
   
   int steinz,spiegel,abweich;
   int untenx,unteny;
   int schp,schpx,schpy,schpzm,schpz;
   /* HORMONE */
   int zg_spiel,zg_unten;  
   long inz;
   int klox,quit,in,scrl;
   int obz1,obz2;
   int taz,tax,tay;
   int zani;
   /* SOUND */

	Str255	tempStr;
	
   long bietes;
   long qr;
   char c;
     
   int q,qq,trq,shz;
    int mx,my,qx,qy,qz,ox,oy,level;  
     
   int txtz,txtx,txty,tdx,dx,dy; 
   int abbruch=0,b,bb,bbb;
   int mix,miy,ba,bba,bbba,lv3[5][4];
   
   int wox=50,woy=50,wtx,wty,w,ww,ui,uii,as;
   Point pix,pax;

   
  int plx,timex;
  
  /* eingabe */
  int eingz=0;
  char eingn[10]="         ";
  char eingc=' ';
  long sc[11]={417250,308125,202225,3000,2000,1000,1000,4000,3000,2000,1000};
  char nm[11][10]={{" R TYPE   "}, // DEFAULT SCORE
                   {"NEMESIS   "},
                   {"  X-OUT   "},
                   {"  XENON   "},
                   {" ZYNAPS   "},
                   {"KATAKIS   "},
                   {"          "},  // ab hier nicht mehr wichtig
                   {"CADAVER   "},
                   {"          "},
                   {"DUNGEON   "},
                   {" MASTER   "}};     
  int  lv[11]={41,31,26,12,9,9,7,5,4,3},breite;
  
  
  
  // Handle  
   //SndList
   SndListHandle click,menuclick,sbo,sndstart,sndelec,begin,bye,hinter[7],all[14],sndschussm,sndexab,sndhi,sndver,sndange,sndzgsc;
   SndListHandle shoot,sndextra,sndlastlive,sndelev,sndspz,sndwar,sndrot,sndeelev,sndsh;
   SndListHandle sready,sgamo,slevco,sworco,spause;
   SndListHandle swoop0,swoop1;
   Handle hick;				
    int sidus[100][4];
    int fieeldx,fieeldy,quark,quarkk,rrst=0;  
    int live,inzest,zuf,hf=0;
    int speed,sped,tz, gemenu ; 
    PolyHandle roe;
   long thisA5,gameA5;
 
   int spee,ift,gascr=0,penda,pendb;
   int winkelmax=37;
   int winkeljet=18;
   int slx,sly,szux1,szux2,szuy1,szuy2;
   int winkx,winky,winkax,winkay,lx,ly,Herr,zz;
   int steuerung,ix,iy,px,py,fuckvx1,fuckvy1,fuckvy2,fuckvx2;                 
   int stax,stay,stx,sty,uiox;
   int sctxt,o,oo;
   long hgc;
   int absx,absta,absvx,absvy,quick,r;
   int gelesen[6],telesen[6], kugela,farben[10];
   int shieldz;
  long absy; 
  int weiter,qw;
  int  ooo,zlr ;  
  int menu,obert;
  long adr; 
  int tox,toy,zulo,zulozlr;
   double sd1,sd2,ast,ac;
   int rrr;
   RGBColor cPix;
   int krox,tode,super,freezezlr,holdzlr,tr,trr;
   int rr,rad,l;
   int zux1,zuy1,zux2,zuy2,a;
   double d1,d2;
   int scorex,scorey,bl,blz,blx,bly,dozg,dozgg;
   int gleiches[120][3];
   int gleichesa,gleichese;
   int PAUD=0;
   int handbx,handby,hcf;
   int scz,ozlr,zanii;
   Rect  ref;
   CIconHandle   ic0;
   int anzahl,blockz,uros; 
   int zu,tez,vr,vrr;
   Point mousepix;
   CCrsrHandle cune[10];
   long zxx,qqr,zzz;
  char name[10]={"          "};
  char tame[10]={"          "};
  Point newp;

   int wasser,zuto,leet;

   int scrollz, scrollx,sctxtz;
   int eing,er;
   int akp=0,akpz=0;

/* TIME PROBLEME */
	long	beforeTime, afterTime;
	long	loop;


  int sir=0,sirz=0,nx1=170,nx2=234,nx3=310,nz1=0,nz2=0,nz3=0,nz4=0,nwi;
   int i,u,x,y,ax,ay,tx,ty,up;
   int rex,rey,kx,ky,kkx,kky,pp,shield,shieldzlr,side,back,wide;
   PixMapHandle screenpMapH;
   short thePixelDepth;

   int ani;
   SndCommand theCommand;
   long soundDataSize;
   OSErr theErr;
   Ptr theSoundData[10];    

   /* FILE */



   
   thisGDevice = GetMainDevice(); 
   

/* INSTALL CHEAT ? -- I am anfang drcken */
  GetKeys(theKeys);
  if (BitTst(&theKeys,37)==true) CHEAT=1;
  

/* ============== OFFSCREENS   =============== */   
  CreateOffscreens ();
 


/* ==================SOUNDINIT===================== */
InstallSoundCallBack(sndc0);
InstallSoundCallBack(sndc1); 
InstallSoundCallBack(sndc2);
InstallSoundCallBack(sndc3);
   
 SndNewChannel(&sndc0,sampledSynth,initMono,NULL);
 SndNewChannel(&sndc1,sampledSynth,initMono,NULL);
 SndNewChannel(&sndc2,sampledSynth,initMono,NULL);
 SndNewChannel(&sndc3,sampledSynth,initMono,NULL);
   
/* pascal OSErr SndStopFilePlay(SndChannelPtr chan,Boolean async) */
  
/* ==================INIT===================== */
/* QUICKTIME INSTALLIERT ? */
theError=Gestalt(gestaltQuickTime,&result);
i=(int) result;
 quicktimei=0;  // please install QuickTime 
  musicf=0; 
  
if (theError==noErr)  
{ result >>=16L;
  if (result >= 0x200L) 
  {
  quicktimei=1;  //  installed QuickTime 
  musicf=1; };
};

/*
quicktimei=0;
musicf=0; */

/* ================== PATTERN =============== ====== */
   leers=GetPixPat(1);  /* schwarz bzw weisser HIntergrund */
   leerw=GetPixPat(0); 
   hint=GetPixPat(128);    
   lee=GetPixPat(128); 
   leerspec=GetPixPat(2); 
   leerwa=GetPixPat(3); 
   u2=GetPixPat(128); 
/* ================== WINDOW ===================== */

 firstWn=GetNewCWindow(129,TIL,(WindowPtr)-1L);
 
   SelectWindow(firstWn); 
   SetPort(firstWn);    
   OpenCPort((CGrafPtr) firstWn);


 

	rec = qd.screenBits.bounds; // absolute Grsse !! neu ausrechnen
	maxrec = qd.screenBits.bounds;	

// minimale Auflsung else print something
//if (rec.right>640)  {
  aint=(rec.right-640)/2;
  aaint=(rec.bottom-480)/2;
	SetRect(&rec,aint,aaint,rec.right-aint,rec.bottom-aaint );
    firstWin = NewCWindow(nil, &rec, "\pImp89", false, documentProc, 
						(WindowPtr) -1, false, 0);


    // SetOrigin(100,100);


/* ================== HIDE ===================== */
   HideMenuBar((GrafPtr) firstWin);
   HideCursor();

    SetPort((GrafPtr) firstWn);
    SetRect(&ref,0,0,maxrec.right,maxrec.bottom);
    FillCRect(&ref,leers);

/* LOADING =========================== */
                                                   GetVol(NULL,&reply.vRefNum);
                                                   FSOpen("\pSCOT",reply.vRefNum,&refnum);

                                                   bietes=sizeof(long)*11 ;
                                                   FSRead(refnum,&bietes,&sc[0]); // ANDERES !!

                                                   bietes=sizeof(char)*11*10 ;
                                                   FSRead(refnum,&bietes,&nm[0][0]); // ANDERES !!

                                                   bietes=sizeof(int)*11 ;
                                                   FSRead(refnum,&bietes,&lv[0]); // ANDERES !!


                                                   FSClose(refnum);
   
/* ================== HIDE ===================== */
/* LADEN DER MUSIC mit PICTURTE !! ANZEIGEN */
if (musicf==1)
if (quicktimei==1) {
	theErr = HY_Setup(kUseStereo, 3);
	appDoneFlag = FALSE;
	processStereoPan = FALSE;
	movieInProgress = FALSE;

    SetPort((GrafPtr) firstWin);
 
    apple=GetPicture(133);
    SetRect(&rec,0,200,640,220);
     HUnlock((Handle) apple);
    DrawPicture(apple,&rec);               
    ReleaseResource((Handle) apple);  
    
    mus=0;
    
    StartQuickTimeMovie();
    

    /* LAUTER WERDEN 
   ii=0;
   for (i=0;i<=25;++i) {
    nv.right=ii;
    nv.left=ii;
    for (q=0;q<8;++q) 
     HY_SetVolume(q,nv);
     ii=ii+10;
    lau=TickCount();
    do {
    	HY_ServiceTasks();
		ProcessQuickTimeMovie();  
    } while((lau+10)>TickCount());
   };  */
    
     } else {
     
    SetPort((GrafPtr) firstWin);
 
    apple=GetPicture(134);
    SetRect(&rec,0,200,640,220);
     HUnlock((Handle) apple);
    DrawPicture(apple,&rec);               
    ReleaseResource((Handle) apple);  
     
       
     
     };


      
    
      shoot=(SndListHandle) (
       GetIndResource(
       soundListRsrc,
       506
       ));
      click=(SndListHandle) (GetResource(soundListRsrc,120)); 
      menuclick=(SndListHandle) (GetResource(soundListRsrc,142)); 
      sbo=(SndListHandle) (GetResource(soundListRsrc,505)); 
      bye=(SndListHandle) (GetResource(soundListRsrc,121));
      begin=(SndListHandle) (GetResource(soundListRsrc,512));
      sndlastlive=(SndListHandle) (GetResource(soundListRsrc,514));
      sndextra=(SndListHandle) (GetResource(soundListRsrc,515));
      sndelev=(SndListHandle) (GetResource(soundListRsrc,517));
      sndspz=(SndListHandle) (GetResource(soundListRsrc,518));
      sndwar=(SndListHandle) (GetResource(soundListRsrc,519));
      sndrot=(SndListHandle) (GetResource(soundListRsrc,520));
      sndeelev=(SndListHandle) (GetResource(soundListRsrc,521));
      sndschussm=(SndListHandle) (GetResource(soundListRsrc,523));
      sndexab=(SndListHandle) (GetResource(soundListRsrc,522));
      sndhi=(SndListHandle) (GetResource(soundListRsrc,524));
      sndver=(SndListHandle) (GetResource(soundListRsrc,525));
      sndsh=(SndListHandle) (GetResource(soundListRsrc,526));
      sndange=(SndListHandle) (GetResource(soundListRsrc,527));
      sndzgsc=(SndListHandle) (GetResource(soundListRsrc,528));
      sndstart=(SndListHandle) (GetResource(soundListRsrc,2000));
      sndelec=(SndListHandle) (GetResource(soundListRsrc,2001));
     
      swoop0=(SndListHandle) (GetResource(soundListRsrc,529));
      swoop1=(SndListHandle) (GetResource(soundListRsrc,530));

      sready=(SndListHandle) (GetResource(soundListRsrc,134));
      sgamo=(SndListHandle) (GetResource(soundListRsrc,135));
      slevco=(SndListHandle) (GetResource(soundListRsrc,136));
      sworco=(SndListHandle) (GetResource(soundListRsrc,137));
      spause=(SndListHandle) (GetResource(soundListRsrc,138));


 //     for (i=0;i<8;++i) hinter[i]=(SndListHandle) (GetResource(soundListRsrc,100+i));
      for (i=0;i<14;++i)  all[i]=(SndListHandle) (GetResource(soundListRsrc,500+i)); 

// der eingangssound
//        SndPlay(sndc0,sndstart,TRUE);

   // die Farben fr den Sternenhimmel
   SetPort((GrafPtr) nima);
   SetRect(&rec,0,0,8,4);
   FillCRect(&rec,leerspec);
   for (i=0;i<=7;++i)
    GetCPixel(i,0,&col[i]);



/* ================== APPLE FIRST ===================== */
    SetPort((GrafPtr) firstWn);


    SetRect(&rec,0,0,maxrec.right,maxrec.bottom);
    FillCRect(&rec,leers);
    // evtl anderes Muster nach dem Titelbild


    SetPort((GrafPtr) firstWin);

/* PIXEL DEPTH ENOUGH ? */
  screenpMapH=
     (**thisGDevice).gdPMap;
 thePixelDepth=
    (**screenpMapH).pixelSize;
 
if (thePixelDepth==8) ;
  
  else
 {   SetPort((GrafPtr) firstWin);
 
    apple=GetPicture(50);
    SetRect(&rec,220,140,420,340 );
     HUnlock((Handle) apple);
    DrawPicture(apple,&rec);               
    ReleaseResource((Handle) apple);  
   
    do ; while (Button()==false);
    
    ExitToShell();	
    
     };
    
     
   if (test==0)
   {

 


/* =====================================TITELBILD============================== */ 
beforeTime = TickCount();

 SetPort((GrafPtr) firstWin);
/* EINBLENDEN */
for (i=3;i>=0;--i) {
               apple=GetPicture(60+i); 
               SetRect(&rec,0,150,640,150+154 );
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  
    
    do ; while (TickCount()<beforeTime+7);
    beforeTime=TickCount();
  };

// hier
 /////// evt auf Sound 2 .... !!!! 
 // verschiedene Einblendungen CODING ETC
   i=0; ii=39; a=20;

		

              SetPort((GrafPtr) firstWin);              
              
before=TickCount();	
   do {
    
   if (musicf==1)
    if (quicktimei==1) {
		HY_ServiceTasks();
		ProcessQuickTimeMovie(); };
   
   // music  

    
   if (TickCount()>(before+a)) {
                before=TickCount();
                i=0;
                ++ii; if (ii>58) ii=40;
                if (ii==50) ii=51;

               SetPort((GrafPtr) firstWin);              
               apple=GetPicture(ii); 
               SetRect(&rec,80,250,280,300 );
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  


        a=7;
       };
          
   } while (Button()==false);

/* AUSBLENDEN */
beforeTime=TickCount();
for (i=0;i<=3;++i) {
               apple=GetPicture(60+i); 
               SetRect(&rec,0,150,640,150+154 );
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  

   do ; while (TickCount()<beforeTime+7);
   beforeTime=TickCount();
  };

//if (quicktimei==1) StopMovie(theMovie);



  };



   
   /* NOCH EIN BISSCH EN SPEICHER */
    soptr[0] = NewPtr(sizeof(char)*5000*2* 10) ;
        for (i=1;i<=9;++i)  soptr[i] = soptr[i-1] +sizeof(char )*5000*2;
    

 // DIE ZACKEN FUER WENIGER ALS 640x480
    i=(maxrec.right-640)/2;
    ii=(maxrec.bottom-480)/2;
if (i>0) { 

  };            


 
/* ================== MOUSEINIT ===================== */
    gemenu=6; /* NEUEINTRITT */
   
   

 
    sctxt=1;     
   while (gemenu!=5)  // die letzte grosse Schlaufe 
   {
    do {   

   // music  
  //ret if (musicf==1)
    if (quicktimei==1) {
		HY_ServiceTasks();
		ProcessQuickTimeMovie(); };

    
            /* NEUEINTRITT */
            if (gemenu==6) 
            {   before=TickCount();
            
               SetPort((GrafPtr) firstWin);
               SetRect(&rec,0,0,640,480);
               FillCRect(&rec,leers);
               
               SetPort((GrafPtr)  muriel); // muriel ?
               
               SetRect(&rec,0,0,640,400);
               FillCRect(&rec,leers);

               
               apple=GetPicture(256);
               SetRect(&rec,0,0,640,400);
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  


               SetRect(&rec,0,10,640,25);
			   FillCRect(&rec,leers);
			   
               apple=GetPicture(199);
               SetRect(&rec,0,10,640,18);
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  
                              


               
				 SetRect(&re,0,0,640,400);    // ABOUT
                 SetRect(&ri,0,40,640,440);
				 CopyBits(&((GrafPtr)  muriel )->portBits,&(((GrafPtr)  firstWin)->portBits),&re,&ri,srcCopy, 0L);                      

               SetPort((GrafPtr)  firstWin); // muriel ?
            if (musicf==1)
             if (quicktimei==1) {
               apple=GetPicture(132); 
               SetRect(&rec,0,440,640,480);
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  };

 /* AKTIVIERTE MENUPUNKTE */
 SetPort((GrafPtr) bsack);
               akp=0;
               akpz=10;
               apple=GetPicture(255); 
               SetRect(&rec,2560-640,0,2560,400 );
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  



 /* hier */
 SetPort((GrafPtr) firstWin);
                apple=GetPicture(135); 
               SetRect(&rec,230,50+40,471,291+40 );
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  


 /* SEitenRAND */

    
   if (maxrec.right>640) {
    i=(maxrec.right-640)/2;
    ii=(maxrec.bottom-480)/2;

  /*   SetPort((GrafPtr) firstWn); apple=GetPicture(189);
     SetRect(&rec,i-96,ii+40,i,ii+440);
   
             HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  

     apple=GetPicture(189);
     SetRect(&rec,640+i,ii+40,640+i+96,ii+440);
  
             HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  */
 
 
   
                }
   
 /* <----DER OBERE RAND */   
       
        
         // Animationkit
         SetPort((GrafPtr) bsack);
         zani=8+3;
         zanii=0;

         for (i=0;i<=zani;++i)
         {
               SetRect(&rec,i*100,0,i*100+100,100);
                 SetRect(&ri,44,80-40,144,180-40);
				 CopyBits(&((GrafPtr)  muriel)->portBits,&(((GrafPtr)  bsack)->portBits),&ri,&rec,srcCopy, 0L);                      
		  };
         
         for (i=0;i<=zani;++i)
         {
               apple=GetPicture(147+i);
               SetRect(&rec,0,100,142,200);
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  


               SetRect(&rec,20,100,140,200);
               SetRect(&ri,i*100,0,i*100+100,100);
				 CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  bsack)->portBits),&rec,&ri,36, 0L);                      
		  };


               

                         
            leet=0;   
               

               cune[0]=GetCCursor(128); 
               SetCCursor(cune[0]);    
               ShowCursor(); 
               showc=0;
               speed=0;             
               gemenu=0;     

               zaniz=0;
               hcf=0; // HORMON FUER CURSOR

             
             };

/* DER ROTIERENDE WUERFEL */
                zaniz=1;
                if (TickCount()>(before+3))  { before=TickCount(); zaniz=0; };
                if (zaniz==0) ++zanii;
                if (zanii>9) zanii=0;


        /* DER CURSOR IM WUERFEL */
      
         if ((x>(44-16)) && (x<(144+16)) && (y>(80-16)) && (y<(180+16))) {  zanii=(x-24)/((100+32)/zani+1); if (hcf==0)
                                                     { HideCursor(); hcf=1;
               										  
          }; }  else { if (hcf==1) { ShowCursor(); hcf=0; }; };
  

				 SetRect(&re,zanii*100,0,zanii*100+100,100);    // DER WUERFEL
                 SetRect(&ri,44,80,144,180);
				 CopyBits(&((GrafPtr)  bsack )->portBits,&(((GrafPtr)  firstWin)->portBits),&re,&ri,srcCopy, 0L);                      


 
 /* Der HIntergrundsound */ 
 //if  (SndChannelBusy(sndc2)==FALSE) SndPlay(sndc2,(hinter[RandomInt(4)+3]),TRUE);
 
             /* animierter CURSOR */    
                            SetPort((GrafPtr) bsack);

                                                             GetMouse(&mousepix);  
                                                            x=mousepix.h-aint;
                                                            y =mousepix.v-aaint; 
         
            /* SHOW DER HINTERGRUND 

                 GetKeys(theKeys);    
                 if (BitTst(&theKeys,54)==true) {
   
        	        SetRect(&rec,225,317,317,384);
  		        	SetRect(&re,225,317+40,317,384+40);                    
                 
         			CopyBits(&((GrafPtr)  muriel)->portBits,&(((GrafPtr) firstWin)->portBits),&rec,&re,srcCopy, 0L);                              
                 }; */
     /* PREFERENCEN WATERWORLD ETC */
         if (gemenu==2)
          if (Button()==TRUE)
          if ((x>220) && (x<350))
          { i=0;
         
         if (beginz!=0)
          if ((y>100) && (y<125)) { i=1;
            beginz=0;           
          };
          

          
        if (beginz!=1)
          if ((y>125) && (y<150)) { i=1;
            beginz=1;
          };

     
         if ((y>240) && (y<270)) 
         { i=2;
            do ; while(Button()==true);
            if (timesp==0) timesp=1; else
            			   timesp=0;
          };
          
         /* MUSIC */
         if ((y>123+40) && (y<150+40)) 
         { i=2;
            do ; while(Button()==true);
           if (quicktimei==1)
            if (musicf==0) { musicf=1; //StartMovie(theMovie); 
                           } else
            			   { musicf=0; //StopMovie(theMovie);  
            			   };
          };
		
		 // EASY MODE EIN
        if ((y>160+40) && (y<190+40)) { i=2;
          do ; while(Button()==true);   
         if (easy==1) easy=0; 
            else easy=1;
		 
		 };


		if (i==2) {
											if (timesp==0) {
               												SetRect(&rec,0,200,150,230);
                 										    SetRect(&ri,220+0,200+40,220+150,230+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      															
															} else
															{
               												SetRect(&rec,220,200,370,230);
                 										    SetRect(&ri,220+0,200+40,220+150,230+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      
															
															};

											if (easy==1) {
               												SetRect(&rec,0,160,150,190);
                 										    SetRect(&ri,220+0,160+40,220+150,190+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      															
															} else
															{
               												SetRect(&rec,220,160,370,190);
                 										    SetRect(&ri,220+0,160+40,220+150,190+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      
															
															};


											if (musicf==0) {
               												SetRect(&rec,0,123,150,149);
                 										    SetRect(&ri,220+0,124+40,220+150,149+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      															
															} else
															{
               												SetRect(&rec,220,123,370,149);
                 										    SetRect(&ri,220+0,124+40,220+150,149+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      
															
															};


                                         SndPlay(sndc0,menuclick,TRUE);            
															
															
															 };


       if (i==1) {

											if (beginz==0) {
               												SetRect(&rec,220,85,370,110);
                 										    SetRect(&ri,220+0,85+40,220+150,110+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      															
															} else
															{
               												SetRect(&rec,220,60,370,85);
                 										    SetRect(&ri,220+0,60+40,220+150,85+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      
															
															};

											if (beginz==0) {
               												SetRect(&rec,0,60,150,85);
                 										    SetRect(&ri,220+0,60+40,220+150,85+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      

															} else
															{
               												SetRect(&rec,0,85,150,110);
                 										    SetRect(&ri,220+0,85+40,220+150,110+40);
															
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      															
															
															}; 
															
                                         SndPlay(sndc0,menuclick,TRUE);            
                  
         }; // else ein ton ..  
          
       };

/* +++++++++++++++++ Animierte MENUS */
        i=0;
        if ((x>506) && (x<573))
        { if ((y>=(124+40)) && (y<(187+40)))  { akp=7; i=1; }; 
          if ((y>=(187+40)) && (y<(252+40))) {akp=6; i=1; }; 
          if ((y>=(252+40)) && (y<(317+40))) { akp=5; i=1; }; 
          if ((y>=(317+40)) && (y<(384+40))) { akp=4; i=1; }; 
        };
        if ((y>=(317+40)) && (y<(384+40)))
        { if ((x>=225) && (x<317)) { akp=0; i=1; }; 
          if ((x>=317) && (x<381)) { akp=1; i=1; }; 
          if ((x>=381) && (x<447)) { akp=2; i=1; }; 
          if ((x>=447) && (x<510)) { akp=3; i=1; }; 
        };
        
      
        
        if (akp<9)
         if ((akpz!=akp) || (i==0)) {
       /* DAS ALTE */
  	        SetRect(&rec,225,317,317,384);
  			SetRect(&re,225,317+40,317,384+40);	
		if (akpz==1) 
		    { SetRect(&rec,317,317,381,384);
  			   SetRect(&re,317,317+40,381,384+40); };
		if (akpz==2) 
		    { SetRect(&rec,381,317,   447,384);
  			   SetRect(&re,381,317+40,447,384+40); };
		if (akpz==3) 
		    { SetRect(&rec,447,317,   510,384);
  			   SetRect(&re,447,317+40,510,384+40); };
		if (akpz==4) 
		    { SetRect(&rec,510,317,   573,384);
  			   SetRect(&re,510,317+40,573,384+40); };

		if (akpz==5) 
		    { SetRect(&rec,510,252,   573,317);
  			   SetRect(&re,510,252+40,573,317+40); };
		if (akpz==6) 
		    { SetRect(&rec,510,187,   573,252);
  			   SetRect(&re,510,187+40,573,252+40); };
		if (akpz==7) 
		    { SetRect(&rec,510,124,   573,187);
  			   SetRect(&re,510,124+40,573,187+40); };
			CopyBits(&((GrafPtr)  muriel)->portBits,&(((GrafPtr) firstWin)->portBits),&rec,&re,srcCopy, 0L);                      
        }; 

        if (i==0) { akpz=10; akp=10;  };
        
       /* DAS NEUE */
        if (akp<9)
        if (i==1)
         if (akpz!=akp)
         { 
  	        SetRect(&rec,2560-640+225,317,2560-640+317,384);
  			SetRect(&re,225,317+40,317,384+40);	
		if (akp==1) 
		    { SetRect(&rec,2560-640+317,317,2560-640+381,384);
  			   SetRect(&re,317,317+40,381,384+40); };
		if (akp==2) 
		    { SetRect(&rec,2560-640+381,317,   2560-640+447,384);
  			   SetRect(&re,381,317+40,447,384+40); };
		if (akp==3) 
		    { SetRect(&rec,2560-640+447,317,   2560-640+510,384);
  			   SetRect(&re,447,317+40,510,384+40); };
		if (akp==4) 
		    { SetRect(&rec,2560-640+510,317,   2560-640+573,384);
  			   SetRect(&re,510,317+40,573,384+40); };

		if (akp==5) 
		    { SetRect(&rec,2560-640+510,252,   2560-640+573,317);
  			   SetRect(&re,510,252+40,573,317+40); };
		if (akp==6) 
		    { SetRect(&rec,2560-640+510,187,   2560-640+573,252);
  			   SetRect(&re,510,187+40,573,252+40); };
		if (akp==7) 
		    { SetRect(&rec,2560-640+510,124,   2560-640+573,187);
  			   SetRect(&re,510,124+40,573,187+40); };
			CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr) firstWin)->portBits),&rec,&re,srcCopy, 0L);                      

         
         if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,menuclick,TRUE);
                  
          akpz=akp;
         }
        
         /* DAS MENU */
         // ANDERE KOORDINATEN X=X-WOX;
         //                                                  Y=Y-WOY;
          a=gemenu;

 
 
          /* WELCHE DER 3 - KONTROLLE */
         if (kontrol==1)
          if (Button()==TRUE) 
          if ((x>0) && (x<233))
          if ((y>256-24) && (y<256+192-24))
          { ++auswt;
             if (auswt>2) auswt=0;

               SetPort((GrafPtr) firstWin);
               apple=GetPicture(129+auswt);
               SetRect(&rec,0,260+10,201,411+10);
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
        
                                        SetPort((GrafPtr) muriel);
                                        DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  /* + SOUND */  
                                         SndPlay(sndc0,click,TRUE);            
                                        do ;  while (SndChannelBusy(sndc0)==TRUE);
          };
          
         // do ; while (Button()==false);		
          
          i=0;
          if (Button()==TRUE) i=1;
 		  if (hf==1) i=1;

          if (i==1)
          {  	
             if ((y>(6*64-24) ) && (y<(7*64-24))) 
             {  if ((x>(4*64)) && (x<(5*64))) { gemenu=1; live=3; level=0; 
                 
                 if (beginz==0) level=0;
                       else     level=3;
            
            //if (CHEAT==1) {           
                 GetKeys(theKeys);    
                 if (BitTst(&theKeys,84)==true) {c='1'; level=1; };
                 if (BitTst(&theKeys,83)==true) {c='2'; level=2; };
                 if (BitTst(&theKeys,82)==true) {c='3'; level=3; };
                 if (BitTst(&theKeys,81)==true) {c='4'; level=4; };
                 if (BitTst(&theKeys,80)==true) {c='5'; level=5; };
                 if (BitTst(&theKeys,95)==true) {c='6'; level=6; };
                 if (BitTst(&theKeys,94)==true) {c='7'; level=7; };
                 if (BitTst(&theKeys,92)==true) {c='8'; level=8; };
                 if (BitTst(&theKeys,91)==true) {c='9'; level=9; }; 
                 //};

             
             
               };   // PLAY
                if ((x>(5*64)) && (x<(6*64))) 
                if (gemenu!=2)
                { gemenu=2; sctxt=0; 



                											
  											               SetRect(&rec,200,0,500,330);
  											               SetRect(&re,200,40,500,330+40);
													       CopyBits(&((GrafPtr)  muriel)->portBits,&(((GrafPtr) firstWin)->portBits),&rec,&re,srcCopy, 0L);                      
                											
                											SetPort((GrafPtr) anima);

               												SetRect(&re,0,0,272,265);
															FillCRect(&re,leers);
															
                								            apple=GetPicture(201);
               												SetRect(&rec,0,0,150,250);
               												HUnlock((Handle) apple); 
               												DrawPicture(apple,&rec);                
                              								ReleaseResource((Handle) apple);  

															/* VON WO WIRD BEGONNEN */
                								            apple=GetPicture(134);
               												SetRect(&rec,220,0,220+150,250);
               												HUnlock((Handle) apple); 
               												DrawPicture(apple,&rec);                
                              								ReleaseResource((Handle) apple);  

                											SetPort((GrafPtr) firstWin);

               												SetRect(&re,200,70,200+150,70+250);
															FillCRect(&re,leers);

               												SetRect(&rec,0,0,150,250);
                 										    SetRect(&ri,220,40,220+150,40+250);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      

											if (beginz==0) {
               												SetRect(&rec,220,85,370,110);
                 										    SetRect(&ri,220+0,85+40,220+150,110+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      															
															} else
															{
               												SetRect(&rec,220,60,370,85);
                 										    SetRect(&ri,220+0,60+40,220+150,85+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      
															
															};

										// EASY MODE
											if (easy==0) {
               												SetRect(&rec,220,160,370,190);
                 										    SetRect(&ri,220+0,160+40,220+150,190+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      															
															};
															

											if (timesp==0) {
               												SetRect(&rec,0,200,150,230);
                 										    SetRect(&ri,220+0,200+40,220+150,230+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      															
															} else
															{
               												SetRect(&rec,220,200,370,230);
                 										    SetRect(&ri,220+0,200+40,220+150,230+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      
															
															};
                								             //                            SndPlay(sndc0,click,TRUE);            
											if (musicf==0) {
               												SetRect(&rec,0,123,150,149);
                 										    SetRect(&ri,220+0,124+40,220+150,149+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      															
															} else
															{
               												SetRect(&rec,220,123,370,149);
                 										    SetRect(&ri,220+0,124+40,220+150,149+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      
															
															};
					                  
                
                							}; // PREF 
                if ((x>(7*64)) && (x<(8*64))) 
                if (gemenu!=3)     // gemenu==3            
                 { gemenu=3; sctxt=0; 
                											
                											
  											               SetRect(&rec,200,0,500,330);
  											               SetRect(&re,200,40,500,330+40);
													       CopyBits(&((GrafPtr)  muriel)->portBits,&(((GrafPtr) firstWin)->portBits),&rec,&re,srcCopy, 0L);                      

                											SetPort((GrafPtr) anima);
                								            apple=GetPicture(203);
               												SetRect(&rec,0,0,100,296);
               												HUnlock((Handle) apple); 
               												DrawPicture(apple,&rec);                
                              								ReleaseResource((Handle) apple);  

                											SetPort((GrafPtr) firstWin);
               												SetRect(&re,340,50,440,296+60);
															FillCRect(&re,leers);


                 										    SetRect(&ri,350,40,450,296+40);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      

                      SndPlay(sndc1,click,TRUE);

                							   }; // INFO GAME      
 											 };
						 
 /* ====== REGISTRATION ==========================*/
              if (gemenu==3) 
              
              if ((x>(350)) && (x<(430)))
              if ((y>160) && (y<240))
              { gemenu=6;
 

                      SndPlay(sndc1,click,TRUE);
                      do ; while(SndChannelBusy(sndc1)==true); 

              
};

             

              /* EXTRAS */
             if ((x>(444-64)) && (x<(444+71-64))) 
                 if ((y>(383)) && (y<(383+75))) if (gemenu!=8) { gemenu=8; sctxt=1; sctxtz=0; 
                											
                											
  											               SetRect(&rec,200,0,500,330);
  											               SetRect(&re,200,40,500,330+40);
													       CopyBits(&((GrafPtr)  muriel)->portBits,&(((GrafPtr) firstWin)->portBits),&rec,&re,srcCopy, 0L);                      
                											
                											SetPort((GrafPtr) anima);

               												SetRect(&re,0,0,272,265);
															FillCRect(&re,leers);
															
                								            apple=GetPicture(202);
               												SetRect(&rec,0,0,250,300);
               												HUnlock((Handle) apple); 
               												DrawPicture(apple,&rec);                
                              								ReleaseResource((Handle) apple);  


                											SetPort((GrafPtr) firstWin);

               												SetRect(&re,200,50,200+250,50+300);
															FillCRect(&re,leers);

               												SetRect(&re,0,0,250,300);
                 										    SetRect(&ri,220,40,220+250,40+300);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      
                							                  
                 
                 
                                                          SndPlay(sndc0,click,TRUE);            

                 
                 }; 
                 
 /* =============================================================== */
             i=0;
             if ((x>(510)) && (x<573)) 
               if ((y>(317+40)) && (y<(384+40)))  i=1;
             if (hf==1) i=1;
                if (i==1)
                 if (gemenu!=7) { gemenu=7; sctxt=1; sctxtz=0; 
                   // HIGHSCORE 
   HideCursor();
   
   hf=0;
   /* SHOW searchfile */
 

  
  											               SetRect(&rec,200,0,500,330);
  											               SetRect(&re,200,40,500,330+40);
													       CopyBits(&((GrafPtr)  muriel)->portBits,&(((GrafPtr) firstWin)->portBits),&rec,&re,srcCopy, 0L);                      

                											SetPort((GrafPtr) firstWin);
															
                								            apple=GetPicture(143);
               												SetRect(&rec,285,108+40,285+197,108+187+40);
               												HUnlock((Handle) apple); 
               												DrawPicture(apple,&rec);                
                              								ReleaseResource((Handle) apple);  


                											SetPort((GrafPtr) anima);

               												SetRect(&re,0,0,272,265);
															FillCRect(&re,leers);
															
                								            apple=GetPicture(128);
               												SetRect(&rec,0,0,281,301);
               												HUnlock((Handle) apple); 
               												DrawPicture(apple,&rec);                
                              								ReleaseResource((Handle) apple);  

               SetPort((GrafPtr) bsack);
               for (lx=0;lx<=5;++lx)
               {
                timex=0;
                timey=10+lx*45;
                
                
 
                 /* DER NAME */
                  SetPort((GrafPtr) anima);

                for (ly=0;ly<=6;++ly)
                {                 
                if (nm[lx][ly]!=' ')  
                 {                  
                  SetRect(&re,timex+35+ly*32-10,timey+10,timex+35+32+ly*32-10,timey+32+10);
                  ic0=GetCIcon(1088);    
                  if (ic0!=0L) {
                  PlotCIcon(&re,ic0); 
                  DisposeCIcon(ic0); }; 
                  };
                };
                

                  SetPort((GrafPtr) bsack);
               
                /* DER NAME */
                for (ly=0;ly<=6;++ly)
                {                 
                  SetRect(&ref,500,300,532,332);
                  FillCRect(&ref,leerw);
                  
 
                  ic0=GetCIcon(nm[lx][ly]-(int) ('A')+1061);    
                  if (ic0!=0L) {
                  PlotCIcon(&ref,ic0); 
                  DisposeCIcon(ic0); 
                  
                  }; 
                              
               
                  SetRect(&re,timex+35+ly*32,timey,timex+35+32+ly*32,timey+32);
                  CopyBits(&((GrafPtr) bsack)->portBits,&(((GrafPtr) anima)->portBits),&ref,&re,36, 0L);
                  
                };
                
                  SetPort((GrafPtr) anima);
                
               /* DER SCORE */
                qqr=1;
                zxx=sc[lx];
                for (ly=0;ly<=6;++ly)
                { zzz=(zxx % 10);

                  SetRect(&ref,timex+247-ly*16,timey+32,timex+247-ly*16+16,timey+32+15);
                  ic0=GetCIcon((int) (zzz)+2000);    
                  if (ic0!=0L) {
                  PlotCIcon(&ref,ic0);
                  DisposeCIcon(ic0); };
     
   
                  zxx=zxx/10;
                  qqr=qqr*10;
                 
                  if (qqr>sc[lx]) ly=50;
                 };
  
                  
              SetPort((GrafPtr) anima);
              
              /* DIE  WORLD */
			    qr=1;
                plx=lv[lx];
                plx=plx/3+1;
                
            
                  zz=(plx % 10);
         
                  SetRect(&ref,timex+117-ly*16,timey+32,timex+117-ly*16+16,timey+32+15);
                  ic0=GetCIcon((int) (zz)+2000);    
                  if (ic0!=0L) {
                  PlotCIcon(&ref,ic0);
                  DisposeCIcon(ic0); };
     

               
            
                  SetPort((GrafPtr) bsack);
              /* DER  LEVEL 
			    qr=1;
                plx=lv[lx];
                plx=plx%3+1;
                //timex=timex+20;
 
                  zz=(plx % 10);
         
                  SetRect(&ref,500,300,532,332);
                  FillCRect(&ref,leerw);
                    ic0=GetCIcon(zz+2000);    
                  if (ic0!=0L) {
                  PlotCIcon(&ref,ic0);
                  DisposeCIcon(ic0); };
     
                  SetRect(&re,timex+250+65-ly*10+20,timey+7,timex+250+65-ly*10+10+20,timey+7+16);
                  CopyBits(&((GrafPtr) bsack)->portBits,&(((GrafPtr) anima)->portBits),&ref,&re,36, 0L);
               */
				/* SAVE */
                                                  GetVol(NULL,&reply.vRefNum);
                                                  Create("\pSCOT", reply.vRefNum,'NIXT',reply.fType);

                                                   FSOpen("\pSCOT",reply.vRefNum,&refnum);

                                                   bietes=sizeof(long)*11 ;
                                                   FSWrite(refnum,&bietes,&sc[0]); // ANDERES !!

                                                   bietes=sizeof(char)*11*10 ;
                                                   FSWrite(refnum,&bietes,&nm[0][0]); // ANDERES !!

                                                   bietes=sizeof(int)*11 ;
                                                   FSWrite(refnum,&bietes,&lv[0]); // ANDERES !!


                                                   FSClose(refnum);
				
                   
                }; 			



                											SetPort((GrafPtr) firstWin);

               												SetRect(&re,200,50,200+250,50+300);
															FillCRect(&re,leers);

               												SetRect(&re,0,0,280,300);
                 										    SetRect(&ri,220,40,220+280,40+300);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      
                							                  



 				  SndPlay(sndc1,click,TRUE);
   ShowCursor();
                 };  // HIGHSCORE - ENDE - DAS WARS
                 
                
                
                
                          
          
             if ((x>(8*64)) && (x<(9*64))) 
             {   if ((y>(3*64-24)) && (y<(4*64-24))) gemenu= 5; // PLAY
                 if ((y>(5*64-24)) && (y<(6*64-24))) if (gemenu!=4) { gemenu=4; sctxt=1; sctxtz=0; 
                											
                											
  											               SetRect(&rec,200,0,500,330);
  											               SetRect(&re,200,40,500,330+40);
													       CopyBits(&((GrafPtr)  muriel)->portBits,&(((GrafPtr) firstWin)->portBits),&rec,&re,srcCopy, 0L);                      
                											
                											SetPort((GrafPtr) anima);

               												SetRect(&re,0,0,272,265);
															FillCRect(&re,leers);
															
                								            apple=GetPicture(204);
               												SetRect(&rec,0,0,250,300);
               												HUnlock((Handle) apple); 
               												DrawPicture(apple,&rec);                
                              								ReleaseResource((Handle) apple);  


                											SetPort((GrafPtr) firstWin);

               												SetRect(&re,200,50,200+250,50+300);
															FillCRect(&re,leers);

               												SetRect(&re,0,0,250,300);
                 										    SetRect(&ri,220,40,220+250,40+300);
															CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&rec,&ri,srcCopy, 0L);                      
                							                  
                 
                 
                                                          SndPlay(sndc0,click,TRUE);            

                 
                 }; //ABOUT             
             };
          };


       if (a!=2)      
        if (gemenu!=5)      
          if (a!=gemenu) { 
                 for (i=0;i<640;++i) {   /*     SetRect(&re,i,0,i+1,400);
					                          SetRect(&ri,i,40,i+1,440);
					                          CopyBits(&((GrafPtr)  muriel )->portBits,&(((GrafPtr)  firstWin)->portBits),&re,&ri,srcCopy, 0L); */  };                             
          };
         
      /*   PREFERENCES */         
     if (gemenu==2) 
      if (a!=gemenu)
      {                                          SndPlay(sndc0,click,TRUE);            


        };
      /*   CLEAR   */         
      if (a==2)
      if (gemenu!=a) 
      { };                           
          

 /* Der HIntergrundsound */  //  if  (SndChannelBusy(sndc2)==FALSE) SndPlay(sndc2,hinter[RandomInt(4)+3],TRUE);
          
          i=0; 
          if (gemenu==5) i=1;
          if (gemenu==1) i=1;
           
    } while (i==0) ;                
	          
if (gemenu==5)
{       HideCursor();
     /*    QUIT      */ 
       SetPort((GrafPtr)  firstWin); 

               apple=GetPicture(258);
               SetRect(&rec,511,127+40,572,189+40);
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  

                                         SndPlay(sndc0,click,TRUE);            
                                        do ;  while (SndChannelBusy(sndc0)==TRUE);


};
  



 /* =============================PLLLLLLLLLLLLLLAA AAAAAAAAYYYYYYYY============= */                   
if (gemenu==1)  
{   gemenu=6;
    HideCursor();     
    endef=0;
   SetPort((GrafPtr) firstWin);
                                 SetRect(&rec,0,440,640,480);
								 FillCRect(&rec,leers);
    

                  // beginn
    /* LAUTER WERDEN */
   ii=256;
   for (i=0;i<=25;++i) {

    ii=ii-10;
/*    
    vol=(long) ((long) ii << 16L  ii); 

    SetDefaultOutputVolume(vol);
   
    lau=TickCount();
    do {
    	HY_ServiceTasks();
		ProcessQuickTimeMovie();  
    } while((lau+5)>TickCount()); */
   }; 


    doit=0;

       SetPort((GrafPtr)  firstWin); 

 
               apple=GetPicture(257); 
               SetRect(&rec,4*64-1-1,6*64 -1-24-5 ,5*64-2-1,7*64-1  -24);
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple);  

   SndPlay(sndc0,click,TRUE);
   do ;  while (SndChannelBusy(sndc0)==TRUE);



    SetPort((GrafPtr)  firstWin); 
    SetRect(&rec,0,40,640,440);
    FillCRect(&rec,leers);

    

  score=0;
/* LEVELBILDER */

 // DIE STERNE
  if (level==0) {
   for (i=0;i<=50;++i) { sidus[i][0]=RandomInt(640);
   						 sidus[i][1]=RandomInt(140);
   						 sidus[i][2]=3;
   						 sidus[i][3]=0;
                       };
   for (i=50;i<=75;++i) { sidus[i][0]=RandomInt(640);
   						 sidus[i][1]=RandomInt(200);
   						 sidus[i][2]=2;
   						 sidus[i][3]=0;
                       };
   for (i=75;i<=99;++i) { sidus[i][0]=RandomInt(640);
   						 sidus[i][1]=RandomInt(240);
   						 sidus[i][2]=1;
   						 sidus[i][3]=0;
                       }; };
 
  if (level==4) 
   for (i=0;i<=99;++i) { sidus[i][0]=RandomInt(640);
   						 sidus[i][1]=170+RandomInt(230);
   						 sidus[i][2]=1+RandomInt(3);
   						 sidus[i][3]=0;}; 
                       
shz=0;       
// DER SPEED IST IMMER GLEICH NUR DER SPEED             

do {
   

       SetPort((GrafPtr)  firstWin); 
/* LOGO */
      
        if ((level%3)==0) {  SetPort((GrafPtr)  firstWin); 
                        
 
    
    SetRect(&rec,0,40,640,440);
    FillCRect(&rec,leers);


    SetRect(&rec,0,90,300,390);
    apple=GetPicture(314);
     HUnlock((Handle) apple);
    DrawPicture(apple,&rec);               
    ReleaseResource((Handle) apple);  
    

    apple=GetPicture(5000+(level/3));
    SetRect(&rec,440,40,640,440 );
     HUnlock((Handle) apple);
    DrawPicture(apple,&rec);               
    ReleaseResource((Handle) apple);  };           
             

 SetPort((GrafPtr) firstWin);
      
if ((level%3)==0) { 
    /* DIE ANIMATION DER DECKEL SCHRAUBT SICH AUF*/          
   SetPort((GrafPtr) firstWin);
    SndPlay(sndc0,menuclick,TRUE);
   
    apple=GetPicture(142);
    SetRect(&rec,0,100,251,126);    
    HUnlock((Handle) apple);
    DrawPicture(apple,&rec);               
    ReleaseResource((Handle) apple);             
      
                          };   


  if ((level%3)!=0) {
             SetPort((GrafPtr) firstWin);
              apple=GetPicture(146);
               SetRect(&rec,0,450,640,470);
          
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple); 

 SndPlay(sndc0,click,TRUE);  do ;  while (SndChannelBusy(sndc0)==TRUE); };



// leer
  for (i=0;i<=499;++i) 
    for (q=0;q<=10;++q)   
    { les[i][1]=4999; 
      les[i][q]=0;    };
    
    
     for (i=0;i<=399;++i) 
    {  toota[i][0]=4000;
       for (q=1;q<=7;++q)     
       toota[i][q]=0;   
    };    
    

  


/* LEVELVORBEREITUNG */
 
    

   wox= 0;
     woy= 0;         

     mx=wox+200;
     my=woy+200;
     taz=10;  // Verkrzung
     tax=10;
     tay=10 ;
     anzahl=7; 
      
     /*  32 STUFEN  */
     wox=0;
     woy= 0; 

     

/* ANIMATIONEN  */
       SetPort((GrafPtr)  anima); //anima
       SetRect(&rec,0,0,640,400 );
       FillCRect(&rec,leerw);

       
         
    
   // ShowCursor();
   /* OBEN X */
   obenx=wox+150;
   obeny=woy+0;
   untenx=obenx;
   unteny=obeny+320+40;
   
             
  flugge=2; 

 schpz=10;

zg_spiel=1;
noup=0;
ani=0;
untenz=3;
speed=0;

schpx=550;
schpy=200;
tax=schpx;
tay=schpy;
schppx=schpx;
schppy=schpy;


timed=100; /* GESCHWINDIGKEIT DES ENDES */
timezlr=0;
schiessz=150; // DEFAULT

steinu=0;
steinz=1;
weiter=1;
batgo=0;

quit=0;
menu=1;

steinw=0;

  
   SetPort((GrafPtr) anima); 

  for (ii=0;ii<=11;++ii)
       for (i=0;i<=9;++i)
        {  SetRect(&ref, i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(245+i+ii*10 );
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };
 
   /* =========== DIE KAPUTTEN ============== VULKAN ZUM BEISPIEL ========== */
          i=0;
          SetRect(&ref,320+i*32,0,320+i*32+32,32);
           ic0=GetCIcon(4000+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };

     
/*       for (i=0;i<=1;++i)
        {  SetRect(&ref,320+i*64+32,0,320+i*64+64+32,32);
           ic0=GetCIcon(4001+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         }; */
       
 
   for (ii=0;ii<=11;++ii)
       for (i=0;i<=9;++i)
        {  SetRect(&ref, 320+i*32,ii*32+32,320+i*32+32,64+ii*32);
           ic0=GetCIcon(365+i+ii*10 );
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

   // neuer Schuss
    ii=3;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(149);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    
          
         
     /* OBERMONSTER */
    SetPort((GrafPtr) nima);
          
    SetRect(&rec,0,0,640,100 );
    FillCRect(&rec,leerw);
    if (level==2) {
    ii=0;
    for (i=0;i<=9;++i)
    {  SetRect(&ref, i*64,0,i*64+64,64);
           ic0=GetCIcon(405+i );
           if (ic0!=0L)  { PlotCIcon(& ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
    };};



    if (level==5) {
    ii=0;
    for (i=0;i<=9;++i)
    {  SetRect(&ref, i*64,0,i*64+64,64);
           ic0=GetCIcon(475+i );
           if (ic0!=0L)  { PlotCIcon(& ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
    };};

    if (level==8) {
    ii=0;
    for (i=0;i<=9;++i)
    {  SetRect(&ref, i*64,0,i*64+64,64);
           ic0=GetCIcon(485+i );
           if (ic0!=0L)  { PlotCIcon(& ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
    };};


    if (level==11) {
    ii=0;
    for (i=0;i<=9;++i)
    {  SetRect(&ref, i*64,0,i*64+64,64);
           ic0=GetCIcon(627+i );
           if (ic0!=0L)  { PlotCIcon(& ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
    };};


   									
  /* ZURUECK IM 3 LEVEL */

  
    if (level==1)
      {          
     

     };
     
  /* WATERWORLD ----------> */

    if ((level==3) || (level==4) || (level==5))
     {  flugge=2;
     
              SetPort((GrafPtr) anima);

           i=0;
           SetRect(&ref,320+i*32,0,320+i*32+32,32);
           FillCRect(&ref,leerw);
           ic0=GetCIcon(148);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };     
 
   // neuer Schuss
    ii=3;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(149);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    
      
    ii=4;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(595+i );
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

    ii=5;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(575+i );
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    
        
    // DARUEBER 
    ii=6;
    SetRect(&rec,320,ii*32,320+320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32+320,ii*32,i*32+32+320,32+ii*32);
           ic0=GetCIcon(607+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    
   
    ii=7;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(128+i );
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

    ii=8;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(138+i );
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

/* ZWEITE SEITE */
       ii=7;
    SetRect(&rec,320,ii*32+32,640,ii*32+64 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32+320,ii*32+32,320+i*32+32,64+ii*32);
           ic0=GetCIcon(585+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

       ii=6;
    SetRect(&rec,320,ii*32+32,640,ii*32+64 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32+320,ii*32+32,320+i*32+32,64+ii*32);
           ic0=GetCIcon(156+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    


       ii=8;
    SetRect(&rec,320,ii*32+32,640,ii*32+64 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32+320,ii*32+32,320+i*32+32,64+ii*32);
           ic0=GetCIcon(166+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    



     };     
  
  /* ABENDROT ----------> */

    if ((level==6) || (level==7) || (level==8))
     {  flugge=2;

         SetPort((GrafPtr) anima);

           i=0;
           SetRect(&ref,320+i*32,0,320+i*32+32,32);
           FillCRect(&ref,leerw);
           ic0=GetCIcon(151);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };     

   // neuer Schuss
    ii=3;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(150);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

     
    ii=7;

    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(495+i );
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

        ii=8;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(565+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

        ii=9;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(637+i); // 535
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    


        ii=4;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(505+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

        ii=5;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(545+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

        ii=1;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(525+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    


        ii=5;
    SetRect(&rec,320,ii*32+32,640,ii*32+64 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32+320,ii*32+32,320+i*32+32,64+ii*32);
           ic0=GetCIcon(647+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    


        ii=6;
    SetRect(&rec,320,ii*32+32,640,ii*32+64 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32+320,ii*32+32,320+i*32+32,64+ii*32);
           ic0=GetCIcon(515+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

        ii=7;
    SetRect(&rec,320,ii*32+32,640,ii*32+64 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32+320,ii*32+32,320+i*32+32,64+ii*32);
           ic0=GetCIcon(555+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    
     
     
     };
    /* <------------- ABENDROT  */
  

  /* ORGANIC ----------> */

    if ((level==9) || (level==10) || (level==11))
     {  flugge=2;

         SetPort((GrafPtr) anima);

           i=0;
           SetRect(&ref,320+i*32,0,320+i*32+32,32);
           FillCRect(&ref,leerw);
           ic0=GetCIcon(276);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };     

   // neuer Schuss
    ii=3;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(152);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

     
    ii=7;

    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(186+i );
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

        ii=8;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(196+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

        ii=9;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(657+i); // 535
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    


        ii=4;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(176+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

        ii=5;
    SetRect(&rec,0,ii*32,320,ii*32+32 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32,ii*32,i*32+32,32+ii*32);
           ic0=GetCIcon(216+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

 
  /* ZWEITE SEITE */
        ii=5;
    SetRect(&rec,320,ii*32+32,640,ii*32+64 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32+320,ii*32+32,320+i*32+32,64+ii*32);
           ic0=GetCIcon(226+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

 // FEHLT NOCH !!
        ii=6;
    SetRect(&rec,320,ii*32+32,640,ii*32+64 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32+320,ii*32+32,320+i*32+32,64+ii*32);
           ic0=GetCIcon(667+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    

        ii=7;
    SetRect(&rec,320,ii*32+32,640,ii*32+64 );
    FillCRect(&rec,leerw);
         for (i=0;i<=9;++i)
        {  SetRect(&ref,i*32+320,ii*32+32,320+i*32+32,64+ii*32);
           ic0=GetCIcon(206+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                              DisposeCIcon(ic0);        
                               };
         };    
     
     
     };
    /* <------------- ORGANIC  */
                                                 GetVol(NULL,&reply.vRefNum);
                                                // FSOpen("\pZUTATEN",reply.vRefNum,&refnum);
                               if (level==0) FSOpen("\pZUTATEN0",reply.vRefNum,&refnum);
                               if (level==1) FSOpen("\pZUTATEN1",reply.vRefNum,&refnum);
                               if (level==2) FSOpen("\pZUTATEN2",reply.vRefNum,&refnum);
                               
                               if (level==3) FSOpen("\pZUTATEN3",reply.vRefNum,&refnum);
                               if (level==4) FSOpen("\pZUTATEN4",reply.vRefNum,&refnum);
                               if (level==5) FSOpen("\pZUTATEN5",reply.vRefNum,&refnum);
                              

                               if (level==6) FSOpen("\pZUTATEN6",reply.vRefNum,&refnum);
                               if (level==7) FSOpen("\pZUTATEN7",reply.vRefNum,&refnum);
                               if (level==8) FSOpen("\pZUTATEN8",reply.vRefNum,&refnum);
                               if (level==9) FSOpen("\pZUTATEN9",reply.vRefNum,&refnum);
              				   if (level==10) FSOpen("\pZUTATEN10",reply.vRefNum,&refnum);
              				   if (level==11) FSOpen("\pZUTATEN11",reply.vRefNum,&refnum);
              				   if (level==12) FSOpen("\pZUTATEN12",reply.vRefNum,&refnum);
              				   if (level==13) FSOpen("\pZUTATEN13",reply.vRefNum,&refnum);
              				   if (level==14) FSOpen("\pZUTATEN14",reply.vRefNum,&refnum);
   
                                                 bietes=(long) (500L*10*sizeof(int));                                                   
                                                 FSRead(refnum,&bietes,les); // ANDERES !!
                                                 FSClose(refnum);  
    
    /* DIE ANIMATION */          
if ((level%3)==0) {
   SndPlay(sndc0,menuclick,TRUE);
   
    SetPort((GrafPtr) firstWin);
    apple=GetPicture(145);
    SetRect(&rec,0,140,251,166);
    HUnlock((Handle) apple);
    DrawPicture(apple,&rec);               
    ReleaseResource((Handle) apple);             


   do ;  while (SndChannelBusy(sndc0)==TRUE); 
   };
                                              
    
                                                 GetVol(NULL,&reply.vRefNum);
                                                 //FSOpen("\pWAVES",reply.vRefNum,&refnum);
                           if (level==0)  FSOpen("\pWAVES0",reply.vRefNum,&refnum);
                           if (level==1)  FSOpen("\pWAVES1",reply.vRefNum,&refnum);
                           if (level==2)  FSOpen("\pWAVES2",reply.vRefNum,&refnum);
                           if (level==3)  FSOpen("\pWAVES3",reply.vRefNum,&refnum);
                           if (level==4)  FSOpen("\pWAVES4",reply.vRefNum,&refnum);
                           if (level==5)  FSOpen("\pWAVES5",reply.vRefNum,&refnum);
                           if (level==6)  FSOpen("\pWAVES6",reply.vRefNum,&refnum);
                           if (level==7)  FSOpen("\pWAVES7",reply.vRefNum,&refnum);
                           if (level==8)  FSOpen("\pWAVES8",reply.vRefNum,&refnum);
                           if (level==9)  FSOpen("\pWAVES9",reply.vRefNum,&refnum);
                           if (level==10)  FSOpen("\pWAVES10",reply.vRefNum,&refnum);
                           if (level==11)  FSOpen("\pWAVES11",reply.vRefNum,&refnum);

                           if (level==12)  FSOpen("\pWAVES12",reply.vRefNum,&refnum);
                           if (level==13)  FSOpen("\pWAVES13",reply.vRefNum,&refnum);
                           if (level==14)  FSOpen("\pWAVES14",reply.vRefNum,&refnum);

                                                   bietes=  50000L;
                                                   FSRead(refnum,&bietes, soptr[1] );       
                                                   FSClose(refnum); 

                                                  
                                                  GetVol(NULL,&reply.vRefNum);
                                                 // FSOpen("\pLEVT",reply.vRefNum,&refnum);
                               if (level==0) FSOpen("\pLEVT0",reply.vRefNum,&refnum);
                               if (level==1) FSOpen("\pLEVT1",reply.vRefNum,&refnum);
                               if (level==2) FSOpen("\pLEVT2",reply.vRefNum,&refnum);
                               if (level==3) FSOpen("\pLEVT3",reply.vRefNum,&refnum);
                               if (level==4) FSOpen("\pLEVT4",reply.vRefNum,&refnum);
                               if (level==5) FSOpen("\pLEVT5",reply.vRefNum,&refnum);
                               if (level==6) FSOpen("\pLEVT6",reply.vRefNum,&refnum);
                               if (level==7) FSOpen("\pLEVT7",reply.vRefNum,&refnum);
                               if (level==8) FSOpen("\pLEVT8",reply.vRefNum,&refnum);
                               if (level==9) FSOpen("\pLEVT9",reply.vRefNum,&refnum);
                               if (level==10) FSOpen("\pLEVT10",reply.vRefNum,&refnum);
                               if (level==11) FSOpen("\pLEVT11",reply.vRefNum,&refnum);

                               if (level==12) FSOpen("\pLEVT12",reply.vRefNum,&refnum);
                               if (level==13) FSOpen("\pLEVT13",reply.vRefNum,&refnum);
                               if (level==14) FSOpen("\pLEVT14",reply.vRefNum,&refnum);

                                                      bietes=(long) (sizeof(int)*400*8);
                                                 FSRead(refnum,&bietes,&toota[0][0]);
                                                 FSClose(refnum);

    
   

   
       /* MAKE LEVELS */
    SetPort((GrafPtr)  firstWin);   /* PREPARING */


    /*          apple=GetPicture(134);
                            SetRect(&rec,0,450,640,470);
               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple); 
 SndPlay(sndc0,click,TRUE);  do ;  while (SndChannelBusy(sndc0)==TRUE); */

    /* MAXIMUM */
   ax=0; for (i=0;i<499;++i)  if (les[i][0]<=2560)  if (les[i][5]!=0)
                                                if (les[i][4]!=0 ) 
    if  ((i%10)==0) { };

                                            SetPort((GrafPtr) bsack);
							  			    SetRect(&rec,0,0,2560,400 );
                                                     FillCRect(&rec,leers); 
								                  
								                
								            if (level==0)  { schiessz=150;
								            				 vulkanz=8;
								                             apple=GetPicture(9000);
														     HUnlock((Handle) apple);
								                  			for (i=0;i<=9;++i)
								                  			{ SetRect(&rec,i*256,0,i*256+256,400);
														      DrawPicture(apple,&rec);            };
														    ReleaseResource((Handle) apple);  
								                            }; 
												


								                
								            if (level==1)  { schiessz=200;
								            				 vulkanz=8;
								                             apple=GetPicture(9003);
														     HUnlock((Handle) apple);
								                  			for (i=0;i<=9;++i)
								                  			{ SetRect(&rec,i*256,0,i*256+256,400);
														      DrawPicture(apple,&rec);            };
														    ReleaseResource((Handle) apple);  
								                            }; 


											if (level==2)  { schiessz=150;
								            				 vulkanz=8;
															 lee=GetPixPat(128);
											                 SetRect(&rec,0,0,2560,400 );
                                                             FillCRect(&rec,lee); };
                                                             


								            if ((level==4) || (level==5) || (level==3)) { 
								            			    schiessz=250;
								            				 vulkanz=16;
								                           leerwa=GetPixPat(4); 
								                            if (level==3) { apple=GetPicture(9001);
								                                            leerwa=GetPixPat(3); 
								                                          };
								                            if (level==4) apple=GetPicture(9002);
								                            if (level==5) apple=GetPicture(9004);


														     HUnlock((Handle) apple);
								                  			for (i=0;i<=9;++i)
								                  			{ SetRect(&rec,i*256,0,i*256+256,400);
														      DrawPicture(apple,&rec);            };
														    ReleaseResource((Handle) apple);  
								                           winl=0;
														    
														    
								                          };
								                    



								            if ((level==6) || (level==7) ||(level==8)) {
														if (level==6) {
														   schiessz=300;
								            				 vulkanz=10;


														   apple=GetPicture(9005);
														   
														     HUnlock((Handle) apple);
								                  			for (i=0;i<=9;++i)
								                  			{ SetRect(&rec,i*256,0,i*256+256,400);
														      DrawPicture(apple,&rec);            };
														    ReleaseResource((Handle) apple);  
								                           winl=0;

								                           
								                              apple=GetPicture(9006);
														     HUnlock((Handle) apple);
								                  			for (i=0;i<=5;++i)
								                  			{ SetRect(&rec,i*512,0,i*512+512,150);
														      DrawPicture(apple,&rec);            };
														    ReleaseResource((Handle) apple);  

								                           
								                            } else
								                            {
														    if (level==7) apple=GetPicture(9008);
														    if (level==8) apple=GetPicture(9009);
														    HUnlock((Handle) apple);
								                  			for (i=0;i<=9;++i)
								                  			{ SetRect(&rec,i*256,0,i*256+256,400);
														      DrawPicture(apple,&rec);            };
														    ReleaseResource((Handle) apple);  };

								                            };


										 if ((level==9) || (level==10) ||(level==11))
										                   { 
                                                      
                                                        flugge=2;
                                                        
                                                        if (level==9) {
														 for (i=0;i<=10;++i) {
														    apple=GetPicture(9012);
														    HUnlock((Handle) apple);
								                            SetRect(&rec,i*256,0,i*256+256,400);
														    DrawPicture(apple,&rec);        
														    ReleaseResource((Handle) apple);  };   };                                                       
                                                             

                                                          
                                                        if (level==10) {
														 for (i=0;i<=10;++i) {
														    apple=GetPicture(9011);
														    HUnlock((Handle) apple);
								                            SetRect(&rec,i*256,0,i*256+256,400);
														    DrawPicture(apple,&rec);        
														    ReleaseResource((Handle) apple);  };   };                                                       
                                                          
                                                        if (level==11) {
														 for (i=0;i<=10;++i) {
														    apple=GetPicture(9010);
														    HUnlock((Handle) apple);
								                            SetRect(&rec,i*600,0,i*600+600,400);
														    DrawPicture(apple,&rec);        
														    ReleaseResource((Handle) apple);  };   };                                                       
                                                          
                                                             
                                                             
                                                             };
 
 										 if ((level==12) || (level==13) ||(level==14))
										                   { 
														 for (i=0;i<=10;++i) {
														    apple=GetPicture(9013+level-12);
														    HUnlock((Handle) apple);
								                            SetRect(&rec,i*256,0,i*256+256,400);
														    DrawPicture(apple,&rec);        
														    ReleaseResource((Handle) apple);  };                                                         

                                                             
                                                             };
                                                             



                                                for (i=0;i<=499;++i)
                                                if (les[i][0]<=2560)
                                                if (les[i][5]!=0)
                                                if (les[i][4]!=0 )
                                                {     
                                                 pacgo=0;
                                                 
                                                          lx=les[i][0];
                                                          ly=les[i][1];
                                                         kx=les[i][2];
                                                         ky=les[i][3];
                                             
if ((i%15)==0) {
     SetPort((GrafPtr)  firstWin);   /* PREPARING */
                                     /*   SndPlay(sndc0,all[8],TRUE); */ 
    }
                                                                                                                                                         
                                                           SetPort((GrafPtr) muriel); //muriel
								                           SetRect(&rec,0,0 ,kx-lx,ky-ly);
																							                          apple=GetPicture(500+les[i][4]-1);
																							                           HUnlock((Handle) apple);
																							                           DrawPicture(apple,&rec);               
																							                           ReleaseResource((Handle) apple); 

						
		                                                 
								                           SetRect(&re,0,0 ,kx-lx,ky-ly);                                               
                                                           SetRect(&ri,lx,ly ,kx,ky);
					                                       CopyBits(&((GrafPtr)  muriel)->portBits,&(((GrafPtr)  bsack)->portBits),&re,&ri,36, 0L);         

                                                        if (les[i][5]==-20) les[i][4]=0;
  
								                           if (les[i][4]!=0) { for (q=0;q<=9;++q) les[ax][q]=les[i][q]; 
								                                                     ++ax;
                                                                                  };
                                           };                
                                              

									if (level==3) {  /* SetPort((GrafPtr) bsack);
								                            apple=GetPicture(9007);
														     HUnlock((Handle) apple);
								                  			for (i=0;i<=25;++i)
								                  			{ SetRect(&rec,i*200,370,i*200+200,400);
														      DrawPicture(apple,&rec);            };
														    ReleaseResource((Handle) apple); */
														     };
								                          
/* DAS ENDE */                                                           
                                                           SetPort((GrafPtr) muriel); //muriel
								                      
								                     if (level==2) {
								                          apple=GetPicture(1000);

								                           SetRect(&rec,0, 0 ,320,400);
								                           HUnlock((Handle) apple);
			 					                           DrawPicture(apple,&rec);               
								                           ReleaseResource((Handle) apple); 
								                                                 
								                                                 
								                           SetRect(&re,0,0 ,320,400);                                               
                                                           SetRect(&ri,2560-320,0,2560,400);
					                                      CopyBits(&((GrafPtr)  muriel)->portBits,&(((GrafPtr)  bsack)->portBits),&re,&ri,36, 0L);         

															};
                                         // SndPlay(sndc0,all[8],TRUE);

                                          for (i=ax;i<=499;++i) les[i][0]=4000; 



                                           SetPort((GrafPtr) firstWin);
                                        
                                           spritezlr=49;
                                           for (i=0;i<=spritezlr;++i)
                                            for (ii=0;ii<=19;++ii)
                                             retus[i][ii]=0;  

                                             /* DAS SCHIFF */
                                              retus[0][0]=320;                                             
                                              retus[0][1]=360;
 
                                              retus[0][2]=3;
                                              retus[0][3]=0;
                                              retus[0][4]=1;
                                              retus[0][5]=40;
                                              retus[0][6]=32;
 
 	                                           
 	                                           
 	                                           spee=0; // ANIMATIONSPEED
                                               speed=0;
				                               zu=0;
				                               eing=0;
				                          
				                               scrollz=0;
				                               scrollx=0;
				                               wasser=0;

                                              retus[i][19]=1;

                                               zulo=0;  

  power=0;
  PAUD=0;
  back=0;									 
  shield=2; 
  shieldz=5;
  
  super=0;
  wide=30;  // SIDEWINGS
  side=0;
  shieldzlr=10; 
  holdzlr=-1;
  
  tode=0;
   wieder=0;

/* TASTATUR */
    x=120;
    y=200-32;


  
    
 /*   SetRect(&rec,0,450,640,470);
    FillCRect(&rec,leers);*/
  
    x=120;   
    y=200-32;
    puatx=x;  puaty=y;

                                                        HideCursor();
//                                                         SndPlay(sndc0,click,TRUE); 
  //                                                   do ;  while (SndChannelBusy(sndc0)==TRUE);

 
obert=0;
  
   nt=0; 
   in=0; // kein Obermonster jetzt
       zg_gameover=0;
       zg_didit=0;
       gascr=0;
       
   /* VON HINTEN NACH VORNE */
   if (level==0) for (i=0;i<=spritezlr;++i) retus[i][29]=100;
   
  
   scz=6*256;
   ql=0;
   scrl=0;
   /* DIE ZAHLEN */
   SetPort((GrafPtr) nima);
   for (i=0;i<=9;++i)
   {  SetRect(&ref, i*32,64,i*32+32,96);
           ic0=GetCIcon(3000+i);
           if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                           DisposeCIcon(ic0);        
                               }; };
   
      
   // BEGIN
   waitus=0;
   zg_score=1;


  
  
  


/* --------- WAIT FOR -------- */
 SetPort((GrafPtr) firstWin);  
 SetRect(&rec,0,450,640,470);
  FillCRect(&rec,leers);



                  SetRect(&re,0,0,640,400);
                  SetRect(&ri,0,0,640,400);   
                  CopyBits(&((GrafPtr) bsack)->portBits,&(((GrafPtr) muriel)->portBits),&ri,&re,srcCopy, 0L);

                                                         if (level==3)  {
                                                        	ql=ql+1; if (ql>999) ql=0;
                                                        	spiegel=350;
                                                       	    i=spiegel;
                                                       	    winll=i/30;
                                                       		SetRect(&re, scrollz,0,scrollz+640,i);				                                       
                                                       		SetRect(&ri, 0,0,640,i);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
														   
														     
														 for (ii=0;ii<=19;++ii) {
                                                       		SetRect(&re,0,i+ii,640,i+ii+1);
                                                       		zuf=ii*winll+RandomInt(winll);				                                       
                                                       		SetRect(&ri, 0,i-zuf,640,i-zuf+1);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&ri,&re ,srcCopy, 0L);         
															};
															
                                                       	SetRect(&ri, 0,370,640,400);
                                                       		SetRect(&re, 0,370,640,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                      
                                                           
                                                          };

                                                          if ((level==4) || (level==5))
                                                           {
                                                          rad=50;
                                                          if (level==5) { rad=70;
                                                                          if (scrollz==2560) rad=20;
                                                                        };
                                                          winl=winl+10; if (winl>628) winl=0;                                  
                                                       	  i=300+(int) ((double) (  rad)*sin((double) (winl)/100  )    );
                                                       	  spiegel=i;
                                                       	  
                                                       	    winll=i/30;
                                                       		SetRect(&re, scrollz,0,scrollz+640,i);				                                       
                                                       		SetRect(&ri, 0,0,640,i);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
														
														 for (ii=0;ii<=10;++ii) {
                                                       		SetRect(&re,0,i+ii,640,i+ii+1);
                                                       		zuf=ii*winll+RandomInt(winll);				                                       
                                                       		SetRect(&ri, 0,i-zuf,640,i-zuf+1);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&ri,&re ,srcCopy, 0L);         
                                                          };
                                                           

                                                         
                                                            SetPort((GrafPtr) muriel);
                                                            SetRect(&rec, 0,spiegel+25,640,400);	
                                                            FillCRect(&rec,leerwa); 

                                                          };


  // LEVEL-MUSIC 
if (level%3==0)
if (musicf==1)
if (quicktimei==1) {
	HY_UnregisterAllSoundResources();
	HY_Cleanup();
	EndQuickTimeMovie();
	FlushEvents(everyEvent, 0);	// clear all events

	theErr = HY_Setup(kUseStereo, 3);
	appDoneFlag = FALSE;
	processStereoPan = FALSE;
	movieInProgress = FALSE;
    
    mus=1+level/3;
    StartQuickTimeMovie(); 

    /* LAUTER WERDEN */
   ii=0;
   for (i=0;i<=25;++i) {
    nv.right=ii;
    nv.left=ii;
    for (q=0;q<8;++q) 
     HY_SetVolume(q,nv);
     ii=ii+10;
    lau=TickCount();
    do {
    	HY_ServiceTasks();
		ProcessQuickTimeMovie();  
    } while((lau+10)>TickCount());
   }; 
    
    
    
    }; 

/* ANPASSUNG */
ShowCursor();
i=0;


                  SetRect(&re,0,40,640,440);
                  SetRect(&ri,0,0,640,400);   
                  CopyBits(&((GrafPtr) muriel)->portBits,&(((GrafPtr) firstWin)->portBits),&ri,&re,srcCopy, 0L);

 SetPort((GrafPtr) firstWin);
             SetRect(&rec,70-20,200+20,640-70-20,300+20);
             FillCRect(&rec,leers);

              apple=GetPicture(139);
               SetRect(&rec,70,200,640-70,300);

               HUnlock((Handle) apple); 
               DrawPicture(apple,&rec);                
               ReleaseResource((Handle) apple); 
if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,click,TRUE);

 
if  (SndChannelBusy(sndc3)==FALSE) SndPlay(sndc3,sready,TRUE);  /*do ;  while (SndChannelBusy(sndc0)==TRUE);*/


 SetPort((GrafPtr) bsack);
do {

 GetKeys(theKeys);
 if (Button()==true) i=1;
 if (Buttan()==1) i=1;
} while (i==0);


   SetPort((GrafPtr) nima);
   
   newp.h=200;
   newp.v=200;
 //  SetMouse(newp);

	sir=1;
	sirz=0;
 
 
   // los gehts mit zaehlen
   beforeTime = TickCount();
   speedl = TickCount();
   do {   
  // DIE MUSIC
   // music  
   if (musicf==1)
    if (quicktimei==1) {
		HY_ServiceTasks();
		ProcessQuickTimeMovie(); };
  
   
   			
  // BILDER 
   WaitNextEvent(everyEvent, &theEvent, kSleep, nil); 


   
                                                   //};
           
         //     >----------- SHOW SCORE ---------------   
        if (zg_score==1) {
              SetPort((GrafPtr) nima);

       // if  (SndChannelBusy(sndc3)==FALSE) SndPlay(sndc3,sndzgsc,TRUE);
              
              
                scorex=320;
                scorey=64;
                SetRect(&rec,scorex,scorey,scorex+6*16,scorey+32);
                FillCRect(&rec,leerw);
      
                zxx=score;
                qqr=1;
                for (ly=0;ly<=6;++ly)
                { zzz=(zxx % 10);
     
                  SetRect(&re,scorex+96-ly*16-16,scorey,scorex+96-ly*16,scorey+32);
                  SetRect(&ri,zzz*32,64,zzz*32+32,96);   
                  CopyBits(&((GrafPtr) nima)->portBits,&(((GrafPtr) nima)->portBits),&ri,&re,36, 0L);
   
                  qqr=qqr*10;
                 
                  if (qqr>score) ly=50;

                  zxx=zxx/10;
                 };};
               // <----------- SHOW SCORE ---------------     


          pax.v=100;
          pax.h=100;
         // SetMouse(pax); 
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
								
														
								/*
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
 // zwei verschiedene WEGE i=spritezlr-1
                      					                                

/* +++++++++++++++++++++++++++++++++++++++   LEVEL 0/2   ++++++++++++++++ */   
      i=0;
      if (level==0) i=1;
      if (level==1) i=1;      
      if (level==3) i=1;
      if (level==4) i=1;
      if (level==6) i=1;
      if (level==7) i=1;
      if (level==9) i=1;
      if (level==10) i=1;
      
      if (i==1) { if (in==0)
                     if (scrollz==(2560-640)) { in=1; inzest=0; };
                  if (in==1) ++inzest;
                  if (in==1)
                   if (inzest>50) { in=2; inz=0;
														SetPort((GrafPtr) bsack);
	
 														apple=GetPicture(137);
  														SetRect(&rec,0,0,640,100);
  														HUnlock((Handle) apple);
  														DrawPicture(apple,&rec);               
  														ReleaseResource((Handle) apple); 
														if  (SndChannelBusy(sndc3)==FALSE) SndPlay(sndc3,slevco,TRUE); 
             score=score+5000;
			 zg_score=1;

													  // die alles Explosion
													  for (i=1;i<=spritezlr;++i)
													   if (retus[i][4]!=0)
													   { retus[i][2]=0;
													     retus[i][3]=1;
													     retus[i][4]=1;
													     retus[i][19]=5; // sound
														}; // wow
                   zg_didit=1;

   if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndelev,TRUE); else
      if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndelev,TRUE); 
                };
                   if (in==2) ++inz;
                };
      
/* +++++++++++++++++++++++++++++++++++++++   LEVEL 0/2   ++++++++++++++++ */   

   
							    /* +++++++++++++++++ LEVEL 1 +++++++++++++++ */
							     if (level==2) {
							        if (in==0)
							            if  (((scrollz+1)>(2560-640-320)) && ((scrollz+1)<(2560-640-70))) { // EIN OBERGEGENER WIRD EINGEFUEHRT
 														 			  // EVTL SOUND DANGEROUS ETC
 														 					       retus[spritezlr-1][0]=320+196;
 																			       retus[spritezlr-1][1]=106;
													                               retus[spritezlr-1][2]=RandomInt(2) ;
													                               retus[spritezlr-1][3]=16;
													                               retus[spritezlr-1][4]=16;
													                               retus[spritezlr-1][5]=64;
													                               retus[spritezlr-1][6]=64;
													                               retus[spritezlr-1][9]=0; 
                                                                                   retus[spritezlr-1][11]=10; // anzahl Schuesse
													                               retus[spritezlr-1][18]=2560-640;
													                               retus[spritezlr-1][19]=3; 
                                                                                   retus[spritezlr-1][20]=0;    


														              
														          
														              obz1=0;
														              obz2=20;																				
																      in=1; // DAS OBERMONSTER
																	  sir=1;
																	  sirz=0;
																};

									if ((in==1) && (zg_didit==0) && (zg_gameover==0))
									 if (scrollz<(2560-640-32)) 
										{

 			  if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndwar,TRUE); else
     			 if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndwar,TRUE); 										
													                               retus[spritezlr-1][3]=16;
													                               retus[spritezlr-1][4]=16;
													                               retus[spritezlr-1][19]=3; 
										
													                               retus[spritezlr-1][18]=2560-640;
										
										
										
										};						
																
																																
																
							   if (in==1)
								if ( retus[spritezlr-1][4]==16) 
								 //if (retus[spritezlr-1][19]!=5)
								 { 
								 
								  obz1=obz1+15; if (obz1>627) obz1=0;      // Winkel
								 								   //retus[spritezlr-1][18]=scrollz;
													                             
									

														 
								/* DER OBERMOTZ WEHRT SICH ...........................*/
									               i=0;
								               if ((RandomInt(30)==1) )   i=1;
								               if ((retus[spritezlr-1][2]==5) && (RandomInt(4)==1))   i=2;
								            
								               if (i>0)
								               {   q=0;
								               
								               
                                                         for (ax=3;ax<=spritezlr ;++ax) // bei 3 beginnt man allgemein
                                                         if (retus[ax][4]==0)
                                                         if (q==0)
                                                         {  q=1;
                                                             retus[ax][0]=640-32;
                                                             retus[ax][1]=240; 
                                                           
                                                             retus[ax][5]=32;
                                                             retus[ax][6]=32;
                                                             retus[ax][3]=21; 
                                                             retus[ax][4]=21;                              
                                                             
                                                          ii=10;
                                                       
                                                       
                                                      if (i==2) {  
                                                             retus[ax][0]=320+196+15;
                                                             retus[ax][1]=106+16;
                                                             ii=20;
                                                             retus[ax][3]=22; 
                                                             retus[ax][4]=22;                              
                                                             retus[ax][5]=32;
                                                             retus[ax][6]=32;
                                                           };
                                                           
                                                           
 	                                                        retus[ax][2]=RandomInt(2);
 
                                                            retus[ax][9]=5; //BEWEGUNG
                                                          if (i==1)  retus[ax][11]=2; // ANZAHL TREFFER 
                                                          if (i==2)  retus[ax][11]=6; // ANZAHL TREFFER 
												            
												            if (i==1) {
																			                   r=retus[0][18]+retus[0][5]/2+retus[0][0]-(retus[ax][18]+retus[ax][5]/2+retus[ax][0]) ;
																			                   rr=retus[0][1]-retus[ax][1]-retus[ax][6]/2;                                          
																			                   retus[ax][13]=ii*r/sqrt(r*r+rr*rr);
														        						  	   retus[ax][14]=ii*rr/sqrt(r*r+rr*rr); };
															if (i==2) { retus[ax][13]=-18;
															            retus[ax][14]=0;
															            retus[ax][19]=3;
															};						  	                                                 


                                                                                               retus[ax][18]=retus[spritezlr-1][18];
																			                   retus[ax][19]=3;     //GEGNER 

														 }; };
														 
								/* DER OBERMOTZ WEHRT SICH ...........................*/
				
													                             
							
								for (i=0;i<=9;++i) {   retus[spritezlr-1-i-1][0]=320+174-i*25;
							 					       retus[spritezlr-1-i-1][0]=320+190-i*25-(int) (sin(((double) (obz1)+(double)(i*25))/100)*10);
												       retus[spritezlr-1-i-1][1]=172    + (int) (sin(((double) (i)*16 +(double) (obz1))/100)*40*((double) (i)/2));
						                               retus[spritezlr-1-i-1][3]=20;
						                               retus[spritezlr-1-i-1][4]=20;
						                               retus[spritezlr-1-i-1][5]=30;
						                               retus[spritezlr-1-i-1][6]=30;
						                               retus[spritezlr-1-i-1][9]=0; 
						                               retus[spritezlr-1-i-1][11]=5; 
						                               retus[spritezlr-1-i-1][18]=retus[spritezlr-1][18];
						                               retus[spritezlr-1-i-1][19]=3; 
	                                                   retus[spritezlr-1-i-1][20]=0;    
												 }; 
												 } else 
										{ 
										
										for (i=0;i<=9;++i) { retus[spritezlr-1-i-1][3]=1;
															 retus[spritezlr-1-i-1][2]=RandomInt(2);  
										                     retus[spritezlr-1-i-1][19]=5; 
										                     /* vorher */
										                     
										                   //  retus[spritezlr-1-i-1][3]=1;
														   //	 retus[spritezlr-1-i-1][2]=RandomInt(2);  
										                 /*    retus[spritezlr-1-i-1][13]=2; 
										                     retus[spritezlr-1-i-1][14]=0;
										                     retus[spritezlr-1-i-1][9]=4; */
										                      };
										
										  // ein Schrei
										  in=2;
										  inz=0;
									}; // lets die

										if (in==2) { ++inz;  // das entgltige Ende
													 if (zg_didit==0)
													 { /* GAME OVER UND I DID IT*/
														SetPort((GrafPtr) bsack);
	
 														apple=GetPicture(141);
  														SetRect(&rec,0,0,640,100);
  														HUnlock((Handle) apple);
  														DrawPicture(apple,&rec);               
  														ReleaseResource((Handle) apple); 
													    if  (SndChannelBusy(sndc3)==FALSE) SndPlay(sndc3,sworco,TRUE); 
													 score=score+10000;
													 zg_score=1;
													   
													   
													  
													 };
													 

   if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndeelev,TRUE); else
      if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndeelev,TRUE); 
      													 
													 zg_didit=1;
												   }; };
						  
/* +++++++++++++++++++++++++++++++++++++++   LEVEL 3   ++++++++++++++++ */
if (level==3)  				 { up=0;
							  if (in==0)
							   if (scrollz>(2560-640-200)) 
							         in=1;
							       
							    if (scrollz<(2560-640-1)){
							    
							       if (in==1)
							         if (scrollz>(2560-640-50))
							         { 
							          up=1;
 							        	
							         }; 
							       
							       if (in==1) if  (SndChannelBusy(sndc3)==FALSE) SndPlay(sndc3,sndwar,TRUE);  };  
							     
							     
							     /* ---- */
							     if (scrollz>=2560-640-1) {
							     
							      for (i=0;i<=4;++i)
							       { lv3[i][0]=100;
							         lv3[i][1]=280;
							         
							       };
							     
							      };
							     
							     
							     
							     
							     }; 

/* +++++++++++++++++++++++++++++++++++++++   LEVEL 3   ++++++++++++++++ */




 /* +++++++++++++++++++++++++++++++++++++++   LEVEL 5   ++++++++++++++++ */
  
							     if (level==5) {

									if ((in==1) && (zg_didit==0) && (zg_gameover==0))
									 if (scrollz<(2560-640-32)) 
										{

   if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndwar,TRUE); else
      if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndwar,TRUE); };
      
      							     
							        if (in==0)
							            if  (((scrollz+1)>(2560-640-160)) && ((scrollz+1)<(2560-640-70))) { 							       
 														 			  abweich=10;
 														 					       retus[spritezlr-abweich][0]=320;
 																			       retus[spritezlr-abweich][1]=50;
													                               retus[spritezlr-abweich][2]=RandomInt(2) ;
													                               retus[spritezlr-abweich][3]=16;
													                               retus[spritezlr-abweich][4]=16;
													                               retus[spritezlr-abweich][5]=64;
													                               retus[spritezlr-abweich][6]=64;
													                               retus[spritezlr-abweich][9]=5; 
                                                                                   retus[spritezlr-abweich][11]=30; // anzahl Schuesse
													                               retus[spritezlr-abweich][18]=scrollz;
													                               retus[spritezlr-abweich][19]=3; 
                                                                                   retus[spritezlr-abweich][20]=0;    
														              
														             ozlr=0;
														          	for (i=0;i<=2;++i)  { retus[spritezlr-abweich+i+1][11]=18;  			// anzahl Schuesse
														                                  retus[spritezlr-abweich+i+1][3]=17; 
														                                  retus[spritezlr-abweich+i+1][4]=17; 
														                                 };
														              obz1=0;
														              obz2=20;																				
																      in=1; // DAS OBERMONSTER
																      penda=628-50;
																      pendb=1;
																   
																};

							   if (in==1)
								if ( retus[spritezlr-abweich][4]==16) { 
																   
																   
 														 		   if (pendb==1) penda=penda-2; if (penda<314+20) pendb=0;
 														 		   if (pendb==0) penda=penda+2; if (penda>628-25) pendb=1; 
 														 			
 														 			retus[spritezlr-abweich][0]=400+(int) (cos((double) (penda)/100)*180);
 																	retus[spritezlr-abweich][1]=400+(int) (sin((double) (penda)/100)*350);
																   
																   
																   obz1=obz1+10; if (obz1>627) obz1=0;      // Winkel
								 								   win5=win5+20; if (win5>627) win5=0;
								 								   retus[spritezlr-abweich][18]=scrollz;

												
												++ozlr;
												if ((retus[spritezlr-abweich][2]==7) && (RandomInt(2)==0) && (ozlr>10))
												 {	q=0;
												      for (ax=spritezlr-abweich;ax<=spritezlr;++ax) // bei 3 beginnt man allgemein
                                                         if (retus[ax][4]==0)
                                                          if (q==0)
                                                         {  q=1;
                                                            ozlr=0;
                                                             retus[ax][0]=retus[spritezlr-abweich][0]+16;
                                                             retus[ax][1]=retus[spritezlr-abweich][1]+32+4; 
                                                             retus[ax][11]=2;             
                                                           
                                                             retus[ax][5]=24;
                                                             retus[ax][6]=24;
                                                             retus[ax][3]=5;     
                                                             retus[ax][4]=5;             
                                                             retus[ax][9]=5;             
                                                             retus[ax][19]=3;             
                                                             retus[ax][18]= retus[spritezlr-abweich][18];             												   
									  						 
					                   						 retus[ax][13]=-8;;
								  	   						 retus[ax][14]=0;                                              
												   
												   }; };

													                             
								for (i=0;i<=2;++i) 
											//if (retus[spritezlr-abweich+i+1][3]==17) 
								                {   d1=cos(((double) (obz1)+(double) (i)*200)/100)*(64+(double)(obz2)+cos((double) (win5)/100)*50);
							 					       d2=sin(((double) (obz1)+(double) (i)*200)/100)*(64+(double)(obz2)+cos((double) (win5)/100)*50);
							 					       retus[spritezlr-abweich+i+1][0]=retus[spritezlr-abweich][0]+16+(int) (d1);
												       retus[spritezlr-abweich+i+1][1]=retus[spritezlr-abweich][1]+16+(int) (d2);
						                               retus[spritezlr-1-i-1][11]=3;
						                               retus[spritezlr-abweich+i+1][3]=17;
						                               retus[spritezlr-abweich+i+1][4]=17;
						                               retus[spritezlr-abweich+i+1][5]=32;
						                               retus[spritezlr-abweich+i+1][6]=32;
						                               retus[spritezlr-abweich+i+1][9]=0; 
	                                              
						                               retus[spritezlr-abweich+i+1][18]=retus[spritezlr-abweich][18];
						                               retus[spritezlr-abweich+i+1][19]=3; 
	                                                   retus[spritezlr-abweich+i+1][20]=0;    
												
												 
												 if (retus[spritezlr-abweich+i+1][2]==4)
												   if (RandomInt(5)==0)
												    { q=0;
												      for (ax=spritezlr-abweich;ax<=spritezlr;++ax) // bei 3 beginnt man allgemein
                                                         if (retus[ax][4]==0)
                                                          if (q==0)
                                                         {  q=1;
                                                             retus[ax][0]=retus[spritezlr-abweich+i+1][0]+16;
                                                             retus[ax][1]=retus[spritezlr-abweich+i+1][1]+16; 
                                                           
                                                             retus[ax][5]=16;
                                                             retus[ax][6]=16;
                                                             retus[ax][3]=5; 
                                                             retus[ax][4]=5;             
                                                             retus[ax][19]=3;             
                                                             retus[ax][11]=1;             
                                                             retus[ax][18]= retus[spritezlr-abweich+i+1][18];             
												   
									  						 retus[ax][9]=5;
					                   						 r=retus[0][18]+retus[0][5]/2+retus[0][0]-(retus[spritezlr-abweich+i+1][18]+retus[spritezlr-abweich+i+1][5]/2+retus[spritezlr-abweich+i+1][0]) ;
					                   						 rr=retus[0][1]-retus[spritezlr-abweich+i+1][1]-retus[spritezlr-abweich+i+1][6]/2;                                          
					                   						 retus[ax][13]=7*r/sqrt(r*r+rr*rr);
								  	   						 retus[ax][14]=7*rr/sqrt(r*r+rr*rr);                                              
												   
												   }; };
												 };





								
								 // Bei der ZErstrung diese 4 Sprites umndern ins  schnell !!
								 if ((in==1) &&  (retus[spritezlr-abweich][3]!=16))
								 { in=2; // evtl Schrei
								   inz=0;
								
								   for (i=0;i<=2;++i) 
								    if (retus[spritezlr-abweich+i+1][4]==17)
								      { retus[spritezlr-abweich+i+1][9]=5; // EXTRAS ?
					                   r=retus[0][18]+retus[0][5]/2+retus[0][0]-(retus[spritezlr-abweich+i+1][18]+retus[spritezlr-abweich+i+1][5]/2+retus[spritezlr-abweich+i+1][0]) ;
					                   rr=retus[0][1]-retus[spritezlr-abweich+i+1][1]-retus[spritezlr-abweich+i+1][6]/2;                                          
					                   retus[spritezlr-abweich+i+1][13]=10*r/sqrt(r*r+rr*rr);
								  	   retus[spritezlr-abweich+i+1][14]=10*rr/sqrt(r*r+rr*rr);                                              
                                      // retus[spritezlr-1-i-1][18]=retus[i][18];
								       

								     }; 

								  zg_didit=1;
														SetPort((GrafPtr) bsack);
	
 														apple=GetPicture(141);
  														SetRect(&rec,0,0,640,100);
  														HUnlock((Handle) apple);
  														DrawPicture(apple,&rec);               
  														ReleaseResource((Handle) apple); 

								 }; // ein Schmerzenschrei
								 // ENDE LEVEL IN==3  keine GEGNER MEHR !!
								}; 
								
                               
                                if (in==2) ++inz; 
                               };
/* +++++++++++++++++++++++++++++++++++++++   LEVEL 5   ++++++++++++++++ */

 /* +++++++++++++++++++++++++++++++++++++++   LEVEL 5   ++++++++++++++++ */
 
       /* %%%%%%%%%%%%%%%%%%%%%%% LEVEL 8 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */                         
   
   
 
							     if (level==8) {

									if ((in==1) && (zg_didit==0) && (zg_gameover==0))
									 if (scrollz<(2560-640-32)) 
										{

   if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndwar,TRUE); else
      if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndwar,TRUE); };
      
      							     
							        if (in==0)
							            if  (((scrollz+1)>(2560-640-160)) && ((scrollz+1)<(2560-640-70))) { 							       
 														 			  abweich=10;
 														 					       retus[spritezlr-abweich][0]=550;
 																			       retus[spritezlr-abweich][1]=200;
													                               retus[spritezlr-abweich][2]=RandomInt(2) ;
													                               retus[spritezlr-abweich][3]=16;
													                               retus[spritezlr-abweich][4]=16;
													                               retus[spritezlr-abweich][5]=64;
													                               retus[spritezlr-abweich][6]=64;
													                               retus[spritezlr-abweich][9]=12; 
                                                                                   retus[spritezlr-abweich][11]=40; // anzahl Schuesse
													                               retus[spritezlr-abweich][18]=scrollz;
													                               retus[spritezlr-abweich][19]=3; 
                                                                                   retus[spritezlr-abweich][20]=0;    
														                           
														             ozlr=0;
													/*	          	for (i=0;i<=2;++i)  { retus[spritezlr-abweich+i+1][11]=9;  			// anzahl Schuesse
														                                  retus[spritezlr-abweich+i+1][3]=17; 
														                                  retus[spritezlr-abweich+i+1][4]=17; 
														                                 }; */
														              obz1=0;
														              obz2=20;																				
																      in=1; // DAS OBERMONSTER
																      penda=628-50;
																      pendb=1;
																   
																};

							   if (in==1)
								if ( retus[spritezlr-abweich][4]==16) { 
																   
 														 		   
																     
  																   i=spritezlr-abweich;
  																   tax=retus[i][9]-11;                   					                                                                 
																   tz=0;
																   tez=2;
																								
																	while (tz<tez) { ++tz;
																								if (retus[i][4]!=0) 
																								 { 
                   					                                                                 zlr=retus[i][20];
                   					                                                                
                   					                                                                
                   					                                                                 if (zlr>4999) {   retus[i][4]=5; retus[i][3]=5 ; tz=25; };                       
                   					                                                                 
                   					                                      
                   					                                                             //    retus[i][0]=retus[i][0]+*(soptr[tax]+zlr*2*sizeof(char));                   					                                                         
                    					                                                         //    retus[i][1]=retus[i][1]+*(soptr[tax]+zlr*2*sizeof(char)+1);
                     					                   
                     					                                                             if (  *(soptr[tax]+(zlr+1)*2*sizeof(char))==101) 
                     					                                                             {  
                                
                     					                                                                             tz=25; 
                     					                                                             
                     					                                                                
                     					                                                                retus[i][0]=550;
                     					                                                                retus[i][1]=200;
                     					                                                                retus[i][20]=0;
                     					                                                                retus[i][9]=12+RandomInt(4);
                     					                                                             };
                     					                                                         }  else ;//?	
                     					                                                        };												
													              
													               
													
								 								   retus[spritezlr-abweich][18]=scrollz;

												
												++ozlr;
												if ((retus[spritezlr-abweich][2]==7) && (RandomInt(2)==0) && (ozlr>10))
												 {	q=0;
												      for (ax=spritezlr-abweich;ax<=spritezlr;++ax) // bei 3 beginnt man allgemein
                                                         if (retus[ax][4]==0)
                                                          if (q==0)
                                                         {  q=1;
                                                            ozlr=0;
                                                             retus[ax][0]=retus[spritezlr-abweich][0]+16;
                                                             retus[ax][1]=retus[spritezlr-abweich][1]+32+4; 
                                                             retus[ax][11]=2;             
                                                           
                                                             retus[ax][5]=24;
                                                             retus[ax][6]=24;
                                                             retus[ax][3]=9;     
                                                             retus[ax][4]=9;             
                                                             retus[ax][9]=5;             
                                                             retus[ax][19]=3;             
                                                             retus[ax][18]= retus[spritezlr-abweich][18];             												   
									  						 
					                   						 retus[ax][13]=-8;;
								  	   						 retus[ax][14]=0;                                              
												   
												   }; };

								/* von unten gehts los */					                             
						
												 
												
												   if (RandomInt(5)==0)
												    { q=0;
												      for (ax=spritezlr-abweich;ax<=spritezlr;++ax) // bei 3 beginnt man allgemein
                                                         if (retus[ax][4]==0)
                                                          if (q==0)
                                                         {  q=1;
                                                             retus[ax][0]=RandomInt(640);
                                                             retus[ax][1]=400; 
                                                           
                                                             retus[ax][5]=32;
                                                             retus[ax][6]=32;
                                                             retus[ax][3]=17; 
                                                             retus[ax][4]=17;             
                                                             retus[ax][19]=3;             
                                                             retus[ax][11]=1;             
                                                             retus[ax][18]=scrollz;          
												   
									  						 retus[ax][9]=5;
					                   						 retus[ax][13]=1;
								  	   						 retus[ax][14]=-1-RandomInt(5);                                              
												   
												   }; };
											





								
								 // Bei der ZErstrung diese 4 Sprites umndern ins Zielen schnell !!
								 if ((in==1) &&  (retus[spritezlr-abweich][3]!=16))
								 { in=2; // evtl Schrei
								   inz=0;
								
								   for (i=0;i<=2;++i) 
								    if (retus[spritezlr-abweich+i+1][4]==17)
								      { retus[spritezlr-abweich+i+1][9]=5; // EXTRAS ?
					                   r=retus[0][18]+retus[0][5]/2+retus[0][0]-(retus[spritezlr-abweich+i+1][18]+retus[spritezlr-abweich+i+1][5]/2+retus[spritezlr-abweich+i+1][0]) ;
					                   rr=retus[0][1]-retus[spritezlr-abweich+i+1][1]-retus[spritezlr-abweich+i+1][6]/2;                                          
					                   retus[spritezlr-abweich+i+1][13]=10*r/sqrt(r*r+rr*rr);
								  	   retus[spritezlr-abweich+i+1][14]=10*rr/sqrt(r*r+rr*rr);                                              
                                      // retus[spritezlr-1-i-1][18]=retus[i][18];
								       

								     }; 

								  zg_didit=1;
														SetPort((GrafPtr) bsack);
	
 														apple=GetPicture(141);
  														SetRect(&rec,0,0,640,100);
  														HUnlock((Handle) apple);
  														DrawPicture(apple,&rec);               
  														ReleaseResource((Handle) apple); 

								 }; // ein Schmerzenschrei
								 // ENDE LEVEL IN==3  keine GEGNER MEHR !!
								}; 
								
                               
                                if (in==2) ++inz; 
                               };
      /* %%%%%%%%%%%%%%%%%%%%%%% LEVEL 8 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */                         
   if (level==11) {
							
             /*  DAS BILD WIRD GEZEICHNET */
             
							        if (in==0)
							            if  (scrollz==(2560-640-100)) {	 schiessz=1000;	
							            
							            
							            
    /* WAS PASSIERT MIT DEM SPEICHER - RUCKEN ????? 
    SetPort((GrafPtr) bsack);
 
    apple=GetPicture(128);
    SetRect(&rec,0,400-198,243,400 );
    HUnlock((Handle) apple);
    DrawPicture(apple,&rec);               
    ReleaseResource((Handle) apple);  */

							            
							            };			
					
			/* DER ACHTUNG LAUT */
									if ((in==1) && (zg_didit==0) && (zg_gameover==0))
									 if (scrollz<(2560-640-32)) 
										{  schiessz=700;	
										

   if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndwar,TRUE); else
      if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndwar,TRUE); };


      
      							     
							        if (in==0)
							            if  (scrollz==(2560-640-50)) { 	
							              
							              
							  /* LOESCHEN */      
							  for (rrst=0;rrst<=2;++rrst){ 
							   abweich=9+rrst;
								 retus[spritezlr-abweich][4]=0;};
								 
												       

/* MONSTER 1 */

 														 		for (rrst=0;rrst<=2;++rrst){														     
																	  abweich=9+rrst;
 														 			  
 														 					       retus[spritezlr-abweich][0]=550;
 																			       retus[spritezlr-abweich][1]=200;
													                               retus[spritezlr-abweich][2]=RandomInt(2) ;
													                               retus[spritezlr-abweich][3]=16;
													                               retus[spritezlr-abweich][4]=16;
													                               retus[spritezlr-abweich][5]=64;
													                               retus[spritezlr-abweich][6]=64;
													                               retus[spritezlr-abweich][9]=12; 
                                                                                   retus[spritezlr-abweich][11]=40; // anzahl Schuesse
													                               retus[spritezlr-abweich][18]=scrollz;
													                               retus[spritezlr-abweich][19]=3; 
                                                                                   retus[spritezlr-abweich][20]=0;    

																			}; 

														             ozlr=0;

														              obz1=0;
														              obz2=20;																				
																      in=1; // DAS OBERMONSTER
																      penda=628-50;
																      pendb=1;
																   
																};

  /* EXPLOSION  ? ALLES ZU ENDE  */
   if (in==1) {
							i=0;
							for (rrst=0;rrst<=2;++rrst){ 
							   abweich=9+rrst;
								if ( retus[spritezlr-abweich][4]==16) {
								 ++i;
								}; };
							if (i==0) {  in=2; inz=0; };
							
							/* SPEZIELLER SOUND */
							};


										if (in==2) { ++inz;  // das entgltige Ende
													 if (zg_didit==0)
													 { /* GAME OVER UND I DID IT*/
														SetPort((GrafPtr) bsack);
	
 														apple=GetPicture(141);
  														SetRect(&rec,0,0,640,100);
  														HUnlock((Handle) apple);
  														DrawPicture(apple,&rec);               
  														ReleaseResource((Handle) apple); 
													    if  (SndChannelBusy(sndc3)==FALSE) SndPlay(sndc3,sworco,TRUE); 
													 score=score+10000;
													 zg_score=1;
													   
													zg_didit=1;   
													  
													 }; };


							   /* DAS MONSTER WUETET UND ZWAR RICHTIG ZU ZWEIT */
							  
							
							   if (in==1)
							for (rrst=0;rrst<=2;++rrst){ 
							   abweich=9+rrst;
								if ( retus[spritezlr-abweich][4]==16)
								
								 {
 														 		 
 														 														     
  																   i=spritezlr-abweich;
  																   tax=retus[i][9]-11;                   					                                                                 
																   tz=0;
																   tez=2;
																								
																	while (tz<tez) { ++tz;
																								if (retus[i][4]!=0) 
																								 { 
                   					                                                                 zlr=retus[i][20];
                   					                                                                
                   					                                                                
                   					                                                                 if (zlr>4999) {   retus[i][4]=5; retus[i][3]=5 ; tz=25; };                       
                   					                                                                 
                    					                   
                     					                                                             if (  *(soptr[tax]+(zlr+1)*2*sizeof(char))==101) 
                     					                                                             {  
                                
                     					                                                                             tz=25; 
                     					                                                             
                     					                                                                
                     					                                                                retus[i][0]=550;
                     					                                                                retus[i][1]=200;
                     					                                                                retus[i][20]=0;
                     					                                                                retus[i][9]=12+RandomInt(4);
                     					                                                             };
                     					                                                         }  else ;//?	
                     					                                                        };												
													              
													               
													
								 								   retus[spritezlr-abweich][18]=scrollz;

												
												++ozlr;
												if ((retus[spritezlr-abweich][2]==7) && (RandomInt(2)==0) && (ozlr>10))
												 {	q=0;
												      for (ax=spritezlr-abweich;ax<=spritezlr;++ax) // bei 3 beginnt man allgemein
                                                         if (retus[ax][4]==0)
                                                          if (q==0)
                                                         {  q=1;
                                                            ozlr=0;
                                                             retus[ax][0]=retus[spritezlr-abweich][0]-16;
                                                             retus[ax][1]=retus[spritezlr-abweich][1]+32+4; 
                                                             retus[ax][11]=2;             
                                                           
                                                             retus[ax][5]=24;
                                                             retus[ax][6]=24;
                                                             retus[ax][3]=5;  // hier ein spezieller grosser Schuss !!!     
                                                             retus[ax][4]=5;             
                                                             retus[ax][9]=5;             
                                                             retus[ax][19]=3;             
                                                             retus[ax][18]= retus[spritezlr-abweich][18];             												   
									  						 
					                   						 retus[ax][13]=-8;;
								  	   						 retus[ax][14]=0;                                              
												   
												   }; };

								
								 // Bei der ZErstrung diese 4 Sprites umndern ins Zielen schnell !!
								 if ((in==1) &&  (retus[spritezlr-abweich][3]!=16) &&  (retus[spritezlr-(abweich-1)][3]!=16))
								 {
								 }; // ein Schmerzenschrei
								
								
								
								
														
								}; 
								
                               
                                if (in==2) ++inz; 
                                  
   
   
   
   
   }; };
   
   
   
   /* CHEATS ------------------- */
   							if (CHEAT==1)
        	                       { if  (BitTst(&theKeys,14)==TRUE)  scrollz=1500;   // CHEAT   
							   
							       if  (BitTst(&theKeys,7)==TRUE)  {
							                                
							                                   // SetRect(&rec,0,400-198,243,400 );
                                                                           
                                                       		SetRect(&re, 0,0,640,400);				                                       
                                                       		SetRect(&ri, 0,40,640,440);				                                       					                                       
					                                        CopyBits(&((GrafPtr) anima)->portBits,&(((GrafPtr)  firstWin)->portBits),&re,&ri ,srcCopy, 0L);         
							       
							        do; while(Button()==false);
							        do; while(Button()==true);

							                                                                                                           
                                                       		SetRect(&re, 0,0,640,400);				                                       
                                                       		SetRect(&ri, 0,40,640,440);				                                       					                                       
					                                        CopyBits(&((GrafPtr) muriel)->portBits,&(((GrafPtr)  firstWin)->portBits),&re,&ri ,srcCopy, 0L);         
							       
							        do; while(Button()==false);
							        do; while(Button()==true);

                                                       		SetRect(&re, 0,0,640,400);				                                       
                                                       		SetRect(&ri, 0,40,640,440);				                                       					                                       
					                                        CopyBits(&((GrafPtr) nima)->portBits,&(((GrafPtr)  firstWin)->portBits),&re,&ri ,srcCopy, 0L);         
							       
							        do; while(Button()==false);
							        do; while(Button()==true);

							       }; };//CHEAT 
							       
   							//if (quicktimei==0) {
/* Der HIntergrundsound */  //if (in==0)  {  if  (SndChannelBusy(sndc2)==FALSE) SndPlay(sndc2,hinter[RandomInt(3)],TRUE); }
 				            //else        {  if  (SndChannelBusy(sndc2)==FALSE) SndPlay(sndc2,hinter[7],TRUE); };};
 				            

								                      SetPort((GrafPtr) firstWin);
                                                      if (scrollz<(2560-640)) ++scrollz;
                                                   

                                                   //   if (level==2)  if (scrollz<(2560-640)) scrollz=scrollz+3;  // HIGHSPEEDLEVEL
/*=========== DIE OBERMONSTER ============*/
                                                       if ((level+1)%4==0)
                                                        if (scrollz==(2560-640)) { /* DIE OBERMONSTER */
                                                                   /* DAS IMMER WIEDER */
                                                         /* beginnt bei 0 */
                                       /* =========ERSTE MOMENT DER  E TRITT EIN========
                                                         if (obert==0) { obert=1;
                                                         q=0; 
                                                        for (ax=2;ax<=spritezlr ;++ax)
                                                         {
                                                         if (retus[ax][4]==0)
                                                          if (q==0)
                                                         {  q=1;

 														 					       retus[ax][0]=520;
 																			       retus[ax][1]=200;
													                               retus[ax][2]=RandomInt(2) ;
													                               retus[ax][3]=16;
													                               retus[ax][4]=16;
													                               retus[ax][5]=64;
													                               retus[ax][6]=64; 
                                                                                   retus[ax][11]=7;
													                               retus[ax][18]=2560-640;
													                               retus[ax][19]=3; 
                                                                                   retus[ax][20]=0;    

                                                                                    if (RandomInt(2)==0)  retus[ax][9]=14; else  retus[ax][9]=15  ;

                                                                                 // retus[ax][9]=0;    
                                                                                   
                                                                                };
                                                         };

                                                        q=0; 
                                                        for (ax=2;ax<=spritezlr ;++ax)
                                                         {
                                                         if (retus[ax][4]==0)
                                                          if (q==0)
                                                         {  q=1;

 														 					       retus[ax][0]=520;
 																			       retus[ax][1]=200;
													                               retus[ax][2]=RandomInt(3) ;
													                               retus[ax][3]=16;
													                               retus[ax][4]=16;
													                               retus[ax][5]=64;
													                               retus[ax][6]=64; 
                                                                                   retus[ax][11]=7;
													                               retus[ax][18]=2560-640;
													                               retus[ax][19]=3; 
                                                                                   retus[ax][20]=0;    

                                                                                    if (RandomInt(2)==0)  retus[ax][9]=14; else  retus[ax][9]=15  ;

                                                                                 // retus[ax][9]=0;    
                                                                                   
                                                                                };
                                                         };
                                                         
                                                         
                                                          };  */
                                       /* =========ERSTE MOMENT DER ALTE TRITT EIN======== */

                                                         ++wieder;
                                                         if (wieder>50) wieder=0;
                                                         
                                                         if (wieder==0)
                                                         { wieder=1;
                                                           
                                                          
                                                          
                                                          }; 
                                                             
                                                             
                                                           };
/*=========== DIE OBERMONSTER ============*/

                       // FREEZE ETC
                                      if (holdzlr>=0)  { --holdzlr;            
											                       if (holdzlr>=0) {
											                       
											                          retus[2][0]=retus[0][0]-5;
											                          retus[2][1]=retus[0][1]-5;
											                          retus[2][5]=retus[0][5]+10;
											                          retus[2][6]=retus[0][6]+10;
											                       
											                        retus[2][3]=11;
											                        retus[2][18]=retus[0][18];
											                        retus[2][19]=2;
											                        retus[2][4]=11;
											                        if (holdzlr>=40) retus[2][2]=4;
											                        if (holdzlr<40) retus[2][2]=holdzlr/10;
											                       };           

                                                                   if (holdzlr==-1) { retus[2][4]=1; retus[2][2]=1; retus[2][3]=1; retus[2][19]=5; retus[2][9]=0;
                                                                                    };

                                                                                                    
                                                        } ;
                                                        
                                                                 
                                                    
                                                  
                                                   
                                                   /* -------------- ---------------- SPRITE MAGNAMANT ------------------------ */
                                                  if (zg_didit==0)
                                                    for (i=0;i <=199;++i)
                                                     { 
                                      // EASY WAY ...

                                                  if (easy==1) {
                                                     if ((scrollz-1)==toota[i][0])
                                                     
                                                     if (toota[i][5]==0) easyz=0;
                                                      if (toota[i][5]==2) easyz=0;
                                                      if (toota[i][5]==11) easyz=0;
                                                      if (toota[i][5]==12) easyz=0;
                                                      if (toota[i][5]==13) easyz=0;
                                                      if (toota[i][5]==14) easyz=0;
                                                      if (toota[i][5]==15) easyz=0;
                                                      
                                                       ++easyz; 
                                                      if ((level<6) && (level>2)) if (easyz>2) easyz=0; 
                                                      if (level>5) if (easyz>2) easyz=0;  
                                                      } else
                                                      { easyz=1; };
													
													// DER LETZTE LEVEL WILL NEVER BE EASY !!
													if (level>8)  easyz=1;

                                                     if (easyz!=0)
                                                      if ((scrollz-1)==toota[i][0])                                                      
                                                         for (ax=3;ax<=spritezlr ;++ax) // bei 3 beginnt man allgemein
                                                         {  q=0; 
                                                         if (retus[ax][4]==0)
                                                          if (q==0)
                                                         {  q=1;
                                                             retus[ax][0]=toota[i][1];
                                                             retus[ax][1]=toota[i][2];
                                                             retus[ax][2]=RandomInt(9);
                                                             retus[ax][3]=toota[i][5]; 
                                                             retus[ax][4]=2;                              
                                                             retus[ax][5]=toota[i][3];
                                                             retus[ax][6]=toota[i][4];
                                                             retus[ax][18]=scrollz;
                                                            
                                                                                         // toota[i][6]; // ANZAHL   
														if (level==0) {
															
															/* das GROESSER-WERDEN */
															
															retus[ax][27]=retus[ax][5];
															retus[ax][28]=retus[ax][6];
															retus[ax][29]=0;};

                                                            retus[ax][9]=toota[i][7]; //BEWEGUNG

                                                            retus[ax][11]=1; // ANZAHL TREFFER
 														    
 														    /* TREFF  */
                                                            if (retus[ax][3]==8)  retus[ax][11]=3; // die Abschussstation
                                                            if (retus[ax][3]==18)  retus[ax][11]=4; // grsser und kleiner
                                                            
                                                              /* ZIELEN */                                     
                                                             if (retus[ax][9]==5) { 
																			                                                            /* ZIELEN */
							           retus[ax][9]=5; // EXTRAS ?
					                   r=retus[0][18]+retus[0][5]/2+retus[0][0]-(retus[ax][18]+retus[ax][5]/2+retus[ax][0]) ;
					                   rr=retus[0][1]-retus[ax][1]-retus[ax][6]/2;                                          
					                   retus[ax][13]=15*r/sqrt(r*r+rr*rr);
								  	   retus[ax][14]=15*rr/sqrt(r*r+rr*rr);                                              
                             			                                                          
																			                                                            /* ZIELEN */																											                                                            retus[ax][19]=3;     //GEGNER 
                                                                                                   };

                                                          
                                                             if (retus[ax][9]==1) { /*retus[ax][9]=5;
                                                                                                  retus[ax][13]=0;*/
                                                                                                  retus[ax][14]=-3-RandomInt(4);
                                                                                               };
                                                             if (retus[ax][9]==2) { /* retus[ax][9]=5;
                                                                                                  retus[ax][13]=0;*/
                                                                                                  retus[ax][14]=3+RandomInt(4);
                                                                                               };
                                                                                               
                                                                                               
                                                            if (retus[ax][9]==4) { //retus[ax][9]=5;
                                                             									  retus[ax][14]=0; 
                                                                                                  if (y>retus[ax][1])  retus[ax][14]=+5; 
                                                                                                     else              retus[ax][14]=-5; 
                                                                                                  
                                                                                                  retus[ax][13]=+3+RandomInt(4);
                                                                                                  retus[ax][29]=retus[ax][1]*15;
                                                                                               };

                                                             if (retus[ax][9]==3) { retus[ax][9]=5;
                                                                                                  retus[ax][14]=0;
                                                                                                  retus[ax][13]=3+RandomInt(4);
                                                                                               };
                                                                                               
                                                                                               
                                                          
                                                             /*     die Bouncings  */
                                                             if (retus[ax][9]==7) {  retus[ax][14]=3+RandomInt(4);
                                                                                     retus[ax][13]=-3-RandomInt(2);
                                                                                               
                                                                                                 };      
 
                                                             /*     die Bouncings  */
                                                             if (retus[ax][9]==8) {  retus[ax][14]=3+RandomInt(4);
                                                                                                   retus[ax][13]=-4-RandomInt(3);
                                                                                                  retus[ax][9]=8;
                                                                                                   retus[ax][16]=0;
                                                                                                  retus[ax][15]=0;
                                                                                                  if (RandomInt(2)==0) retus[ax][17]=1; else retus[ax][17]=-1;
                                                                                               };      
 
                                                               /*     die Bouncings  */
                                                             if (retus[ax][9]==9) {  retus[ax][14]=3+RandomInt(4);
                                                                                                   retus[ax][13]=-4-RandomInt(3);
                                                                                                  retus[ax][9]=9;
                                                                                                  retus[ax][16]=0;
                                                                                                  retus[ax][15]=0;
                                                                                                  if (RandomInt(2)==0) retus[ax][17]=1; else retus[ax][17]=-1;
                                                                                                  };      

						                            	 
						                            	  /*  RAKETEN DIE WARTEN  */
                                                             if (retus[ax][3]==6)  {  retus[ax][2]=9;
                                                                                      retus[ax][9]=0;
                                                                                                  
                                                                                                };
						                            	 
						                            	 
						                            	 /*  EINE RAUMSTATION */
                                                             if (retus[ax][3]==4)  {  retus[ax][11]=4;
                                                                                                   retus[ax][5]=32;
                                                                                                   retus[ax][6]=32;  
                                                                                                };
						                            	 /*  OHNE INHALT */
                                                            if (retus[ax][3]==15)  {  retus[ax][3]=15;
                                                             							retus[ax][2]=0;
                                                                                        retus[ax][12]=9;
                                                                                        retus[ax][19]=3;
                                                            
                                                                                    }; 
													
                                                             if (retus[ax][3]==17)  {  retus[ax][11]=3;
                                                                                                };


                                                            /*  DER OBERMOTZ */
                                                            if (retus[ax][3]==16) { 
                                                                                                  retus[ax][5]=64;
                                                                                                  retus[ax][6]=64;
                                                                                                  retus[ax][11]=10; // ANZAHL TREFFER

                                                                                              };

 
  														 /*  POWER  */
                                                             if (retus[ax][3]==2)  {    retus[ax][3]=15;
                                                             							retus[ax][2]=0;
                                                                                        retus[ax][12]=3;
                                                                                        retus[ax][19]=3;
                                                                                                 };     
 
 
  														 /*  SHIELD > */
                                                             if (retus[ax][3]==10)  {   retus[ax][3]=15;
                                                             							retus[ax][2]=0;
                                                                                        retus[ax][12]=5;
                                                                                        retus[ax][19]=3;
                                                                                                 };     
 
 
  														 /*  EXPLOSION */
                                                             if (retus[ax][3]==14)  {    retus[ax][3]=15;
                                                             							retus[ax][2]=0;
                                                                                        retus[ax][12]=7;
                                                                                        retus[ax][19]=3;
                                                                                                 };     

 
  														 /*  BACK  */
                                                             if (retus[ax][3]==12) {    retus[ax][3]=15;
                                                             							retus[ax][2]=0;
                                                                                        retus[ax][12]=4;
                                                                                        retus[ax][19]=3;
                                                                                                 };     
 														 /*  DOPPEL  */
                                                             if (retus[ax][3]==13) {    retus[ax][3]=15;
                                                             							retus[ax][2]=0;
                                                                                        retus[ax][12]=2;
                                                                                        retus[ax][19]=3;
                                                                                                 };     
 														 /*  1UP  */
                                                             if (retus[ax][3]==0) {     retus[ax][3]=15;
                                                             							retus[ax][2]=0;
                                                                                        retus[ax][12]=6;
                                                                                        retus[ax][19]=3;
                                                                                                 }; 
            											/*  SHIELD o */
                                                             if (retus[ax][3]==11) {    retus[ax][3]=15;
                                                             							retus[ax][2]=0;
                                                                                        retus[ax][12]=8;
                                                                                        retus[ax][19]=3;
                                                                                                 };     
                                                                                         



 															    /* DIE VORGEGEBENEN KURVEN */
                                                                                                                                
                                                             if (retus[ax][9]>10) { retus[ax][20]=0; // Zhler
                                            
                                                                                                };
                                                             
                                                            
                                                            retus[ax][19]=3;     //GEGNER 
                                                           
                                                            // EXPLOSION
                                                            if (retus[ax][3]==1) { retus[ax][19]=1;
																			//4001
                                                    /*                 SetRect(&ri, retus[ax][18]+retus[ax][0]-16,retus[ax][1]-16,retus[ax][18]+retus[ax][0]+47,retus[ax][1]+16);
  
																	 SetRect(&re,320+32+64,0,320+32+64+64,32); 
									 								 CopyBits(&((GrafPtr)  anima )->portBits,&(((GrafPtr)  bsack)->portBits),&re,&ri,36, 0L);                      

                                                                     SetRect(&ri, retus[ax][18]+retus[ax][0]-16,retus[ax][1]+16,retus[ax][18]+retus[ax][0]+48,retus[ax][1]+32+16);
																	 SetRect(&re,320+32,0,320+64+32,32);   
									 								 CopyBits(&((GrafPtr)  anima )->portBits,&(((GrafPtr)  bsack)->portBits),&re,&ri,36, 0L);                      
        																*/
                                                                                   
                                                                                 };
                                                          // mousewait();
                                                          toota[i][0] =5000;
                                                           ax=200;
                                                         };
                                                    }; };


                                                   /* ------------------------------ SPRITE MAGNAMANT ------------------------ */
                                                        if (tode==0)
                                                        {
                                                        
                                                                                      
                                                        if (kontrol==0) { /* MMMOOUUUUUSSSEEE */
                                                         
                                                                                      SetPort((GrafPtr) bsack);
															GetMouse(&mousepix);  
                                                            grx=mousepix.h-aint;
                                                            gry=mousepix.v-aaint; 

                                                            sx=grx-100;
                                                            sy=gry-100;
                                                            
                                                            if (sx>4) sx=4;
                                                            if (sx<-4) sx=-4;
                                                            if (sy>4) sy=4;
                                                            if (sy<-4) sy=-4;
                                                             
                                                            x=x+sx;
                                                            y=y+sy;
                                                            
                                                            
                                                            
                                                         };



                                                        if (kontrol==1) { /* KKKKKKEEEEEEYYYYYYYY */
                                                          if  (BitTst(&theKeys,123)==TRUE)  x=x+5+speedv;    
                                                          if  (BitTst(&theKeys,124)==TRUE)  x=x-5-speedv;     
                                                          if  (BitTst(&theKeys,122)==TRUE)  y=y+4+speedvv;   
                                                          if  (BitTst(&theKeys,121)==TRUE)  y=y-4-speedvv ;   
                                                          
                                                           if  ((BitTst(&theKeys,95)==TRUE)  || (BitTst(&theKeys,91)==TRUE) || (BitTst(&theKeys,82 )==TRUE) )  x=x+5+speedv;    
                                                          if  ((BitTst(&theKeys,81)==TRUE)  || (BitTst(&theKeys,84)==TRUE)  || (BitTst(&theKeys,94)==TRUE) ) x=x-5-speedv;     
                                                          if  ((BitTst(&theKeys,83)==TRUE)  || (BitTst(&theKeys,84)==TRUE)  || (BitTst(&theKeys,82)==TRUE) ) y=y+4+speedvv;   
                                                          if  ((BitTst(&theKeys,92)==TRUE)   || (BitTst(&theKeys,91)==TRUE)   || (BitTst(&theKeys,94)==TRUE) )   y=y-4-speedvv;   

                                                          if  (BitTst(&theKeys,4)==TRUE)  x=x+5+speedv;    
                                                          if  (BitTst(&theKeys,6)==TRUE)  x=x-5-speedv;     
                                                          if  (BitTst(&theKeys,5)==TRUE)  y=y+4+speedvv;   
                                                          if  (BitTst(&theKeys,9)==TRUE)  y=y-4-speedvv;   
                                                           
                                                          
                                                          };
                                                            
                                                            
                                                           if (x<0) x=0;
                                                           if (y<0) y=0;
                                                          
                                                            if (y>(400-32)) y=400-32;
                                                             if (x>608) x=608; 
                                                              retus[0][0]=x;
                                                              retus[0][1]=y;
                                                              retus[0][5]=40;
                                                              retus[0][6]=32;
                                                              retus[0][18]=scrollz;

                                                       
	
                                                             
                                                            /* nach dem TODE DIE WIEDERAUFERSTEHUNG */                                                      
                                                              if (retus[0][3]==1) 
                                                                 if (retus[0][2]==8)   { 
                                                                     -- live;                             // SND AGAIN
                                                                     if  (live==-1)   tode=1;   // ENDE
                                                                         else     { holdzlr=90;
                                                                                                retus[0][19]=2; 
                                                                                                retus[0][4]=1;
                                                                                                retus[0][3]=0;
                                                                                                retus[0][5]=40;
                                                                                                retus[0][6]=32; 

                                                                                                }; };
                                                           //shield=1;
                                                            if (shield==1)
                                                           { 
                                                             retus[1][18]=scrollz;
                                                             retus[1][0]=x+43;
                                                             retus[1][1]=y+5;
                                                             retus[1][2]=shieldz;
                                                             retus[1][3]=10;
                                                             retus[1][4]=12;
                                                             retus[1][5]=20;
                                                             retus[1][6]=25;
                                                             retus[1][19]=2;
                                                             retus[1][9]=0;
                                                             
                                                             
                                                           };

														if (holdzlr>=0) {
											                          retus[2][0]=retus[0][0]-5;
											                        retus[2][1]=retus[0][1]-5;
											                          retus[2][5]=retus[0][5]+10;
											                          retus[2][6]=retus[0][6]+10;
											                        retus[2][9]=0;
											                        retus[2][3]=11;
											                        retus[2][18]=retus[0][18];
											                        retus[2][19]=2;
											                        retus[2][4]=11;
											                        if (holdzlr>=40) retus[2][2]=4;
											                        if (holdzlr<40) retus[2][2]=holdzlr/10;
											                                  

                                                                   if (holdzlr==-1) { retus[2][4]=1; retus[2][2]=1; retus[2][3]=1; retus[2][19]=5; retus[2][9]=0;
                                                                                    };
                                                                                      }; 
    

														};

                                                          
                                                     
                                                     // SPEEDKONTROLLE      
                                                          
                                                          /*  ++speed;
                                                             if (speed>spee) */
                                                            if (speedl+speedt>TickCount()) 
                                                             { speedl = TickCount();
                                                               speed=0; };
                                                      
                                                     /*  der Hintergrund wird kopiert */    
                                                          if (level==0)  {
                                                       	
                                                       	
                                                       	
                                                       		SetRect(&re, scrollz,0,scrollz+640,400);				                                       
                                                       		SetRect(&ri,0,0,640,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                            
                                                        };                                           
                                               
                                                               
														//   if (live==1)   {  if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndlastlive,TRUE); else
     													//						 if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndlastlive,TRUE); }; 
                                                                                                                  
                                                      
                                                        /*  if (level==2)  {
                                                       		SetRect(&re, ((scrollz*3)%2560),scrollx,((scrollz*3)%2560)+640,scrollx+127);				                                       
                                                       		SetRect(&ri, 0,0,640,127);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         

                                                       		SetRect(&re, ((scrollz*2)%2560),scrollx+127,((scrollz*2)%2560)+640,scrollx+213);				                                       
                                                       		SetRect(&ri, 0,127,640,213);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);                                                              
                                                                                                                  
                                                       		SetRect(&re, scrollz,scrollx+213,scrollz+640,scrollx+400);				                                       
                                                       		SetRect(&ri, 0,213,640,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                          }; 

  */
                                                          if (level==2) {                                  
                                                       		SetRect(&re, scrollz,scrollx,scrollz+640,scrollx+400);				                                       
                                                       		SetRect(&ri, 0,0,640,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                          };

                                                          if (level==1)  { // das Scrolling geht auch weiter wenn wir am Ende sind
                                                       		
                                                       		scz=scz-1; // der ewige Himmel
                                                       		if (scz<3*256) scz=6*256;
                                                       		
                                                       		if (y<127) x=x+2; // der Wind
                                                       		if (y<40) x=x+1;
                                                       		
                                                       		SetRect(&re, ((scz)%2560),scrollx,((scz)%2560)+640,scrollx+127);				                                       
                                                       		SetRect(&ri, 0,0,640,127);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         

                                                       		SetRect(&re, ((scrollz/2)%2560),scrollx+127,((scrollz/2)%2560)+640,scrollx+213);				                                       
                                                       		SetRect(&ri, 0,127,640,213);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);                                                              
                                                                                                                  
                                                       		SetRect(&re, scrollz,scrollx+213,scrollz+640,scrollx+400);				                                       
                                                       		SetRect(&ri, 0,213,640,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                          }; 

                                                         if (level==3)  {
                                                        	ql=ql+1; if (ql>999) ql=0;
                                                        	spiegel=350;
                                                       	    i=spiegel;
                                                       	    winll=i/30;
                                                       		SetRect(&re, scrollz,0,scrollz+640,i);				                                       
                                                       		SetRect(&ri, 0,0,640,i);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
														   
														     
														 for (ii=0;ii<=10;++ii) {
                                                       		SetRect(&re,0,i+ii,640,i+ii+1);
                                                       		zuf=ii*winll+RandomInt(winll);				                                       
                                                       		SetRect(&ri, 0,i-zuf,640,i-zuf+1);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  firstWin)->portBits,&(((GrafPtr)  muriel)->portBits),&ri,&re ,srcCopy, 0L);         
															};
															
                                                       /*
                                                       		SetRect(&re, 2000-ql,370,2000-ql+640,400);				                                       
                                                       		SetRect(&ri, 0,370,640,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                       	*/
                                                        	SetRect(&ri, 0,370,640,400);
                                                       		SetRect(&re, 0,370,640,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                      
                                                           
                                                          };

                                                          if ((level==4) || (level==5))
                                                           {
                                                          rad=50;
                                                          if (level==5) { rad=70;
                                                                          if (scrollz==2560) rad=20;
                                                                        };
                                                          winl=winl+10; if (winl>628) winl=0;                                  
                                                       	  i=300+(int) ((double) (  rad)*sin((double) (winl)/100  )    );
                                                       	  spiegel=i;
                                                       	  
                                                       	    winll=i/30;
                                                       		SetRect(&re, scrollz,0,scrollz+640,i);				                                       
                                                       		SetRect(&ri, 0,0,640,i);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
														
														 for (ii=0;ii<=10;++ii) {
                                                       		SetRect(&re,0,i+ii,640,i+ii+1);
                                                       		zuf=ii*winll+RandomInt(winll);				                                       
                                                       		SetRect(&ri, 0,i-zuf,640,i-zuf+1);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  firstWin)->portBits,&(((GrafPtr)  muriel)->portBits),&ri,&re ,srcCopy, 0L);         
                                                          };
                                                           
                                                          };


                                                          if ((level==6) || (level==7) || (level==8) || (level==9) || (level==10) || (level==12) || (level==13)) {                                  
                                                       	
                                                       		SetRect(&re, scrollz,scrollx,scrollz+640,scrollx+400);				                                       
                                                       		SetRect(&ri, 0,0,640,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                          
                                                         
                                                          };

         // die Sterne(level==10)) {                           //BETRIEB       
                                                       	if (level==11) {
                                                       	   if (scrollz<=2560-641) {
                                                       		SetRect(&re, scrollz,scrollx,scrollz+640,scrollx+400);				                                       
                                                       		SetRect(&ri, 0,0,640,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                            } else
                                                            { 
                                                            
                                                            ++scrl; if (scrl>=400) scrl=0;
			
                                                       		SetRect(&re, scrollz,0,scrollz+40,400);				                                       
                                                       		SetRect(&ri, 0,0,40,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
															
															i=40; // BSP 104
                                                       		SetRect(&re, scrollz+40,scrl/2,scrollz+i,400);				                                       
                                                       		SetRect(&ri, 40,0,i,400-scrl/2);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                       		SetRect(&re, scrollz+40,0,scrollz+i,scrl/2);				                                       
                                                       		SetRect(&ri, 40,400-scrl/2,i,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         

													
                                                       		SetRect(&re, scrollz+i,scrl,scrollz+640,400);				                                       
                                                       		SetRect(&ri, i,0,640,400-scrl);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                       		SetRect(&re, scrollz+i,0,scrollz+640,scrl);				                                       
                                                       		SetRect(&ri, i,400-scrl,640,400);				                                       					                                       

					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         


                                                             
                                                            }; };
                                                            
                                                   // links rechts
                                                      	if (level==14) {
                                                       	   if (scrollz<=2560-641) {
                                                       		SetRect(&re, scrollz,scrollx,scrollz+640,scrollx+400);				                                       
                                                       		SetRect(&ri, 0,0,640,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                            } else
                                                            { ++scrl; if (scrl>=400) scrl=0;

                                                       		SetRect(&re, scrollz,scrl,scrollz+640,400);				                                       
                                                       		SetRect(&ri, 0,0,640,400-scrl);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         
                                                              

                                                       		SetRect(&re, scrollz,0,scrollz+640,scrl);				                                       
                                                       		SetRect(&ri, 0,400-scrl,640,400);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);         

                                                             
                                                            };
                                                         
                                                          };

   
       if ((level==0)) 
       {
        SetPort((GrafPtr) muriel);
        for (i=0;i<=99;++i)
         { SetCPixel(sidus[i][0],sidus[i][1],&col[(8-sidus[i][2])]);
   
         //if ((scrollz%2)==0) {
           sidus[i][0]=sidus[i][0]+sidus[i][2];
           sidus[i][1]=sidus[i][1]+sidus[i][3];
           if (sidus[i][0]>640) sidus[i][0]=sidus[i][0]-640;
           if (sidus[i][0]<0) sidus[i][0]=sidus[i][0]+640;

           if (sidus[i][1]>400) sidus[i][1]=sidus[i][1]-400;
           if (sidus[i][1]<0) sidus[i][1]=sidus[i][1]+400; //};
        
       }; };


                                                                 
                                                                                                                   
                                                    /* ZEICHNEN */     
                                                            for (i=0;i<=spritezlr;++i)
                                                            {
                                                             
         											
         											 /* WENN DER LEVEL==0 GROESSER WERDEN */
         										if (retus[i][3]!=8)
         										   {
         										 if (i>2)
         									       if (level==0) {
         											  
         											        er=retus[i][29];
         											  
         											        if (er<32){ ++retus[i][29];
         											          retus[i][5]=(int)(((double)(retus[i][27])*(sin((double)(er)*5/100))));
         											          retus[i][6]=(int)(((double)(retus[i][28])*(sin((double)(er)*5/100))));
         											         }; }; 
         											 } else
         											 { retus[i][5]=32;
         											   retus[i][6]=32;
         											 
         											 };       
         											    
         											          
         											          tx=retus[i][0];
											                  ty=retus[i][1];
											                  lx=retus[i][2];
											                  ly=retus[ i][3];
											                  lz=retus[i][4];
											                  kx=retus[i][5];
 											                  ky=retus[i][6];
											                 

						                 
											                 
									 		                 if (i!=0)
											                 {
                          			 	                      retus[i][7]=tx;
								 			                  retus[i][8]=ty;
                                                             };

                   					                             /* DIE KURVEN SCHIESSEN */

                    					                           if (retus[i][9]>10) {  

    /*==============Sie Schiessen zurck jetzt und hier !!!!!!!!!!!!!! */                    					                           
if (retus[i][19]!=5) 
 if (retus[i][4]>0) 
  if (retus[i][3]>0)
     if (RandomInt(schiessz)==0)   
                   					                                                                                  for (ax=i;ax<= spritezlr;++ax)
																			                                           {           q=0;
																			                                                       if (q==0)
																			                                                       if  (retus[ax][ 4]==0)  // EINEN GEFUNDEN SONST LASSEN WIRS ..
																			                                                         {   q=1; 
 														 					                                                             retus[ax][0]=retus[i][0]+retus[i][5 ]/4;
 																			                                                             retus[ax][1]=retus[i][1]+retus[i][6]/8;
																			                                                             retus[ax][2]=RandomInt(3) ;
																			                                                             retus[ax][3]=3;
																			                                                             retus[ax][4]=2;
																			                                                             retus[ax][5]=SHOWX;
																			                                                            retus[ax][6 ]=SHOWY; 
				 									 						                                                            
																			                                                            retus[ax][9]=5; //BEWEGUNG
																			                                                            
																			                                                          
																			                                                            /* ZIELEN */
																			                                                            /* ZIELEN */
																			                    r=retus[0][18]+retus[0][5]/2+retus[0][0]-(retus[i][18]+retus[i][5]/2+retus[i][0]) ;
																			                  rr=retus[0][1]-retus[i][1]-retus[i][6]/2;                                          
																			                   retus[ax][13]=6*r/sqrt(r*r+rr*rr);
																						  	   retus[ax][14]=6*rr/sqrt(r*r+rr*rr);                                              
                                                                                              retus[ax][18]=retus[i][18];
																			                                                            retus[ax][19]=3;     //GEGNER 
                                                                                                                                         ax=200;
                                                                          
																			  if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndhi,TRUE); else
     																			 if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndhi,TRUE); // sndhi 
                                                                                                                              
                                                                                                                                         
                                                                                                                                         
																			                                                       };
                                                                                                                             };                    					                           
    /*==============Sie Schiessen zurck jetzt und hier !!!!!!!!!!!!!! */
    
                    					                                                
                    					                            					   tax=retus[i][9]-11;                   					                                                                 
																								tz=0;
																								tez=flugge;
																								if  (retus[i][3]==16) tez=flugge;
																								while (tz<tez) { ++tz;
																								 if (retus[i][4]!=0) 
																								 { 
                   					                                                                 zlr=retus[i][20];
                   					                                                                 ++zlr;
                   					                                                                 retus[i][20]=zlr;
                   					                                                                 if (zlr>4999) {   retus[i][4]=5; retus[i][3]=5 ; tz=25; };                       
                   					                                                                 
                   					                                      
                   					                                                                 retus[i][0]=retus[i][0]+*(soptr[tax]+zlr*2*sizeof(char));                   					                                                         
                    					                                                             retus[i][1]=retus[i][1]+*(soptr[tax]+zlr*2*sizeof(char)+1);
                     					                   
                     					                                                             if (  *(soptr[tax]+(zlr+1)*2*sizeof(char))==101) 
                     					                                                             {  
                     					                                                                            if  (retus[i][3]!=16)  { retus[i][3]=0; 
                     					                                                                                                                retus[i][4]=0; 
                     					                                                                                                                 retus[i][19]=0; 
                     					                                                                          };       
                              
                     					                                                                             tz=25; 
                     					                                                                       };
                     					                                                         }  else ;//?
                     					                                                           
                     					                                                           
                     					                                                           };   };           
                   					                        
                   					                        
                   					                        if (lz!=0)
                   					                        {
                   					                        /* DIE DIE MEHR TUN */
                     					                      
                    					                        
                   					                      
                   					                      /* ================== RAUMSTATION =========================*/
                   					                        if (retus[i][3]==4) 
                   					                        if (retus[i][2]==5)
                   					                                                    {       
                   					                                                                if (RandomInt(5 )==0)       
                   					                                                                                  for (ax=i;ax<= spritezlr;++ax)
																			                                           {           q=0;
																			                                                       if (q==0)
																			                                                       if  (retus[ax][ 4]==0)  // EINEN GEFUNDEN SONST LASSEN WIRS ..
																			                                                         {   q=1; 
 														 					                                                             retus[ax][0]=retus[i][0]+retus[i][5 ]/4;
 																			                                                             retus[ax][1]=retus[i][1];
																			                                                             retus[ax][2]=RandomInt(3) ;
																			                                                              retus[ax][3]=3;
																			                                                             retus[ax][4]=2;
																			                                                             retus[ax][5]=SHOWX;
																			                                                             retus[ax][6]=SHOWY; 
				 									 						                                                            
																			                                                            retus[ax][9]=5; //BEWEGUNG
																			                                                            
																			                                                          
																			                                                            /* ZIELEN */
																			                                                            /* ZIELEN */
																							   retus[ax][13]=0;
																						  	   retus[ax][14]=0;                                             
 	                                     													   if (RandomInt(2)==0) {
																							   retus[ax][14]=-2; } else
																						  	 {  retus[ax][14]=2;  retus[ax][1]=retus[ax][1]+32+6;};                                         
 	                                                                                             retus[ax][18]=retus[i][18];
																			                                                            retus[ax][19]=3;     //GEGNER 
                                                                                                                                         ax=200;
	                                                                                                                                
																			                                                       };
                                                                                                                             };
                    					                        
                   					                                                    };
                   					                        
  
                   					                        /* ========= VERGROESSERN UND VERKLEINERN =========*/
                   					                        if (retus[i][3]==9)
                   					                                                     { 
                   					                                                       if (retus[i][2]<5) { retus[i][0]= retus[i][0]-1;
                   					                                                     					    retus[i][1]= retus[i][1]-1;
                   					                                                     					    retus[i][5]= retus[i][5]+1;
                   					                                                     					    retus[i][6]= retus[i][6]+1;
                   					                                                     					  } else
                   					                                                     					  { retus[i][0]= retus[i][0]+1;
                   					                                                     					    retus[i][1]= retus[i][1]+1;
                   					                                                     					    retus[i][5]= retus[i][5]-1;
                   					                                                     					    retus[i][6]= retus[i][6]-1;
                   					                                                     					  };
                   					                                                       if (retus[i][2]==5) {  retus[i][11]=1; 
                   					                                                                           } else
                   					                                                                           retus[i][11]=4;
                   					                                                     }
                   					                        /* ============= VULKAN ===== ===============*/
                   					                        if (retus[i][3]==8)  
                   					                        if (retus[i][2]==4)
                   					                                                     {                
                   					                                                           
                   					                                                                if (RandomInt(vulkanz)==0)       
                   					                                                                                  for (ax=i;ax<= spritezlr;++ax)
																			                                           {           q=0;
																			                                                       if (q==0)
																			                                                       if  (retus[ax][ 4]==0)  // EINEN GEFUNDEN SONST LASSEN WIRS ..
																			                                                         {   q=1; 
 														 					                                                             retus[ax][0]=retus[i][0]+retus[i][5 ]/4;
 																			                                                             retus[ax][1]=retus[i][1]+retus[i][6]/8;
																			                                                             retus[ax][2]=RandomInt(3) ;
																			                                                              retus[ax][3]=3;
																			                                                             retus[ax][4]=2;
																			                                                             retus[ax][5]=SHOWX;
																			                                                            retus[ax][6 ]=SHOWY; 
				 									 						                                                            
																			                                                            retus[ax][9]=5; //BEWEGUNG
																			                                                            
																			                                                          
																			                                                            /* ZIELEN */
																			                                                            /* ZIELEN */
																			                    r=retus[0][18]+retus[0][5]/2+retus[0][0]-(retus[i][18]+retus[i][5]/2+retus[i][0]) ;
																			                  rr=retus[0][1]-retus[i][1]-retus[i][6]/2;                                          
																			                   retus[ax][13]=5*r/sqrt(r*r+rr*rr);
																						  	   retus[ax][14]=5*rr/sqrt(r*r+rr*rr);                                              
                                                                                              retus[ax][18]=retus[i][18];
																			                                                            retus[ax][19]=3;     //GEGNER 
                                                                                                                                         ax=200;
                                                                          
																			  if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndhi,TRUE); else
     																			 if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndhi,TRUE); // sndhi 
                                                                                                                              
                                                                                                                                         
                                                                                                                                         
																			                                                       };
                                                                                                                             };
                   					                              };
                   					                         
                   					                         /* ???????????????VERAENDERUNGEN ????????????????????*/
                  					                       /*  if (retus[i][19]==2)  {  
                  					                                                            retus[i][10]=retus[i][10]-1;
                  					                                                            if (retus[i][10]<0)  { 
                  					                                                                                               retus[i][4]=0;
                  					                                                                                               retus[i][19]=0;
                  					                                                                                                };
                  					                                                          }; */
                  					                          if  (retus[i][9]==0){ 
                   					                                                          if ((retus[i][0]+retus[i][18]-scrollz)<-32) retus[i][4]=0;
                   					                                                          };  
                   					                           
                   					                   
                   					                   //DIESE ZWEI REAGIEREN !!
                   					                          if (retus[i][9]==1) { retus[i][1]=retus[i][1]+retus[i][14];
                   					                                                
                   					                                                if (retus[i][1]<-32) retus[i][4]=0;

                   					                                                if (RandomInt(3)==0) {
                   					                                                 p=RandomInt(15);
                   					                                                if (((retus[i][1]-p)<(y+10)) && ((retus[i][1]-p)>(y-10)))
                   					                                                 {  retus[i][9]=5;       
                   					                                                    if (x<(retus[i][0]+retus[i][18]-scrollz))
                   					                                                      retus[i][13]=retus[i][14]*2; else
                   					                                                      retus[i][13]=-retus[i][14]*2;
                   					                                                    retus[i][14]=0;
                   					                                                 };
                   					                                                 };};
                   					                                                          
                   					                                                          
                  					                           if (retus[i][9]==2) { retus[i][1]=retus[i][1]+retus[i][14];
                   					                                                          if (retus[i][1]>401) retus[i][4]=0;
                   					                                                          
                    					                                            if (RandomInt(3)==0) {
                   					                                                 p=RandomInt(15);
                   					                                                if (((retus[i][1]+p)<(y+10)) && ((retus[i][1]+p)>(y-10)))
                   					                                                 {  retus[i][9]=5;       
                   					                                                    if (x<(retus[i][0]+retus[i][18]-scrollz))
                   					                                                      retus[i][13]=-retus[i][14]*2; else
                   					                                                      retus[i][13]=retus[i][14]*2;
                   					                                                    retus[i][14]=0;
                   					                                                 };
                   					                                                 }              					                                                          
                   					                                                          
                   					                                                          };
                   					                          if (retus[i][9]==3) { retus[i][ 0]=retus[i][0]+4;
                   					                                                         if ((retus[i][0]+retus[i][18]-scrollz)>641) retus[i][4]=0; 
                   					                                                           };
                   					                          if (retus[i][9]==4) { retus[i][0]=retus[i][0]-retus[i][13];
                   					                                                         
                   					                                                          if ((retus[i][0]+retus[i][18]-scrollz)<-32) retus[i][4 ]=0;
                   					                                                
                   					                                                retus[i][29]=retus[i][29]+retus[i][14];        
                   					                                                retus[i][1]=retus[i][29]/10;       
                   					                                                         
                   					                                                          };
  
                    					                      /* GEZIELT GERICHTET */
                    					                      if (retus[i][9]==5) {  retus[i][0]=retus[i][0]+retus[i][13];
                   					                                                            retus[i][1]=retus[i][1]+retus[i][14];
                   					                                                            if ((retus[i][0]+ retus[i][18]-scrollz)<-32) retus[i][4]=0;
                   					                                                            if ((retus[i][0]+retus[i][18]-scrollz)>641) retus[i][4]=0;
                   					                                                            if (retus[i][1]<-32) retus[i][4]=0;
                   					                                                            if (retus[i][1]>401) retus[i][4]=0;    
                   					                                                          };

                   					                      /* BOUNCING */
                    					                      if (retus[i][9]==7 ) {   //retus[i][3]=7;
                    					                                               //retus[i][4]=7;
                                                       qw=i;
                                                       for (iii=0;iii<=499;++iii)
                                                     
                                                   //      if (les[ii][4]!=29)
                                                   //       if (les[ii][4]!=30) 
                                                         if (retus[qw][19]!=5)   
                                                          if (retus[qw][4]!=0) 
                                                          if (les[iii][4]!=0)                                                           
                                                          { szux1=les[iii][0]-scrollz -retus[qw][5]+5;
                                                            szuy1=les[iii][1]-retus[qw][6]+5;
                                                            szux2=les[iii][2]-scrollz;
                                                            szuy2=les[iii][3];
                                                             
                                                            slx=retus[qw][0]+retus[qw][18]-scrollz+retus[qw][13];
                                                            sly=retus[qw][1];
                                                          
                                                          if  (      (slx>szux1)  
                                                                && (slx<szux2)
                                                                && (sly>szuy1)
                                                               && (sly<szuy2)) 
                                                              {     
                                                                retus[qw][13]=retus[qw][13]*(-1);
                                                              
                                                              
                                                            };  };                  					                                      
                                                        qw=i;
                                                       for (iii=0;iii<=499;++iii)
                                                     
                                                   //      if (les[ii][4]!=29)
                                                   //       if (les[ii][4]!=30) 
                                                         if (retus[qw][19]!=5)   
                                                          if (retus[qw][4]!=0) 
                                                          if (les[iii][4]!=0)                                                           
                                                          { szux1=les[iii][0]-scrollz -retus[qw][5]+5;
                                                            szuy1=les[iii][1]-retus[qw][6]+5;
                                                            szux2=les[iii][2]-scrollz;
                                                            szuy2=les[iii][3];
                                                             
                                                            slx=retus[qw][0]+retus[qw][18]-scrollz;
                                                            sly=retus[qw][1]+retus[qw][14];
                                                          
                                                          if  (      (slx>szux1)  
                                                                && (slx<szux2)
                                                                && (sly>szuy1)
                                                               && (sly<szuy2)) 
                                                              {     
                                                                retus[qw][14]=retus[qw][14]*(-1);
                                                              
                                                              
                                                            };  };               					                                                 

         					                                      

																retus[qw][1]=retus[qw][1]+ retus[qw][14] ; 
                    					                        retus[qw][0]=retus[qw][0]+ retus[qw][13] ;
                   					               };
                   					               
 
                    					                      /* GEZIELT GERICHTET */
                    					                      if (retus[i][9]==8) {   retus[i][0]=retus[i][0]+retus[i][13];
                   					                                                            retus[i][1]=retus[i][1]+retus[i][16];

                   					                                                            if (retus[i][17]==1) { ++retus[i][16];
                   					                                                                                               if (retus[i][16]==7) retus[i][17]=-1; };
                   					                                                            if (retus[i][17]==-1) { --retus[i][16];
                   					                                                                                               if (retus[i][16]==-7) retus[i][17]=1; };
                   					                                                                         
                   					                                                             if ((retus[i][0]+ retus[i][18]-scrollz)<-32) retus[i][4]=0;
                   					                                                             if ((retus[i][0]+retus[i][18]-scrollz)>641) retus[i][4]=0;
                   					                                                            if (retus[i][1]<-32) retus[i][4]=0;
                   					                                                            if (retus[i][1]>401) retus[i][4]=0;    
                   					                                                          }; 

                    					                      /* GEZIELT GERICHTET */
                    					                      if (retus[i][9]==9) {   retus[i][0]=retus[i][0]+retus[i][16];
                   					                                                            retus[i][1]=retus[i][1]+retus[i][14];
                   					                                                            
                   					                                                            if (retus[i][17]==1) { ++retus[i][16];
                   					                                                                                               if (retus[i][16]==7) retus[i][17]=-1; };
                   					                                                            if (retus[i][17]==-1) { --retus[i][16];
                   					                                                                                               if (retus[i][16]==-7) retus[i][17]=1; };
                   					                                                                         
                   					                                                            if ((retus[i][0]+ retus[i][18]-scrollz)<-32) retus[i][4]=0;
                   					                                                            if ((retus[i][0]+retus[i][18]-scrollz)>641) retus[i][4]=0;
                   					                                                            if (retus[i][1]<-32) retus[i][4]=0;
                   					                                                            if (retus[i][1]>401) retus[i][4]=0;    
                   			 		                                                          };

                   					                          if (retus[i][3]==6)  // let us find them
                   					                                                         {  
                   					                                                            //retus[i][18]=scrollz; 
                                                                                                
                                                                                                r=retus[0][0]+retus[0][18]+32-retus[i][0]-retus[i][18];
                                                                                                rr=retus[0][1]+10-retus[i][1];
                                                                                                rrr=rr*rr+r*r;
                                                                                                ac=(double) (r)/sqrt((double)(rrr));
                                                                                                ast=-(double) (rr)/sqrt((double) (rrr));
                   					                                                           
                   					                                                            
                   					                                                            vr=6;
                   					                                                            vrr=4;
                   					                                                            if (retus[i][2]>8)  
                   					                                                              if (ast<=sin(6.28-1.2)) 
                   					                                                                 { retus[i][2]=4;
                   					                                                                 
                   					                                                                 };
                   					                                                            
																								if (retus[i][2]<8) {
                   					                                                            if (ast>=sin(0.4)) { 
                   					                                                                         
                   					                                                                    if (ac>=0)
                   					                                                                        { retus[i][0]=retus[i][0]+vr;
                   					                                                              			  retus[i][1]=retus[i][1]-vrr;  
                   					                                                                          retus[i][2]=7;
                   					                                                                          } else
                   					                                                                                             					                                                                         
                   					                                                                        { retus[i][0]=retus[i][0]-vr;
                   					                                                              			  retus[i][1]=retus[i][1]-vrr;  
                   					                                                                          retus[i][2]=1;
                   					                                                                          }; 
                   					                                                                          
                   					                                                                          };                 					                                                                       

                   					                                                            if (ast>=sin(1.2)) { retus[i][0]=retus[i][0];
                   					                                                              			  retus[i][1]=retus[i][1]-vrr;  
                   					                                                                          retus[i][2]=0;
                   					                                                                          };           
                    					                                                                          


                   					                                                            if (ast<=sin(-0.4)) { 
                   					                                                                         
                   					                                                                    if (ac>=0)
                   					                                                                        { retus[i][0]=retus[i][0]+vr;
                   					                                                              			  retus[i][1]=retus[i][1]+vrr;  
                   					                                                                          retus[i][2]=5;
                   					                                                                          } else
                   					                                                                                             					                                                                         
                   					                                                                        { retus[i][0]=retus[i][0]-vr;
                   					                                                              			  retus[i][1]=retus[i][1]+vrr;  
                   					                                                                          retus[i][2]=3;
                   					                                                                          }; 
                   					                                                                          
                   					                                                                          };                 					                                                                       
                   					                                                                                  					                                                                       
                   					                                                                          
                   					                                                             if (ast<=sin(6.28-1.2)) 
                   					                                                                         { retus[i][0]=retus[i][0];
                   					                                                              			  retus[i][1]=retus[i][1]+vrr;
                   					                                                              			  retus[i][2]=4;
                   					                                                                          }; 

                					                                                         
                   					                                                             if (ac<=cos(3.14-0.4)) { retus[i][0]=retus[i][0]-vr;
                   					                                                              			  retus[i][1]=retus[i][1];
                   					                                                              			  retus[i][2]=2;
                   					                                                                          };
                   					                                                                          
                   					                                                             if (ac>=cos(0.4))       { retus[i][0]=retus[i][0]+vr;
                   					                                                              			  retus[i][1]=retus[i][1];  
                   					                                                                          retus[i][2]=6;
                   					                                                                          };
                   					                                                          };              

                   					                                                          
                   					                                                          }; // };



 
                    					                       /* BLEIBT STEHEN OHNE WANK */
                    					                       if  (retus[i][9]==6){  retus[i][18]=scrollz;
                   					                                                             
                    					                                                          }; 

                /* ============= NORMAL ===================== */
                    					                      if (retus[i][19]>0) 
                   					                                                         {  if ((retus[i][0]+retus[i][18]-scrollz)<-52) { retus[i][4 ]=0; retus[i][19 ]=0; };
                   					                                                            if ((retus[i][0]+retus[i][18]-scrollz)>651) { retus[i][4]=0; retus[i][19 ]=0;};
                   					                                                            if (retus[i][1]<-32) { retus[i][4]=1; retus[i][19 ]=0;};
                   					                                                            if (retus[i][1]>401) { retus[i][4]=1; retus[i][19 ]=0;};   };
              /* ================ NORMAL =====================*/
 
    
                   					                            
                   					                    
        											          tx=retus[i][0];
											                  ty=retus[i][1];

                                                           /* VERSCHWINDEN */
                                                              q=0;                                                              
                                                              if (retus[i][2]==9)  if (retus[i][3]==1)  { q=1; retus[i][4]=0;   retus[i][19]=0; };               
   														
   														
                      					                     if (q==0)
                                                             if (retus[i][3]!=16)
                      					                     { 
                   					                          SetRect(&re, tx-scrollz+retus[i] [18],ty,retus[i] [18]-scrollz+  tx+kx,ty+ky);
					                                          if  (retus[i][3]<12) SetRect(&ri,lx*32,ly*32,lx*32+32,ly*32+32);
					                                                     else            SetRect(&ri,320+lx*32,(ly-11)*32,320+lx*32+32,(ly-11)*32+32);
					                                          CopyBits(&((GrafPtr)  anima)->portBits,&(((GrafPtr)  muriel)->portBits),&ri,&re ,36, 0L);         
                          				                       } else
                          				                       {  /* OBERMOTZ */
                   					                          SetRect(&re, tx-scrollz+retus[i] [18],ty,retus[i] [18]-scrollz+  tx+kx,ty+ky);
					                                          SetRect(&ri,lx*64,0,lx*64+64,64);
					                                          CopyBits(&((GrafPtr)  nima)->portBits,&(((GrafPtr)  muriel)->portBits),&ri,&re ,36, 0L);         
                          				                       };

                                                             if (q==0)
                                                             {
                                                              if (speed==0)
                                                              {
                                                              /* - ANIMATION */
                                                              er=0;
                                                              if (retus[i][3]==6) er=1;
                                                              if (retus[i][3]==15) er=1;
                                                              
                                                              											                   
											                  // ANIMO
                                                             if (retus[i][3]==16)
											                  if (sir==1) { ++sirz;
											                   if (sirz>3) { ++lx; sirz=0; };
											                  };
                                                             
                                                             if (retus[i][3]!=16)
                                                              if (er==0) ++lx;   
											                  
											                    /* PAUD */
                      					                    if ((retus[i][3]==2) ||
                      					                        (retus[i][3]==12) ||
                      					                        (retus[i][3]==13) ||
                      					                        (retus[i][3]==14)) {
                      					                      if (PAUD==0) { if (lx>2) lx=0; };
                      					                      if (PAUD==1) { if (lx>5) lx=3; };
                      					                      if (PAUD==2) { if (lx>8) lx=6; }; };
											                  
                                                               if (lx>9) lx=0;
											                   retus[i][2]=lx;
                                                             };
                                                               
                                                               
                                                            
                                                              };
         											/* WEG2 MIT DEN SCHUESSEN SCHON FRUEH GENUG */ 
         											    if (retus[i][19]==2)  
         											     if (retus[i][3]==2) {
         											        if ((tx+retus[i][18]-scrollz)>(640-50)) {
         											         retus[i][19]=0;
         											         retus[i][4]=0;
         											         retus[i][3]=0;
         											        };};

         											     if (retus[i][3]==12) {
         											        if ((tx+retus[i][18]-scrollz)<(10)) {
         											         retus[i][19]=0;
         											         retus[i][4]=0;
         											         retus[i][3]=0;
         											        };};
  
          											     if (retus[i][3]==13) {
         											        if (ty<10) {
         											         retus[i][19]=0;
         											         retus[i][4]=0;
         											         retus[i][3]=0;
         											        };};
  
          											     if (retus[i][3]==14) {
         											        if (ty>(400-40)) {
         											         retus[i][19]=0;
         											         retus[i][4]=0;
         											         retus[i][3]=0;
         											        };};
         											        

         											/* WEG MIT DEN SCHUESSEN SCHON FRUEH GENUG */ 
					                                                              
                                                              
                                                              };
                                                             };                                                            


/* Spukt  Monster spukt ------------ */
												q=0;
                                                for (i=0;i<=499;++i)
                                                if (les[i][0]<=2560)
                                                if ((les[i][4]==36 ) ||  (les[i][4]==37 ))
                                                {       
															zux1=les[i][0];
                                                            zuy1=les[i][1];
                                                            zux2=les[i][2];
                                                            zuy2=les[i][3];
                                                            q=1;
                                                            if (((zux1<(scrollz+640)) && (zux1>scrollz)) ||
                                                                ((zux2<(scrollz+640)) && (zux2>scrollz)))
                                                              {  q=0;
                                                              
  			                                                     if (RandomInt(30)==0)       
                   					                                         for (ax=3;ax<= spritezlr;++ax)
																			   {           
																			                                                       if (q==0)
																			                                                       if  (retus[ax][ 4]==0)  // EINEN GEFUNDEN SONST LASSEN WIRS ..
																			                                                         {   q=1; 
 														 					                                                             retus[ax][0]=les[i][0]+(les[i][2]-les[i][0])/4-scrollz;
 																			                                                             retus[ax][1]=les[i][1]+(les[i][3]-les[i][1])/4;
																			                                                             retus[ax][2]=RandomInt(3) ;
																			                                                              retus[ax][3]=17; retus[ax][4]=17; 
																			                                                             if (les[i][4]==36) { retus[ax][3]=3; retus[ax][4]=2; }
																			                                                       
																			                                                             
																			                                                           if (les[i][4]==36) { 
																			                                                            retus[ax][5]=SHOWX;
																			                                                            retus[ax][6 ]=SHOWY; } else // 37 !!
																			                                                            { 
																			                                                              retus[ax][5]=32;
																			                                                              retus[ax][6 ]=32; }
				 									 						                                                            
																			                                                            retus[ax][9]=5; //BEWEGUNG
																			                                                             retus[ax][18]=scrollz;
																			                                                          
																			                                                            /* ZIELEN */
																			                                                            /* ZIELEN */
																			                    r=retus[0][18]+retus[0][5]/2+retus[0][0]-(retus[ax][18]+retus[ax][5]/2+retus[ax][0]) ;
																			                  rr=retus[0][1]-retus[i][1]-retus[i][6]/2;                                          
																			                   retus[ax][13]=5*r/sqrt(r*r+rr*rr);
																						  	   retus[ax][14]=-5*rr/sqrt(r*r+rr*rr);                                              
                                                                                             
																			                                                            retus[ax][19]=3;     //GEGNER 
                                                                                                                                         ax=200;
                                                                          
																			  if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndhi,TRUE); else
     																			 if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndhi,TRUE); // sndhi 
                                                                                    // anderer Sound bei spuken                                          
                                                                                                                                         
                                                                                                                                         
																			                                                       };
                                                                                                                             };
                                                              
                                                              };
                                                              
                                                             };
                                                             
/* ------------------------------ DIE GROSSEN 2 SPEZIALBEFEHLE TEICHE ETC ------------ */

                                                for (i=0;i<=499;++i)
                                                if (les[i][0]<=2560)
                                                if ((les[i][4]==29 ) ||  (les[i][4]==30 ))
                                                {       
															zux1=les[i][0];
                                                            zuy1=les[i][1];
                                                            zux2=les[i][2];
                                                            zuy2=les[i][3];
                                                         
                                                            if (((zux1<(scrollz+640)) && (zux1>scrollz)) ||
                                                                ((zux2<(scrollz+640)) && (zux2>scrollz)))
                                                              {                                                         

                                                              
                                                         if (les[i][4]==29) {
                                                      		SetRect(&re,zux1,zuy1,zux2,zuy2);				                                       
                                                       		SetRect(&ri,zux1-scrollz,zuy1,zux2-scrollz,zuy2);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);                                                                  												  
												  
												        };


                                                         if (les[i][4]==30) {
                                                      		
                                                      		b=zuy2-zuy1;
                                                      		l=zux2-zux1;
                                                      	   if (b==0) b=10;
                                                      	    w=314/b;
                                                      	    o=zuy1;
                                                      	    uros=5;
                                                      	    
                                                      	for (ii=0;ii<=b;++ii) { o=o-RandomInt(ii);
                                                       		uros=(int) (sin(((double) (ii)*(double) (w))/100)*(double)(l));

                                                      		SetRect(&re,zux1-scrollz+(l/2-uros/2),o,zux2-scrollz-(l/2-uros/2),o+1);				                                       
                                                       		SetRect(&ri,zux1-scrollz+(l/2-uros/2),zuy1+ii,zux2-scrollz-(l/2-uros/2),zuy1+ii+1);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  firstWin)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);                                                                  												  

														 }; 
														 
												        }; 
                                                         
                                                         
                                                        };                                         

												  
												

												};    
                                                         //if (zg_score==1)
                                                         //{ 
                                                            zg_score=0;
                                                     		SetRect(&re,320,64,320+96,64+32);				                                       
                                                       		SetRect(&ri,640-96-50,5,640-50,21);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  nima)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,36, 0L);                                                                  
                                                         //};  
                                                            // anzahl leben
                                                     		SetRect(&re,live*32,64,32+live*32,64+32);				                                       
                                                       		SetRect(&ri,640-16-10,5,640-10,21);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  nima)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,36, 0L);                                                                  

						                              if ((level==3)) //DAS WASSER
						                               { 
														  i=spiegel;
														  for (ii=10;ii<=19;++ii) {
                                                       	  	SetRect(&re,0,i+ii,640,i+ii+1);
                                                       	  	zuf=ii*winll+RandomInt(winll);				                                       
                                                       		SetRect(&ri, 0,i-zuf,640,i-zuf+1);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  firstWin)->portBits,&(((GrafPtr)  muriel)->portBits),&ri,&re ,srcCopy, 0L);         
                                                           }; 
                                                           
                                                            SetPort((GrafPtr) muriel);
                                                            SetRect(&rec, 0,spiegel+19,640,400);
                                                            FillCRect(&rec,leers); // auch andere Grafik  
                                                      

														  if (y>(370-retus[0][6]-5)) y=370-retus[0][6]-5;

                                                        };

						                              if ((level==4) || (level==5)) //DAS WASSER
						                               { 
														  i=spiegel;
														  for (ii=10;ii<=25;++ii) {
                                                       	  	SetRect(&re,0,i+ii,640,i+ii+1);
                                                       	  	zuf=ii*winll+RandomInt(winll);				                                       
                                                       		SetRect(&ri, 0,i-zuf,640,i-zuf+1);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  firstWin)->portBits,&(((GrafPtr)  muriel)->portBits),&ri,&re ,srcCopy, 0L);         
                                                           }; 

														
													                                                         
                                                         
                                                            SetPort((GrafPtr) muriel);
                                                            SetRect(&rec, 0,spiegel+25,640,400);	
                                                            FillCRect(&rec,leerwa); // auch andere Grafik  




                                                         // Wasser und nun das grosse Spiel die Hintergrundsteine
                                                        for (i=0;i<=499;++i)
                                                        if ((les[i][0]<=2560) && (les[i][1]>0))                                                                                                              
                                                        
                                                          { zux1=les[i][0];
                                                            zuy1=les[i][1]-4;
                                                            zux2=les[i][2];
                                                            zuy2=les[i][3];
                                                         
                                                            if (((zux1<(scrollz+640)) && (zux1>scrollz)) ||
                                                                ((zux2<(scrollz+640)) && (zux2>scrollz)))
                                                              { if ((zuy1<spiegel) && (zuy2>spiegel)) 
                                                                {
                                                              
                                                            o=zuy2-spiegel; if (o>5) o=5;
                                                      		SetRect(&re,zux1,spiegel,zux2,spiegel+o);				                                       
                                                       		SetRect(&ri,zux1-scrollz,spiegel,zux2-scrollz,spiegel+o);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,srcCopy, 0L);                                                                  
                                                                
                                                                }; 
                                                              };
                                                        
                                                          }; 
                                                        };
                                                            


														/* UND DER UNTERSTAND DES MONSTERS in LEVEL 11
                                                       	if (level==11) 
                                                       	   if (scrollz==2560-640) {														
							                                SetRect(&re,0,400-198,243,400 );				                                       
                                                       		SetRect(&ri, 640-243,100,640,298);				                                       					                                       
					                                        CopyBits(&((GrafPtr) bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,36, 0L);         
															}; */
                                                        

                                                        									  				/* SHIELD */
                  
                                                            /* ZEIGEN GAME OVER/LEVEL COMPLETED */
                                                                                                                      /* GAME OVER ODER DID IT */
                                                         if (zg_gameover==1) 
                                                         {  if (scrollz==2560-640) gascr=1;
                                                            if (level!=11) if (gascr==1) scrollz=scrollz-2;
                                                       		//tre		                                       
                                                       		SetRect(&ri, 0,150,640,250);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&trec,&ri ,36, 0L);         
                                                         }; 
                                                         

                                                         if (zg_didit==1) 
                                                         { if (level!=11) scrollz=scrollz-2;
                                                       		SetRect(&re, 0,0,640,100);				                                       
                                                       		SetRect(&ri, 0,150,640,250);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,36, 0L);         
                                                         }; 
  												         // smart BOMB
  												        if (zg_didit==0)
  												        if (zg_gameover==0)
  												         if (scrollz>256)
  												         if (smbomb>0) { --smbomb;

                                                                       for (i=3;i<=spritezlr;++i) 
                                     					                 if (retus[i][4]!=0)
                                                        					//if (retus[i][19]==2)
                                                                       if (retus[i][4]!=1)
                                                                       {   retus[i][2]=1;
                                                                           retus[i][3]=1;
                                                                           retus[i][4]=1;
                                                                           retus[i][9]=5;
                                                                          // retus[i][14]=-retus[i][13];
                                                                           retus[i][13]=0;
                                                                           retus[i][19]=5;
                                                                       };
												
 												         /* ZERSTOERUNGE VON ALLEM ? 
                                                         SetRect(&re, 0,0,256,256);				                                       
                                                       		SetRect(&ri,192,72,192+256,72+256);				                                       					                                       
					                                        CopyBits(&((GrafPtr)  bsack)->portBits,&(((GrafPtr)  muriel)->portBits),&re,&ri ,36, 0L);           												         
  												         
  												        ZERSTOERUNGE VON ALLEM ? */
 												         };
  												
  												  /* OPTIMIERTE PRODUKTION */
  					
  															//FILM
                                                            eing=0;
                                                       		SetRect(&re,eing,0,640-eing,400); // 400 hier NEXT
					                                        SetRect(&ri,eing,0+40,640-eing,440); // 640,400 hier NEXT
					
													     // CopyBits(&muriel->portBits, &firstWin->portBits, &re, &ri, srcCopy, nil);
                                       
					                                        CopyBits(&((GrafPtr)  muriel)->portBits,&(((GrafPtr)  firstWin)->portBits),&re,&ri ,srcCopy, 0L);         
						                                 
						                                 
if (timesp==0) {
    afterTime=TickCount();       
/* DIE ZEIT ANGEZEIGT */
   SetPort((GrafPtr) firstWin);
    do ;
    while((TickCount()-beforeTime)<4); };

/*   	MoveTo(10,390);
	NumToString(afterTime - beforeTime, tempStr);
	DrawString(tempStr); */
	
    beforeTime=afterTime;

                                                        // };      
                                                      /* DER SCHUSS HAT EINEN ANDEREN  */
                                                      for (i=1;i<=spritezlr;++i)
                                                      if (retus[i][4]!=0)
                                                        if (retus[i][19]==2)
                                                         for   (q=1;q<=spritezlr;++q)
                                                          if (retus[q][19 ]!=6) // die EXTRAS
                                                          if (retus[q][19 ]!=5) // die EXPLOSIONEN
                                                            if (retus[q][19]!=2)  // EIN EIGENER                                                        
                                                          

                                                        
                                                        if ((retus[q][3]!=3) || (retus[i][3]==10))  // EIN GEGNERISCHER SCHUSS  
                                                          if (q!=i)
                                                          { zux1=retus[q][0]-retus[i][5]+retus[q][18]-retus[i][18];
                                                            zuy1=retus[q][1]-retus[i][6];
                                                            zux2=retus[q][0]+retus[q][5]+retus[q][18]-retus[i][18];
                                                            zuy2=retus[q][1]+retus[q][6];
                                                             
                                                         
                                                          lx=retus[i][0];
                                                          ly=retus[i][1];



                                                           if  (      (lx>zux1) 
                                                               && (lx<zux2)
                                                               && (ly>zuy1)
                                                               && (ly<zuy2))
                                                              {  
															
															
															
															
																 /* grsser kleiner */
																 if (retus[q][3]==18) {
																   tr=5+(5-retus[q][11])*6;
																   retus[q][0]= retus[q][0]+retus[q][5]/2-tr;
																   retus[q][1]= retus[q][1]+retus[q][6]/2-tr;
																   retus[q][5]= tr*2;
																   retus[q][6]= tr*2;
																 
																  // uiot
															   if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndver,TRUE); else
     																 if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndver,TRUE); 

																 };

                                                                  /* DER ZERSPRINGENDE METEROID  *************/     
 																  if (( retus[q][3]==19) && ( retus[q][5]==32)) // zerspringt in Teile
                                                                  { 
                                                                    for (tr=0;tr<=3;++tr)
                                                                     { trq=0;
                                                                      for (trr=2;trr<=spritezlr;++trr)
                                                                       if (trq==0) 
                                                                        if (retus[trr][4]==0)                                            
                                                                                                                    { trq=1;
                                                                                                                      
                                                                                                                    
                                                                                                                       retus[trr][0]=retus[i][0];                                                                                                                                         
                                                                                                                       retus[trr][1]=retus[i][1];
                                                                                                                       retus[trr][4]=2;
                                                                                                                       retus[trr][3]=19 ;
                                                                                                                       retus[trr][5]=16;
                                                                                                                       retus[trr][6]=16;
                                                                                                                       
                                                                                                                      
                                                                                                                       retus[trr][9]=5;
                                                                                                                       
                                                                                                                       wia=RandomInt(740)/100; 
                                                                                                                       retus[trr][13]=5*cos(wia);
                                                                                                                       retus[trr][14]=5*sin(wia);
                                                                                                					   retus[trr][0]=retus[trr][0]+16+10*cos(wia);
                                                                                                                       retus[trr][1]=retus[trr][1]+16+10*sin(wia);
                                                                                     
                                                                                                                        retus[trr][10]=wide; /* WEITE */
																													    retus[trr][11]=1; 
																													    retus[trr][18]=scrollz;
                                                                                                                        retus[trr][19]=3;
                                                                                                                       
                                                                                                                     }; };
                                                                                                 
                                                                      
                                                                      
                                                                  
                                                                      
                                                                  };
                                                                  /* DER ZERSPRINGENDE METEROID  *************/     


                                                                  /* DIE VERMEHRENDEN KUGELN   *************/     
 																  if (( retus[q][3]==5) && ( retus[q][6]==32)) // zerspringt in Teile
                                                                  { 
                                                                    for (tr=0;tr<=1;++tr)
                                                                     { trq=0;
                                                                      for (trr=2;trr<=spritezlr;++trr)
                                                                       if (trq==0) 
                                                                        if (retus[trr][4]==0)                                            
                                                                                                                    { trq=1;
                                                                                                                      
                                                                                                                    
                                                                                                                       retus[trr][0]=retus[i][0];                                                                                                                                         
                                                                                                                       retus[trr][1]=retus[i][1];
                                                                                                                       retus[trr][4]=2;
                                                                                                                       retus[trr][3]=5;
                                                                                                                       retus[trr][5]=32;
                                                                                                                       retus[trr][6]=20;
                                                                                                                       
                                                                                                                      
                                                                                                                       retus[trr][9]=5;
                                                                                                                       retus[trr][13]=-7;
                                                                                                                       retus[trr][14]=0;
                                                                                                                       
                                                                                                					   retus[trr][0]=retus[trr][0]+10;
                                                                                                                      if (tr==0)  retus[trr][1]=retus[trr][1]-37;
                                                                                     								  if (tr==1)  retus[trr][1]=retus[trr][1]+32;
                                                                                                                        retus[trr][10]=wide; /* WEITE */
																													    retus[trr][11]=1; 
																													    retus[trr][18]=scrollz;
                                                                                                                        retus[trr][19]=3;
                                                                                                                       
                                                                                                                     }; };
                                                                                                 
                                                                      
                                                                      
                                                                  
                                                                      
                                                                  };
                                                                  /* DIE VERMEHRENDEN KUGELN   *************/     

                                                               
                                                                 block=0;     
                                                                   /* EXTRAS-------------------------- */
                                                                   if ((retus[q][3]==15)  && (retus[q][2]==0))
                                                                  {  retus[q][19]=6; // 6 SIND DIE EXTRAS
                                                                     retus[q][3]=15;
                                                                     retus[q][5]=32;
                                                                     retus[q][6]=32;
                                                                     block=1;
                                                                      if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndexab,TRUE); else
    																  if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndexab,TRUE); 

                                                                     /* DIE FINTEN */
																		
                                                                        block=1;
                                                                        retus[q][2]=retus[q][12];
                      
                                                                 }; 
                                                                  
                                                                //  %%%%%%%%%%%%%%% DIE SCHUESSE GEHEN HINDURCH
                                                               if (retus[i][19]==2) // spezifiescher! 
                                                                if ((retus[q][3]==3) && (retus[q][5]==16) && (retus[q][6]==16)) 
                                                                   block=1;
                                                               
                                                              if (retus[q][19]==3)
                                                                  if (i==1) block=0;

                                                                //  %%%%%%%%%%%%%%% DIE SCHUESSE GEHEN HINDURCH  
                                                                  
                                                                  
                                                                  
                                                                 if (block==0)
                                                                 { 
                                                                 


                                                                  retus[i][2]=1;
                                                                  retus[i][4]=0;
                                                                  retus[i][3]=1;
                                                                  retus[i][9]=0;
                                                                  retus[i][19] =0;
                                                                
                                                                
                                                                 tx=retus[q][9];
                                                                 ty=retus[q][3];
                                                                  /* SCHUESSE BLEIBEN UNVERLETZT */
                                                                 if (shield==1)
                                                                  { 
                                                                  if (retus[q][19]==3)
                                                                  if (i==1)
                                                                   { 
                                                                   

                                                                  if ((retus[q][5]*retus[q][6])<1050) {
                                                                     if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,all[2],TRUE); else
     																 if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,all[2],TRUE); 
     																 } else { 
     																if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,all[3],TRUE); else
     																 if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,all[3],TRUE); 
     																 };

                                                                   retus[q][2]=1;
                                                                   retus[q][3]=1;
                                                                   retus[q][19]=5; 
                                                             
                                                                   score=score+100;
                                                                   zg_score=1;
                                                             --shieldz;
                                                             if (shieldz<0)  { shield=0; } else
                                                             // oh no
                                                                 {    if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndsh,TRUE); else
     																 if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndsh,TRUE); };

                                                          /*   else    if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndrot,TRUE); else
    																  if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndrot,TRUE); */

                                                                   
                                                                   // do ; while(Button()==true);
                                                                   };
                                                                  };
 
                                                                /* OBERMOTZ MUSS MEHRM ALS GETROFFEN WERDEN  */
                                                                uiox=0;  
                                                               
                                                                if (retus[q][3]!=3)
                                                                {  
                                                                
                                                                if (retus[q][11]>0)  { 
                                                              
                                                              /* verschiedene Schuesse - verschiedener Sound !! */
                                                              if (PAUD==0)  -- retus[q][11];                    					                      if (PAUD==0) { if (lx>2) lx=0; };
                      					                      if (PAUD==1)  retus[q][11]=retus[q][11]-2;
                      					                      if (PAUD==2)  retus[q][11]=retus[q][11]-3; 

                                                               

																score=score+25;
                                                                zg_score=1;                                                                  
                                         
															   if (retus[q][11]>0) {
     if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndange,TRUE); else
      if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndange,TRUE);                                                                
																
																  // beim Endmonster etwas anderes
																};
                                                                };
                                                               
                                                            if (retus[q][11]<1)
                                                                if (retus[q][3]==8) //VULKAN GETROFFEN BEISPIELE VON VERKRUEPPELUNG
                                                                 {  //SetPort((GrafPtr) bsack);
                                                                    SetRect(&ri, retus[q][18]+retus[q][0],retus[q][1],retus[q][18]+retus[q][0]+retus[q][5],retus[q][1]+retus[q][6]);

																	 SetRect(&re,320,0,320+32,32);    // ABOUT
					                 								 //SetRect(&ri,0,100,640,350);
									 								 CopyBits(&((GrafPtr)  anima )->portBits,&(((GrafPtr)  bsack)->portBits),&re,&ri,36, 0L);                      
                                                                  
                                                                  /*   ic0=GetCIcon(4000 );
                                                                    if (ic0!=0L)  { PlotCIcon(&ref,ic0);
                                                                                           DisposeCIcon(ic0);        
                                                                                         };   // AENDERN VON OBEN KOPIEREN !! */                        
                                                                 };
                  
                                                                
                                                               if (retus[q][11]<=0)
                                                                 {
if  ((retus[q][5]>28) || (retus[q][6]>28)) {     score=score+200;                                                               
   if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,all[3],TRUE); else
      if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,all[3],TRUE); 
       } else {  score=score+400;
       if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,all[2],TRUE); else
      if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,all[2],TRUE); };
                                                                 
                                                                  retus[q][2]=1;
                                                                   retus[q][3]=1;
                                                                   retus[q][19]=5;
                                                                   
                                                                 
                                                                  zg_score=1;                                                                  
                                                                   /* alles Explodiert --- !!! */
                                                                                                                                                                                                                                  
                                                                                                                        };                
                                                                
                                                                uiox=1;                   }; 
                                                              

                                                          };  // weg  

                                                         };                                                         
                                                         
                                                         };    
                                                    
                                                    
                              /* -------------------------MICH HAT ES NUN */
                                                    i=0;
                                                
                                                   for (q=1;q<=spritezlr;++q)
                                                         if (retus[q][4]!=0) 
                                                        // if (retus[q][19]==3) 
                                                          { zux1=retus[q][0]-retus[i][5]+retus[q][18]-retus[i][18];
                                                            zuy1=retus[q][1]-retus[i][6];
                                                            zux2=retus[q][0]+retus[q][5]+retus[q][18]-retus[i][18];
                                                            zuy2=retus[q][1]+retus[q][6];
                                                          
                                                          lx=retus[0][0];                                                                                  
                                                          ly=retus[0][1];
                                                          if (retus[0][3]!=1)
                                                             if (retus[0][2]!=1)
                                                       
                                                           
                                                          if  (      (lx>zux1) 
                                                               && (lx<zux2)
                                                               && (ly>zuy1) 
                                                               && (ly<zuy2))
                                                              {  

                                                     /* JEMAND TRIFFT MICH */
                                                    if (holdzlr==-1)
                                                     if (retus[q][19]==3) 
                                                              {
                                                                   retus[q][3]=1;
                                                                   retus[0][3]=1;
                                                                  retus[q][2]=1;
                                                                    retus[0][2]=1;
                                                                    retus[q][19]=5;
                                                                    retus[0][19]=5;
                                                                    /* TOD ENDE GUT SONG */
                                                                    if (shield==1)
                                                                   {
                                                                      retus[1][3]=1;
                                                                        retus[1][2]=1;
                                                                       retus[1][19]=5; };
                                                                       shield=0;
                                                                  
if  (SndChannelBusy(sndc1)==FALSE) { SndPlay(sndc1,all[5],TRUE); SndPlay(sndc1,all[11],TRUE); }else                                                                                                                                                                                                
   if  (SndChannelBusy(sndc0)==FALSE)  { SndPlay(sndc0,all[5],TRUE); SndPlay(sndc0,all[11],TRUE);} 
                
                                                               };
                                                              
                                                              
                                                     /* EXTRASAUFNAHME */
                                                     if (retus[q][19]==6) 
                                                            {
                                                                   blockz=0; 
                                                                   block=retus[q][12];
                                                                   if (block==5) {shield=1; shieldz=5; blockz=1; }; // + SOUND
                                                                   if (block==11)  {super=5; blockz=1; };// + SOUND
                                                                   if (block==3)  {back=1; blockz=1; };// + SOUND
                                                                   if (block==2)  { side=1; blockz=1;}; // + SOUND/ 
                                                                   if (block==6) 
                                                                      if (live<=8) { ++live; blockz=1; }; 
                                                                   if (block==4) 
                                                                      if (power<=1){ ++power; blockz=1;}; // + SOUND
                                                                     
                                                                    /* POWER BEI DEN SCHUESSEN */
                                                                    
                                                                    if (block==9)
                                                                       if (PAUD<2) { ++ PAUD;
                                                                        blockz=1;
                                                                        };
                                                                    
                                                                   if (block==8)  { holdzlr=90; blockz=1;}; // + SOUND
                                                                   /* SMART BOMB */
                                                                   if (block==7)  { blockz=1; 
                                                                      /* THE ULTIMATIVE BOMB */

      if (scrollz>256) {
/*SetPort((GrafPtr) bsack); // ein SChrei
 
    apple=GetPicture(133);
    SetRect(&rec,0,0,256,256 );
     HUnlock((Handle) apple);
    DrawPicture(apple,&rec);               
    ReleaseResource((Handle) apple);
  
    smbomb=20;  */
    
    // EXPLOSION !!
    
     };

    	

                                                                       for (i=3;i<=spritezlr;++i) 
                                     					                 if (retus[i][4]!=0)
                                                        					//if (retus[i][19]==2)
                                                                       {   retus[i][2]=1;
                                                                           retus[i][3]=1;
                                                                           retus[i][4]=1;
                                                                           retus[i][9]=5;
                                                                          // retus[i][14]=-retus[i][13];
                                                                           retus[i][13]=0;
                                                                           retus[i][19]=5;
                                                                       };
												
                                                                                  
                                                                     if  (SndChannelBusy(sndc3)==FALSE) SndPlay(sndc3,sbo,TRUE);
                                                                                  
                                                                                  
                                                                                  }; // + SOUND
                                                                 
                                                                 // 6== 1UP up etc
                                                                 // 4== POWER
                                                                 // 7== BOMBE
                                                                  if (blockz==1)
                                                                  {
                                                                     if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndextra,TRUE); else
     																 if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndextra,TRUE); 
                                                                   score=score+1000;
                                                                   zg_score=1;
                                                                   retus[q][2]=0;
                                                                   retus[q][19]=0;
                                                                   retus[q][3]=0;
                                                                   retus[q][4]=0; };

                                                                };  
                                                              }; 
                                                              
                                                             }; 
                                                     
                                                     
 
                                                     /* HINTERGRUND   */
                                                      if (zg_didit==0)
                                                        for (i=0;i<=499;++i)
                                                         for (q=0;q<=spritezlr;++q)
                                                          if (les[i][4]!=29)
                                                          if (les[i][4]!=30) 
                                                          if (les[i][4]!=36)
                                                          if (les[i][4]!=37) 
                                                         if (retus[q][19]!=5)   
                                                          if (retus[q][4]!=0) 
                                                          if (les[i][4]!=0)                                                           
                                                          { zux1=les[i][0]-scrollz -retus[q][5]+5;
                                                             zuy1=les[i][1]-retus[q][6]+5;
                                                            zux2=les[i][2]-scrollz;
                                                            zuy2=les[i][3];
                                                             
                                                             lx=retus[q][0]+retus[q][18]-scrollz;
                                                            ly=retus[q][1];
                                                          
                                                          if  (      (lx>zux1)  
                                                                && (lx<zux2)
                                                                && (ly>zuy1)
                                                               && (ly<zuy2)) 
                                                              {     
                                                               
                                                         

                                                               /* DAS NORMALE */
                                                               if (retus[q][3]==0)
                                                                     {
                                                               if  (q==0) 
                                                               {        if (holdzlr<=0)   {
                                                                    
                                                                  
                                                                    retus[q][2]=1; 
                                                                    retus[q][3]=1;
                                                                    retus[q][4]=1;
                                                                    retus[q][19]=5;
                                                                    retus[q][9]=0;      																 
     																 
                                                                    
                                                                              } else
                                                                   if ((scrollz%20)==0) {
                                                                     if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndrot,TRUE); else
     																 if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndrot,TRUE); };
                                                                    
                                                                                                                          
                                                               
                                                                      } ;
                                                                      
                                                                                                                                   
                                                                   if (shield==1)
                                                                   { shield=0;  
                                                                     retus[1][2]=1; 
                                                                    retus[1][3]=1;
                                                                    retus[1][4]=1;
                                                                    retus[1][19]=5;
                                                                    retus[1][9]=0;  
                                                                   } ; 
                                                                 
                                                                   
                                                                  }; 
                                                                
                                                               tx=0;
                                                               /* Die GEGENER  */
                                                               if (retus[q][19]==3)
                                                                   if (tx==0)
                                                                     {
                                                                  /* DER ZERSPRINGENDE METEROID  *************/     
 																  if (( retus[q][3]==19) && ( retus[q][5]==32)) // zerspringt in Teile
                                                                  { 
                                                                    for (tr=0;tr<=3;++tr)
                                                                     { trq=0;
                                                                      for (trr=2;trr<=spritezlr;++trr)
                                                                       if (trq==0) 
                                                                        if (retus[trr][4]==0)                                            
                                                                                                                    { trq=1;
                                                                                                                      
                                                                                                                    
                                                                                                                       retus[trr][0]=retus[q][0];                                                                                                                                         
                                                                                                                       retus[trr][1]=retus[q][1];
                                                                                                                       retus[trr][4]=2;
                                                                                                                       retus[trr][3]=19 ;
                                                                                                                       retus[trr][5]=16;
                                                                                                                       retus[trr][6]=16;
                                                                                                                       
                                                                                                                      
                                                                                                                       retus[trr][9]=5;
                                                                                                                       
                                                                                                                       wia=RandomInt(740)/100; 
                                                                                                                       retus[trr][13]=5*cos(wia);
                                                                                                                       retus[trr][14]=5*sin(wia);
                                                                                                					   retus[trr][0]=retus[trr][0]+16+10*cos(wia);
                                                                                                                       retus[trr][1]=retus[trr][1]+16+10*sin(wia);
                                                                                     
                                                                                                                        retus[trr][10]=wide; /* WEITE */
																													    retus[trr][11]=1; 
																													    retus[trr][18]=retus[q][18];
                                                                                                                        retus[trr][19]=3;
                                                                                                                       
                                                                                                                     }; };
                                                                                                 
                                                                      
                                                                      
                                                                  
                                                                      
                                                                  };
                                                                  /* DER ZERSPRINGENDE METEROID  *************/                                                                        
                                                                  
                                                                    retus[q][2]=1; 
                                                                    retus[q][3]=1;
                                                                    retus[q][4]=1;
                                                                    retus[q][19]=5;
                                                                    retus[q][9]=0;  }; 
    
       
                                                                /* EIN BLOCK ZERS CHOSSEN ? */
                                                             if (q!=0)
                                                              if (retus[q][19]==2)
                                                              if (retus[q][3]!=10)
                                                               {  if (les[i][5]>0) { 

															  /* EXTRASTAERKE */
                                                              if (PAUD==0)  --les[i][5];                    					                      if (PAUD==0) { if (lx>2) lx=0; };
                      					                      if (PAUD==1)  les[i][5]=les[i][5]-2;  
                      					                      if (PAUD==2)  les[i][5]=les[i][5]-3;  
                                                                                             if (les[i][5]<1) 
                                                                                                { 

                                                                                                
                                                                                                /* SEVEN --- 
                                                                                                EXPLODIERT UND EIN SPRITE */
             
                   					                                      if (les[i][4]==38) {
                   					                                         q=0;
                   					                                         
                   					                                         for (ax=3;ax<= spritezlr;++ax)
																			   {          
																			                                                       if (q==0)
																			                                                       if  (retus[ax][ 4]==0)  // EINEN GEFUNDEN SONST LASSEN WIRS ..
																			                                                         {   q=1; 
 														 					                                                             retus[ax][0]=les[i][0]+(les[i][2]-les[i][0])/4-scrollz;
 																			                                                             retus[ax][1]=les[i][1]+(les[i][3]-les[i][1])/4;
																			                                                             retus[ax][2]=RandomInt(3) ;
																			                                                              retus[ax][3]=7; retus[ax][4]=7; 
																			                                                            
																			                                                             
																			                                                             retus[ax][5]=32;
																			                                                            retus[ax][6 ]=32; 
				 									 						                                                            
																			                                                            retus[ax][9]=5; //BEWEGUNG
																			                                                             retus[ax][18]=scrollz;
																			                                                          
																			                                                            /* ZIELEN */
																			                                                            /* ZIELEN */
																			                    r=retus[0][18]+retus[0][5]/2+retus[0][0]-(retus[ax][18]+retus[ax][5]/2+retus[ax][0]) ;
																			                  rr=retus[0][1]-retus[i][1]-retus[i][6]/2;                                          
																			                   retus[ax][13]=5*r/sqrt(r*r+rr*rr);
																						  	   retus[ax][14]=-5*rr/sqrt(r*r+rr*rr);                                              
                                                                                             
																			                                                            retus[ax][19]=3;     //GEGNER 
                                                                                                                                         ax=200;
                                                                          
																			  if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,sndhi,TRUE); else
     																			 if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,sndhi,TRUE); // sndhi 
                                                                                    // anderer Sound bei spuken                                          
                                                                                                                                         
                                                                                                                                         
																			                                                       };
                                                                                                                             }; };                                                                                            
                                                                                                
                                                                                                
                                                                                                
                                                                                                les[i][4]=0;
                                                                                                 SetPort((GrafPtr) bsack);
                                                                                                 SetRect(&re,les[i][0],les[i][1],les[i][2],les[i][3]);
                                                                                                 FillCRect(&re,lee);
                                                                                                        retus[q][0]=les[i][0]-scrollz;
                                                                                                       retus[q][1]= les[i][1];
                                                                                                       retus[q][5]=les[i][2]-les[i][0];
                                                                                                       retus[q][6]= les[i][3]-les[i][1];
 if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,all[8],TRUE); } else
 {                                       
  if  (SndChannelBusy(sndc0)==FALSE) SndPlay(sndc0,all[7],TRUE); }
                                                                                                 
                                                                                              };
                                                         
                                                                     } ;
                                                                     
                                                                  if (q!=0)
                                                                   if (retus[q][19]==2)
                                                                  {
                                                                     retus[q][2]=1;
                                                                    retus[q][3]=1;
                                                                    retus[q][4]=1;
                                                                    retus[q][9]=0; 
                                                                     retus[q][6]=retus[q][5]; 
                                                                     retus[q][19]=5;  }; 
               
                                                         }; };

                                            
                                                        
                                                  
         /* ===================== SCHUESSE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ================= */                                                 
                                                                                                             
                                                 
                                                  
                                                       GetKeys(theKeys);  
                                                
 
                                                if (tode==0)
                                                { 
                                                          /* =====================DER NORMALSCHUSS================= */
                                                zulo=0;
                                                if (zulo==0)
                                                {
                                                       if (Buttan()==0)
                                                           if (zu==0)  {   zuto=1;           
                                                                                          };
                                                      if  (Buttan()==1)  
                                                         if (zu==0)
                                                           if (zuto==1)
                                                                                  {       
 
  if ((side==0) && (back==0)) { if  (SndChannelBusy(sndc3)==FALSE) SndPlay(sndc3,all[6],TRUE);;      } else 
   							  { if  (SndChannelBusy(sndc3)==FALSE) SndPlay(sndc3,sndschussm,TRUE);   }; 
                                                            
                                                                  
                                                                if ( (power==0) || (power==2)) 
                                                                {
                                                                                           zulo=1;                                                          
                                                                                                zu=8; 
                                                                                                 q=0;
                                                                                                  for (i=0;i<=spritezlr;++i)
                                                                                                  { if (q==0) 
                                                                                                       if (retus[i][4]==0)             
                                                                                                                    { q=1;
                                                                                                                       retus[i][3]=2;
                                                                                                                       retus[i][0]=retus[0][0]+32;
                                                                                                                       if (shield==1)  retus[i][0]=retus[i][0]+27;
                                                                                                                       retus[i][1]=retus[0][1]+8;
                                                                                              
                                                                                                                       
                                                                                                                       retus[i][5]=24;
                                                                                                                       retus[i][6]=18;
                                                                                                                       retus[i][4]=3;
                                                                                                                       retus[i][9]=5;
                                                                                                                       retus[i][13]=24;
                                                                                                                       retus[i][14]=0;
                                             
                                                                                                                       retus[i][10]=wide; /* WEITE */
																													   retus[i][18]=scrollz;
                                                                                                                        retus[i][19]=2;
                                                                                                                         zulozlr=0;
                                                                                                                    
                                                                                                                        /* PAUD */
                      					                      if (PAUD==0) retus[i][2]=0;
                      					                      if (PAUD==1) retus[i][2]=3;
                      					                      if (PAUD==2) retus[i][2]=6;
                                                                                                                    
                                                                                                                     };
                                                                                                  };
                                                                                       
                                                                                                                                                                                    
                                                                        };
                                                                     
                                                                         /* power== 1 */
                                                                         if (power==1)
                                                                         { 

                                                                                           zulo=1;                                                          
                                                                                                zu=8; 
                                                                                                 q=0;
                                                                                                  for (i=0;i<=spritezlr;++i)
                                                                                                  { if (q==0) 
                                                                                                       if (retus[i][4]==0)             
                                                                                                                    { q=1;
                                                                                                                       retus[i][3]=2;
                                                                                                                       retus[i][0]=retus[0][0]+32;
                                                                                                                       if (shield==1)  retus[i][0]=retus[i][0]+27;                    
                                                                                                                       retus[i][1]=retus[0][1];
                                                                                               
                                                                                                                       
                                                                                                                       retus[i][5]=24;
                                                                                                                       retus[i][6]=18;
                                                                                                                       retus[i][4]=3;
                                                                                                                       
                                                                                                                       retus[i][9]=5;
                                                                                                                       retus[i][13]=24;
                                                                                                                       retus[i][14]=0;
                                                                                              
                                                                                                                       retus[i][10]=wide; /* WEITE */
																													   retus[i][18]=scrollz;
                                                                                                                        retus[i][19]=2;
                             
                                                                                                                       zulozlr=0;
                            
                            
                                                                                                                       /* PAUD */
                      					                      if (PAUD==0) retus[i][2]=0;
                      					                      if (PAUD==1) retus[i][2]=3;
                      					                      if (PAUD==2) retus[i][2]=6;
                             
                                                                                                                     };
                                                                                                  };
                                                                                       
  
                                                                                                zulo=1;                                                          
                                                                                                zu=8; 
                                                                                                 q=0;
                                                                                                  for (i=0;i<=spritezlr;++i)
                                                                                                  { if (q==0) 
                                                                                                       if (retus[i][4]==0)             
                                                                                                                    { q=1;
                                                                                                                       retus[i][3]=2;
                                                                                                                       retus[i][0]=retus[0][0]+32+RandomInt(3);
                                                                                                                       if (shield==1)  retus[i][0]=retus[i][0]+27;
                                                                                                                       retus[i][1]=retus[0][1]+18;
                                                                                              
                                                                                                                       
                                                                                                                       retus[i][5]=18;
                                                                                                                       retus[i][6]=12;
                                                                                                                       retus[i][4]=3;
                                                                                                             
                                                                                                                      retus[i][9]=5;
                                                                                                                       retus[i][13]=24;
                                                                                                                       retus[i][14]=0;
                                                                                               
                                                                                                                     
                                                                                                                       retus[i][10]=wide; /* WEITE */
																													   retus[i][18]=scrollz;
                                                                                                                       retus[i][19]=2;
                                                                                                                         zulozlr=0;
                              
                                                                                                                         /* PAUD */
                      					                      if (PAUD==0) retus[i][2]=0;
                      					                      if (PAUD==1) retus[i][2]=3;
                      					                      if (PAUD==2) retus[i][2]=6;
                             
                                                                                                                     };
                                                                                                  };
                                                                         
                                                                            };
                                                               if (power==2)
                                                                {
                                                                                           zulo=1;                                                          
                                                                                                zu=8; 
                                                                                                 q=0;
                                                                                                  for (i=0;i<=spritezlr;++i)
                                                                                                  { if (q==0) 
                                                                                                       if (retus[i][4]==0)             
                                                                                                                    { q=1;
                                                                                                                       retus[i][3]=6;
                                                                                                                       retus[i][0]=retus[0][0]+16;
                                                                                                                       //if (shield==1)  retus[i][0]=retus[i][0]+27;
                                                                                                                       retus[i][1]=retus[0][1]+16+3;
                                                                                              
                                                                                                                       
                                                                                                                       retus[i][5]=16;
                                                                                                                       retus[i][6]=12;
                                                                                                                       retus[i][4]=3;
                                                                                                                       retus[i][9]=5;
                                                                                                                       
                                                                                                                       retus[i][13]=19; // sonst 5
                                                                                                                       retus[i][14]=19; 
                                                                                                                       retus[i][10]=wide; /* WEITE */
																													   retus[i][18]=scrollz;
                                                                                                                        retus[i][19]=2;
                                                                                                                        zulozlr=0;
                                                                                                                         /* PAUD */
                      					                      if (PAUD==0) retus[i][2]=0;
                      					                      if (PAUD==1) retus[i][2]=3;
                      					                      if (PAUD==2) retus[i][2]=6;
                                                                                                                       
                                                                                                                 
                                                                                                                     };
                                                                                                  };
                                                                                                zulo=1;                                                          
                                                                                                zu=8; 
                                                                                                 q=0;
                                                                                                  for (i=0;i<=spritezlr;++i)
                                                                                                  { if (q==0) 
                                                                                                       if (retus[i][4]==0)             
                                                                                                                    { q=1;
                                                                                                                       retus[i][3]=6;
                                                                                                                       retus[i][0]=retus[0][0]+16;
                                                                                                                       //if (shield==1)  retus[i][0]=retus[i][0]+27;
                                                                                                                       retus[i][1]=retus[0][1]-3;
                                                                                              
                                                                                                                       
                                                                                                                       retus[i][5]=16;
                                                                                                                       retus[i][6]=12;
                                                                                                                       retus[i][4]=3;
                                                                                                                       retus[i][9]=5;
                                                                                                                       
                                                                                                                       retus[i][13]=19; //sonst 5
                                                                                                                       retus[i][14]=-19;
                                                                                                                       retus[i][10]=wide; /* WEITE */
																													   retus[i][18]=scrollz;
                                                                                                                        retus[i][19]=2;
                                                                                                                        zulozlr=0;
                                                                                                                        
                                                                                                                 
                                                                                                                     };
                                                                                                  };
                                                                                       
                                                                                                                                                                                    
                                                                        };                                                                            


 																	   if (waitus>3) waitus=0;  
 																	   ++waitus; 
                                                                       // waitus=0;
                                                                       if (side==1)
                                                                        //if (waitus==1)
                                                                         { 

                                                                                           zulo=1;                                                          
                                                                                                zu=8; 
                                                                                                 q=0;
                                                                                                  for (i=0;i<=spritezlr;++i)
                                                                                                  { if (q==0) 
                                                                                                       if (retus[i][4]==0)             
                                                                                                                    { q=1;
                                                                                                                       retus[i][3]=13;
                                                                                                                       retus[i][0]=retus[0][0]+16;
                                                                                                                                         
                                                                                                                       retus[i][1]=retus[0][1]-16;
                                                                                               
                                                                                                                       
                                                                                                                       retus[i][5]=18;
                                                                                                                       retus[i][6]=12;
                                                                                                                       retus[i][4]=3;
                                                                                                                       
                                                                                                                       retus[i][9]=5;
                                                                                                                       retus[i][13]=1;
                                                                                                                       retus[i][14]=-24;
                                                                                              
                                                                                     
                                                                                                                       retus[i][10]=wide; /* WEITE */
																													   retus[i][18]=scrollz;
                                                                                                                        retus[i][19]=2;
                                                                                                                        zulozlr=0;
                                                                                                                     };
                                                                                                  };
                                                                                       
  
                                                                                                zulo=1;                                                          
                                                                                                zu=8; 
                                                                                                 q=0;
                                                                                                  for (i=0;i<=spritezlr;++i)
                                                                                                  { if (q==0) 
                                                                                                       if (retus[i][4]==0)             
                                                                                                                    { q=1;
                                                                                                                       retus[i][3]=14;
                                                                                                                       retus[i][0]=retus[0][0]+16;
                                                                                                                      
                                                                                                                       retus[i][1]=retus[0][1]+32;
                                                                                              
                                                                                                                       
                                                                                                                       retus[i][5]=18;
                                                                                                                       retus[i][6]=12;
                                                                                                                       retus[i][4]=3;
                                                                                                             
                                                                                                                      retus[i][9]=5;
                                                                                                                       retus[i][13]=1;
                                                                                                                       retus[i][14]=24;
                                                                                               
                                                                                                            
                                                                                                                       retus[i][10]=wide; /* WEITE */
																													   retus[i][18]=scrollz;
                                                                                                                       retus[i][19]=2;
                                                                                                                         zulozlr=0;
                                                                                                                     };
                                                                                                  };
                                                                         
                                                                            };                                                            

                                                                        if (back==1)
                                                                         { 

                                                                                           zulo=1;                                                          
                                                                                                zu=8; 
                                                                                                 q=0;
                                                                                                  for ( i=0;i<=spritezlr;++i)
                                                                                                  { if (q==0) 
                                                                                                       if (retus[i][4]==0)             
                                                                                                                    { q=1;
                                                                                                                        retus[i][3]=12;
                                                                                                                       retus[i][0]=retus[0][0]-16;
                                                                                                                                         
                                                                                                                       retus[i][1]=retus[0][1]+10;
                                                                                               
                                                                                                                       
                                                                                                                       retus[i][5]=18;
                                                                                                                       retus[i][6]=10;
                                                                                                                       retus[i][4]=3;
                                                                                                                       
                                                                                                                       retus[i][9]=5;
                                                                                                                       retus[i][13]=-24;
                                                                                                                       retus[i][14]=0;
                                                                                              
                                                                                     
                                                                                                                       retus[i][10]=wide; /* WEITE */
																													   retus[i][18]=scrollz;
                                                                                                                        retus[i][19]=2;
                                                                                                                        zulozlr=0;
                                                                                                                     };
                                                                                                  };
                                                                                       };





                                                                          }; // ====================
                                                                         
                                                                         
               
                                                         };
                                                         if  (zu!=0) -- zu;
                                                          
                                                          /* =====================DER SUPERSCHUSS================= */
                                                       if (zulo==1)
                                                       {
                                                          if (Buttan()==1)    ++zulozlr;
                                                        
                                        
                                                           
                                                           
                                                              };
                                                        };

								// SHIELD
       
										         
											     /* PAUSE ODER EXIT ? */
											     a=0;
											     if  ((BitTst(&theKeys,54)==TRUE) || (BitTst(&theKeys,36)==TRUE) || (BitTst(&theKeys,50)==TRUE))
											     {     SetPort((GrafPtr) firstWin); 
  										               apple=GetPicture(140);
										               SetRect(&rec,0,450,640,470);
										               HUnlock((Handle) apple); 
										               DrawPicture(apple,&rec);                
										               ReleaseResource((Handle) apple);  
 													   if  (SndChannelBusy(sndc1)==FALSE) SndPlay(sndc1,click,TRUE); 
 													   if  (SndChannelBusy(sndc3)==FALSE) SndPlay(sndc3,spause,TRUE); 

											      
                                                 SetCCursor(cune[0]);    
                                                 ShowCursor(); 											      
											      i=0;
											   
											     a=0;
											       SetPort((GrafPtr) bsack);
											      do {     //wor
   if (musicf==1)
    if (quicktimei==1) {
		HY_ServiceTasks();
		ProcessQuickTimeMovie(); };
											       											       
											       
											        GetKeys(theKeys);                         
 GetMouse(&mousepix);   tx=mousepix.h-aint; ty =mousepix.v-aaint; 
														   if ((Button()==TRUE) || (Buttan())) {
															 if (((tx<320) && (tx>0) && (ty>450) && (ty<470)) ||
															      (Buttan()))
											                   {    SndPlay(sndc0,click,TRUE);  
											                   do ;  while (SndChannelBusy(sndc0)==TRUE);

  i=1;  
if (CHEAT==1)  a=2; //NEXT LEVEL

// loeschen
  SetPort((GrafPtr) firstWin);
  SetRect(&rec,0,440,640,480);
  FillCRect(&rec,leers);

  };

															 if ((tx>320) && (tx<640) && (ty>450) && (ty<470))
											                   {  a=1;   SndPlay(sndc0,click,TRUE);  

											                   do ;  while (SndChannelBusy(sndc0)==TRUE);

 i=1;
 
  /* EXIT TO MENU */
if (musicf==1)
 if (quicktimei==1) {
	HY_UnregisterAllSoundResources();
	HY_Cleanup();
	EndQuickTimeMovie();
	FlushEvents(everyEvent, 0);	// clear all events

	theErr = HY_Setup(kUseStereo, 3);
	appDoneFlag = FALSE;
	processStereoPan = FALSE;
	movieInProgress = FALSE;
    
    mus=0;
    StartQuickTimeMovie(); }; 		
  };	
 
										
											     
											                };
											       } while (i==0);
											       HideCursor();

										           SetRect(&rec,0,450,640,470);
												   FillCRect(&rec,leers);
											    };
											
											
		/* NACH DEM TODE WIRD GEZAEHLT */
		  if (tode==1) {  ++nt;                      
		      			 
 if (zg_gameover==0) {
/* GAME OVER UND I DID IT*/
SetPort((GrafPtr) bsack);
  endef=1;
  apple=GetPicture(138);
  if (scrollz>640) SetRect(&trec,0,0,640,100);
  else SetRect(&trec,2560-640,0,2560,100);
  HUnlock((Handle) apple);
  DrawPicture(apple,&trec);               
  ReleaseResource((Handle) apple);  };

if  (SndChannelBusy(sndc3)==FALSE)  SndPlay(sndc3,sgamo,TRUE); 
						zg_gameover=1;
		               }; // GAME OVER !! KOPIEREN
		  if (nt>100) a=1; 
		

/*===========  ENDE DES LEVELS -  KILLED MONSTER  ============*/
          if ((in==2) && (inz>90)) a=2;                                                     
                                                   
/*     													===========  ENDE DES LEVELS -  KILLED MONSTER  ============*/

			
			
											    
											         } 
											  while ( a<1 );
											  
        //SndDisposeChannel(sndc2, true);

        ++level; // FALLS DER LETZTE LEVEL ERREICHT IST
        
        // DIE ERSTEN 3 DURCHGESPIELT
        if (level==3)  live=live+3;
        if (level%3==0) ++live;
        /* ENDE GUT ALLES ZERSTOERT */
        //RESNO
        if (level==12) {


    SetPort((GrafPtr) firstWin);
 
        apple=GetPicture(144);
        SetRect(&rec,0,40,640,480);
        HUnlock((Handle) apple);
        DrawPicture(apple,&rec);               
        ReleaseResource((Handle) apple);  
        
        
        do ; while(Button()==false);
        
         endef=2;
         doit=1;
        };      
        
          
        /* Ende - neue Highscore ende der LEvel */
        if (a==1) doit=1; // EXIT    -------   sonst ist a>1
        
        } while(doit==0);
 
 
 /* ----------- */
 /* EINGABE DES HIGHSCORES */
    // EINGABENFELD 
    
                
       if (endef!=0) {          
 
 /* EIN NEUER EINTRAG ? */
              hgc=score;
 
              o=15; /* ???? */
              for (i=0;i<=5;++i)
              { if (o==15)
                if (hgc>sc[i])
                 { o=1; oo=i;           
                 
                   
              };
              
              };                           
            
            // HIER
            if (o!=15) {
            
            // EINGABE DES NAMENS!!!! HIER
            
/* DAS EINGABEFELD */

                  SetPort((GrafPtr) firstWin);
               	  SetRect(&re,0,40,640,480);
				  FillCRect(&re,leers);

			              SetRect(&rec,210,85,430,390);
                                                 apple=GetPicture(159);
                                                 HUnlock((Handle) apple);
                                                 DrawPicture(apple,&rec);               
                                                 ReleaseResource((Handle) apple);  

                  SetPort((GrafPtr) anima);
			              SetRect(&rec,210,85,430,390);
                                                 apple=GetPicture(159);
                                                 HUnlock((Handle) apple);
                                                 DrawPicture(apple,&rec);               
                                                 ReleaseResource((Handle) apple);  

                  SetPort((GrafPtr) muriel);
			              SetRect(&rec,210,85,430,390);
                                                 apple=GetPicture(160);
                                                 HUnlock((Handle) apple);
                                                 DrawPicture(apple,&rec);               
                                                 ReleaseResource((Handle) apple);  


                 SetPort((GrafPtr) firstWin);
				 // EINGEGEBEN
				   /* eingabe 
              eingz=0;
             eing[6]="      ";
             eingc=' '; */
                 eingz=0;
                 for (i=0;i<=6;++i)
                  eingn[i]=' ';
                 
				 hf=0;
				 
				 aru=0; aruu=0;
				 bru=1; bruu=1;
				 
				 SetCCursor(cune[0]);    
                 ShowCursor(); 

				 do { 
			      GetMouse(&mousepix);  
                  x=mousepix.h;
                  y=mousepix.v;
				  
				  if ((x>210) && (x<425) && (y>85) && (y<390)) {
				   x=x-210;
				   y=y-85;
				  
				  
				  /* AUF WAS ZEIGT MAN GERADE ? */
				   if ((y>42) && (y<(42+6*42))) {
				    ru=x/43;
				    ruu=y/42;
				    bru=ru*43;
				    bruu=ruu*42;
				  if (bruu==6*42) {
				    if (bru==2*43) bru=1*43;
				    if (bru==4*43) bru=3*43; };
				
				/* DAS ORGINAL */
				 if ((aru!=bru) || (aruu!=bruu))
				   { SndPlay(sndc0,menuclick,TRUE);
                    
                  if (bruu!=6*42) {
				    SetRect(&rec,210+bru+5,85+bruu+1,210+bru+43+5,85+bruu+47+1);
				    SetRect(&re,210+bru+5,85+bruu+1,210+bru+43+5,85+bruu+47+1); } else
				    { 
				   if (bru==0) {
				    SetRect(&rec,210+bru+5,85+bruu+1,210+bru+43+5,85+bruu+47+1);
				    SetRect(&re,210+bru+5,85+bruu+1,210+bru+43+5,85+bruu+47+1);
				   };
				   if (bru==1*43)  {
				    SetRect(&rec,210+bru+5,85+bruu+1,210+bru+86+5,85+bruu+47+1);
				    SetRect(&re,210+bru+5,85+bruu+1,210+bru+86+5,85+bruu+47+1);};
				   if (bru==3*43)  { 
				    SetRect(&rec,210+bru+5,85+bruu+1,210+bru+86+5,85+bruu+47+1);
				    SetRect(&re,210+bru+5,85+bruu+1,210+bru+86+5,85+bruu+47+1);};

				 };
				    
					CopyBits(&((GrafPtr)  muriel)->portBits,&(((GrafPtr) firstWin)->portBits),&rec,&re,srcCopy, 0L);                      

				/* DAS VORIGE */
                  if (aruu!=6*42) {
				    SetRect(&rec,210+aru+5,85+aruu+1,210+aru+43+5,85+aruu+47+1);
				    SetRect(&re,210+aru+5,85+aruu+1,210+aru+43+5,85+aruu+47+1); } else
				    { 
				   if (aru==0) {
				    SetRect(&rec,210+aru+5,85+aruu+1,210+aru+43+5,85+aruu+47+1);
				    SetRect(&re,210+aru+5,85+aruu+1,210+aru+43+5,85+aruu+47+1);
				   };
				   if (aru==1*43)  {
				    SetRect(&rec,210+aru+5,85+aruu+1,210+aru+86+5,85+aruu+47+1);
				    SetRect(&re,210+aru+5,85+aruu+1,210+aru+86+5,85+aruu+47+1);};
				   if (aru==3*43)  { 
				    SetRect(&rec,210+aru+5,85+aruu+1,210+aru+86+5,85+aruu+47+1);
				    SetRect(&re,210+aru+5,85+aruu+1,210+aru+86+5,85+aruu+47+1);};

				 };
				    
					CopyBits(&((GrafPtr)  anima)->portBits,&(((GrafPtr) firstWin)->portBits),&rec,&re,srcCopy, 0L);                      

				    aru=bru;
				    aruu=bruu;
				   }; 
				   
            /* EINGEBUNG DES NAMEN */
		    /* eingabe 
            eingz=0;
            eing[6]="      ";
            eingc=' '; */

				  if (Button()==true)
				  { i=0; ru=0;
				     if ((bru==3*43) && (bruu==6*42)) { i=3; ru=1; };
				    if (i==0) { 
				    do ; while(Button()==true); };
				     i=0; 
				     if (eingz<6)				     if (bruu==1*42) { eingc='A'+bru/43;  ++eingz; i=1; };
				     if (eingz<6)				     if (bruu==2*42) { eingc='F'+bru/43;  ++eingz; i=1; };
				     if (eingz<6)				     if (bruu==3*42) { eingc='K'+bru/43;  ++eingz; i=1; };
				     if (eingz<6)				     if (bruu==4*42) { eingc='P'+bru/43;  ++eingz; i=1; };
				     if (eingz<6)				     if (bruu==5*42) { eingc='U'+bru/43;  ++eingz; i=1; };
				     if (eingz<6)
				     if (bruu==6*42) 
				      if (bru==0)     { eingc='Z';       ++eingz; i=1; };
				     if (bruu==6*42) 
				      if (bru==1*43)  
				      if (eingz>0)    { eingc=' ';        --eingz; 
                                        SetPort((GrafPtr) firstWin);
                                        SetRect(&ref,425-37-32+i*32-eingz*32,90,425-37-32+i*32+32-eingz*32,90+32);
				      					FillCRect(&ref,leers);
				      				    i=2; 
				      				};
				     
				     /* ETWAS HAT SICH VERAENDERT */
				     if ((i==1) || (i==2)) {
				        
                  SetPort((GrafPtr) firstWin);

				/* DAS VORIGE */
                  if (bruu!=6*42) {
				    SetRect(&rec,210+bru+5,85+bruu+1,210+bru+43+5,85+bruu+47+1);
				    SetRect(&re,210+bru+5,85+bruu+1,210+bru+43+5,85+bruu+47+1); } else
				    { 
				   if (bru==0) {
				    SetRect(&rec,210+bru+5,85+bruu+1,210+bru+43+5,85+bruu+47+1);
				    SetRect(&re,210+bru+5,85+aruu+1,210+bru+43+5,85+bruu+47+1);
				   };
				   if (bru==1*43)  {
				    SetRect(&rec,210+bru+5,85+bruu+1,210+bru+86+5,85+bruu+47+1);
				    SetRect(&re,210+bru+5,85+bruu+1,210+bru+86+5,85+bruu+47+1);};
				   if (bru==3*43)  { 
				    SetRect(&rec,210+bru+5,85+bruu+1,210+bru+86+5,85+bruu+47+1);
				    SetRect(&re,210+bru+5,85+bruu+1,210+bru+86+5,85+bruu+47+1);};

				 };
                   
					CopyBits(&((GrafPtr)  anima)->portBits,&(((GrafPtr) firstWin)->portBits),&rec,&re,srcCopy, 0L);                      
				
				aru=1*43;
				aruu=1*42;


						if (i==1) eingn[eingz]=eingc;


				        for (i=0;i<=eingz;++i)
				        { /* DER NAME */                                                    
                          SetRect(&ref,425-37-32+i*32-eingz*32,90,425-37-32+i*32+32-eingz*32,90+32);
                          ic0=GetCIcon(eingn[i]-(int) ('A')+1061);    
                          if (ic0!=0L) {
                          PlotCIcon(&ref,ic0); 
                          DisposeCIcon(ic0); }; };
				    				  
				          if (ru==0) {     SndPlay(sndc0,click,TRUE);            
				   			   do ;  while (SndChannelBusy(sndc0)==TRUE);};


				   
				    };   
				  };
				   
				  } else {
				  };
				  
				  }; 
 
 
   //retif (musicf==1)
    if (quicktimei==1) {
		HY_ServiceTasks();
		ProcessQuickTimeMovie(); };
				 
				 
				 
				 i=0;
				 if (
				  (bru==3*43) && (bruu==6*42) && (Button()==true)) i=1;
				 } while(i==0);
                 ShowCursor(); 
				 SndPlay(sndc0,click,TRUE);            
            
            
            
            /* NACH UNTEN ABGESCHOBEN */
              for (lx=5;lx>=oo;--lx) { sc[lx+1]=sc[lx];
                               
                                        for (ly=9;ly>=0;--ly) nm[lx+1][ly]=nm[lx][ly];            
            					};

            
             sc[oo]=hgc;
       /*      eingz=6;
             eingn[0]='A';
             eingn[1]='B';
             eingn[2]='C';
             eingn[3]='D';
             eingn[4]='E';
             eingn[5]='F';
             eingn[6]='G'; */
              
             for (ly=9;ly>=0;--ly)  nm[oo][ly]=' ';
             for (ly=0;ly<=6;++ly)  nm[oo][ly+(6-eingz)]=eingn[ly];
           
             hf=1;
           };                 
                 
                 
          

/* ----------- */ };


 
        
        
};  


}; // ENDE AUSWAHL

/* ================== SHOW ===================== */

 /* ABFRAGE DER KEYS */
if (musicf==1)
if (quicktimei==1)
{ 	HY_UnregisterAllSoundResources();
	HY_Cleanup();
	EndQuickTimeMovie();
	FlushEvents(everyEvent, 0);	// clear all events
};
// Verdunkeln

beforeTime = TickCount();
 do {  
        WaitNextEvent(everyEvent, &theEvent, kSleep, nil); 
   }
 while (beforeTime+2>TickCount()); 
 

 ShowMenuBar((GrafPtr) firstWn); 

 KillOffScreenPixMap(bsack);
 KillOffScreenPixMap(anima);
 KillOffScreenPixMap(muriel);

}

//--------------------------------------------------------  KillOffScreenPixMap

void KillOffScreenPixMap (CGrafPtr offScreen)
{
	DisposPtr((Ptr)(**(*offScreen).portPixMap).baseAddr);
	DisposHandle((Handle)(**(*offScreen).portPixMap).pmTable);
	CloseCPort(offScreen);
	DisposPtr((Ptr)offScreen);
}



//--------------------------------------------------------  WIE WIRD GESCHOSSEN
int Buttan(void)
{
  if (kontrol==0) { 
                                if  (Button()==FALSE) return(0); else return(1);  
                            };

  if (kontrol==1) { 
                               if (auswt==0) if  (BitTst(&theKeys,85)==FALSE)  return(0); else return(1);  
                               if  ((auswt==1) || (auswt==2)) if  (BitTst(&theKeys,63)==FALSE)  return(0); else return(1);  
                            
                            };

 
}

//--------------------------------------------------------  RandomInt

short RandomInt (short range)
{
	register long	rawResult;
	
	rawResult = Random();
	if (rawResult < 0L)
		rawResult *= -1L;
	rawResult = (rawResult * (long)range) / 32768L;
	
	return ((short)rawResult);
}


void CreateOffscreens (void)
{
    Rect plat;
	short		i;
	
	SetRect(&plat, 0,0, 2560, 400);
	bsack =  0L;
	CreateOffScreenPixMap(&plat, &bsack);
	
	 
	SetRect(&plat, 0,0, 640, 400);
	anima =  0L;
	CreateOffScreenPixMap(&plat, &anima);

	SetRect(&plat, 0,0, 640, 400);
	muriel =  0L;
	CreateOffScreenPixMap(&plat, &muriel);
	
	
   SetRect(&plat, 0,0, 640, 100);
	nima =  0L;
	CreateOffScreenPixMap(&plat, &nima);	
	
}

//--------------------------------------------------------  CreateOffScreenBitMap

void CreateOffScreenBitMap (Rect *theRect, GrafPtr *offScreen)
{
	GrafPtr		theBWPort;
	BitMap		theBitMap;	
	long		theRowBytes;
	
	theBWPort = (GrafPtr)(NewPtr(sizeof(GrafPort)));
	OpenPort(theBWPort);
	theRowBytes = (long)((theRect->right - theRect->left + 15L) / 16L) * 2L;
	theBitMap.rowBytes = (short)theRowBytes;
	theBitMap.baseAddr = NewPtr((long)theBitMap.rowBytes * 
		(theRect->bottom - theRect->top));

	theBitMap.bounds = *theRect;
	MemError();
	
	SetPortBits(&theBitMap);
	ClipRect(theRect);
	RectRgn(theBWPort->visRgn, theRect);
	EraseRect(theRect);
	*offScreen = theBWPort;
}

//--------------------------------------------------------  CreateOffScreenPixMap

void CreateOffScreenPixMap (Rect *theRect, CGrafPtr *offScreen)
{
	CTabHandle	thisColorTable;
	GDHandle	oldDevice;
	CGrafPtr	newCGrafPtr;
	RGBColor	theColor;
	Ptr			theseBits;
	long		sizeOfOff, offRowBytes;
	OSErr		theErr;
	short		thisDepth, i;
	
	oldDevice = GetGDevice();
	SetGDevice(thisGDevice);
	newCGrafPtr = 0L;
	newCGrafPtr = (CGrafPtr)NewPtr(sizeof(CGrafPort));
	if (newCGrafPtr != 0L)
	{
		OpenCPort(newCGrafPtr);
		thisDepth = (**(*newCGrafPtr).portPixMap).pixelSize;
		offRowBytes = ((((long)thisDepth * 
				(long)(theRect->right - theRect->left)) + 15L) >> 4L) << 1L;
		sizeOfOff = (long)(theRect->bottom-theRect->top) * offRowBytes;
		OffsetRect(theRect, -theRect->left,-theRect->top);
		theseBits = NewPtr(sizeOfOff);
		if (theseBits)
		{
			(**(*newCGrafPtr).portPixMap).baseAddr = theseBits;
			(**(*newCGrafPtr).portPixMap).rowBytes = (short)offRowBytes + 0x8000;
			(**(*newCGrafPtr).portPixMap).bounds = *theRect;
			thisColorTable = (**(**thisGDevice).gdPMap).pmTable;
			theErr = HandToHand((Handle *)&thisColorTable);
			for (i = 0; i <= (**thisColorTable).ctSize; ++i)
				(**thisColorTable).ctTable[i].value = i;
			(**thisColorTable).ctFlags &= 0x7FFF;
//			(**thisColorTable).ctSeed = GetCTSeed();
			(**(*newCGrafPtr).portPixMap).pmTable = thisColorTable;
			ClipRect(theRect);
			RectRgn(newCGrafPtr->visRgn, theRect);
			Index2Color(0, &theColor);
			RGBBackColor(&theColor);
			switch (thisDepth)
			{
				case 1:
					Index2Color(1, &theColor);
					break;
				case 4:
					Index2Color(15, &theColor);
					break;
				case 8:
					Index2Color(255, &theColor);
					break;
				default:
					Index2Color(255, &theColor);
					break;
			}
			RGBForeColor(&theColor);
			EraseRect(theRect);
		}
		else
		{
			DisposePtr((Ptr)newCGrafPtr);
			newCGrafPtr = 0L;
			
		}
	}
	
	
	*offScreen = newCGrafPtr;
	SetGDevice(oldDevice);
}
Boolean SndChannelBusy(
	SndChannelPtr sndChannelP)
{
	OSErr err;
	Boolean sndChannelBusy = true;
	SCStatus sndChannelStatus;

	err = SndChannelStatus(sndChannelP, sizeof(SCStatus), &sndChannelStatus);

	if (err == noErr)
	{
		sndChannelBusy = sndChannelStatus.scChannelBusy;
	}

	return sndChannelBusy;
}


OSErr InstallSoundCallBack(
	SndChannelPtr sndChannelP)
{
	SndCommand sndCmd;

	sndCmd.cmd = callBackCmd;
	sndCmd.param1 = kSoundComplete;
	sndCmd.param2 = SetCurrentA5();

	return SndDoCommand(sndChannelP, &sndCmd,FALSE);//kWaitIfFull);
}


Handle GetSoundResource(
	short soundResourceID,
	OSErr* err)
{   Handle soundResourceH;
    soundResourceH = GetResource(soundListRsrc, soundResourceID); 

	if (soundResourceH == NULL)
	{
		*err = ResError();
		
		if (*err == noErr)
		{
			*err = resNotFound;
		}
	}

	return soundResourceH;
}

///--------------------------------------------------------------------------------------
//	GetRandom
//
//	generate a random number between min and max inclusive
///--------------------------------------------------------------------------------------

unsigned short GetRandom(
	unsigned short min,
	unsigned short max)
{
	unsigned short random;
	long range, temp;

	random = Random();
	range = (max - min) + 1;
	temp = (random * range) / 65536;
	random = temp + min;

	return random;
}


void CenterRect(
	Rect* srcRect,
	Rect* dstRect)
{
	short width = (dstRect->right - dstRect->left);
	short height = (dstRect->bottom - dstRect->top);

	dstRect->left = srcRect->left + (((srcRect->right - srcRect->left) / 2) - (width / 2));
	dstRect->top = srcRect->top + (((srcRect->bottom - srcRect->top) / 2) - (height / 2));
	dstRect->right = dstRect->left + width;
	dstRect->bottom = dstRect->top + height;
}


/*
        // globals for the menubar showing/hiding stuff
*/
RgnHandle gOldVisRgn = NULL;


///--------------------------------------------------------------------------------------
//	HideMenuBar
///--------------------------------------------------------------------------------------

void HideMenuBar(
	GrafPtr grafPort)
{
	RgnHandle newVisRgn;
	GrafPtr savePort;

	GetPort(&savePort);
	SetPort(grafPort);

		// save off vis region
	gOldVisRgn = NewRgn();
	CopyRgn(grafPort->visRgn, gOldVisRgn);

		// expand the vis region to the port rect
	newVisRgn = NewRgn();
	RectRgn(newVisRgn, &grafPort->portRect);
	CopyRgn(newVisRgn, grafPort->visRgn);
	DisposeRgn(newVisRgn);

	SetPort(savePort);
}


///--------------------------------------------------------------------------------------
//	ShowMenuBar
///--------------------------------------------------------------------------------------

void ShowMenuBar(
	GrafPtr grafPort)
{
	GrafPtr savePort;
	RgnHandle junkRgn;

	GetPort(&savePort);
	SetPort(grafPort);

		// fill the rounded corners of the screen with black again
	junkRgn = NewRgn();
	CopyRgn(gOldVisRgn, junkRgn);
	DiffRgn(grafPort->visRgn, junkRgn, junkRgn);

	#ifdef dangerousPattern
	FillRgn(junkRgn, &qd.black); // vorher &qd.black */
	#else
	FillRgn(junkRgn, &qd.black); /* gendert &qd. */
	#endif

	DisposeRgn(junkRgn);

		// restore the old vis region
	CopyRgn(gOldVisRgn, grafPort->visRgn);
	DisposeRgn(gOldVisRgn);
	gOldVisRgn = NULL;

	DrawMenuBar();
}

//--------------------------------------------------------  checksum
void checksum(void)
{ int io;
  /*   char coden[11]={"BAUER     "};          
  char codet[11]={"STECKBORN "};          
  char codel[11]={"          "};
  long senum; */

  senum=0;
  for (io=0;io<=10;++io) { senum=senum+((long) (codet[io]))*((coden[io]));      };
  for (io=0;io<=10;++io) { senum=senum+((long) (codet[io])*17171);  };
  for (io=0;io<=10;++io) { senum=senum+((long) (coden[io]%3)*1922);   }; 
  for (io=0;io<=10;++io) { senum=senum+((long) (coden[io]%3)*179*codet[10-io]*1001);   }; 

}

/* SetMouse, sets the mouse position */

static void SetMouse(Point newMousePosition)
{
	CursorDevicePtr	theCursorDevice = nil;
	OSErr			errorCode;

	if (NGetTrapAddress(0xAADB, ToolTrap) !=
		NGetTrapAddress(_Unimplemented, ToolTrap)) /* Is Cursor Device Mgr available? */
	{
/* Find a device with one button. That ought to be the standard mouse! */
	do {
		errorCode = CursorDeviceNextDevice(&theCursorDevice);
		} while ((theCursorDevice != nil) &&
				(*theCursorDevice).cntButtons != 1);
	}

	if (nil != theCursorDevice)
		{
		LocalToGlobal(&newMousePosition);
		errorCode = CursorDeviceMoveTo(theCursorDevice, newMousePosition.h, newMousePosition.v);
		errorCode = CursorDeviceButtons(theCursorDevice, 0);
		}
	else /* If Cursor Device Mgr is not around, do it the old way. */
		{
		LocalToGlobal(&newMousePosition);
		*(Point *)0x82c = newMousePosition;
		*(Point *)0x828 = newMousePosition;
		*(short *)0x8ce = 0xffff;
		}
} /* SetMouse */
 


