So I am trying to make a scrolling window, like if the player goes to far to the right the screen will scroll to the right like a top down RPG, but I keep getting this error.
error C2059: syntax error : 'if'
Here is all the code above it, and only seems to occur that one time.
#include "DarkGDK.h"
#include "Player.h"
#include "Setup.h"
int PlayerSprite = 1;
int DistFromScrn = 64;
int CheckToScroll (int PlayerSprite,int DistFromScrn)
{
int xpos = dbSpriteX (PlayerSprite);
int ypos = dbSpriteY (PlayerSprite);
int scrnw = dbScreenWidth ();
int scrnh = dbScreenHeight ();
int scroll = 0;
if (xpos <= scrnw - DistFromScrn)
{
return 1;
}
if (ypos >= scrnh - DistFromScrn)
{
return 2;
}
if (xpos <= DistFromScrn)
{
return 3;
}
if (ypos <= DistFromScrn)
{
return 4;
}
return 0;
}
int MoveScreenResult = CheckToScroll (1,100);
if (MoveScreenResult = 1)
// Error message from the code above this
Anyone know the problem????