Alright, this is the oddest thing, and I can't understand why this happens.
This code works:
#include "DarkGDK.h"
void LoadMedia ( );
void DarkGDK ( void )
{
dbSyncOn ( );
LoadMedia ( );
int P1Y = 30;
int Player2Y;
int BallPos[2];
int BallVel[2];
int lastTime = dbTimer ();
const int p1UP = 30;
const int p1DWN = 44;
const int p2UP = 200;
const int p2DWN = 208;
while ( LoopGDK ( ) )
{
if (dbUpKey ())
//{
//P1Y =29;
//}
dbPasteSprite (1,10,P1Y);
lastTime = dbTimer ();
dbSync ( );
dbCLS ( );
}
}
void LoadMedia ( )
{
dbSetCurrentBitmap (1);
dbInk (dbRGB (255,0,255),dbRGB (0,0,0));
dbBox (0,0,25,100);
dbGetImage (1,0,0,25,100);
dbCLS ();
dbInk (dbRGB (0,255,0),dbRGB (0,0,0));
dbBox (0,0,25,100);
dbGetImage (2,0,0,25,100);
dbCLS ();
dbInk (dbRGB (255,255,0),dbRGB (0,0,0));
dbCircle (0,0,7);
dbGetImage (3,0,0,14,14);
dbCLS ();
dbSetCurrentBitmap (0);
dbSprite (1,0,0,1);
dbSprite (2,0,0,2);
dbSprite (3,0,0,3);
dbHideSprite (1);
dbHideSprite (2);
dbHideSprite (3);
}
But if you uncomment lines [20-23] the program causes a memory access violation. Everything is in scope, all types match. WTF!?
Much regards,
The Scorpion
--Site Temporarily Out of Service--