Hello everyone, it has been awhile since I last used darkGDK and i have been trying to make a Point and click type thing, like i click in the screen and a shape moves there then stops when it is there, i am familiar with visual basic and got this working very easily but when i try to incorporate it in darkGDK it doesn't want to work
It complies fine and everything it Just doesn't do what I want it to do. Can Someone Please tell me what I have done wrong, I am a newbie so sorry if my code is bad.
#include "DarkGDK.h"
int playerimg = 1;
int playerspr = 2;
int PosX;
int PosY;
int playerX;
int playerY;
void movement() {
playerX = dbSpriteX(playerspr);
playerY = dbSpriteY(playerspr);
if (dbMouseClick() == 1)
{
PosX = dbMouseX();
PosY = dbMouseY();
}
if (playerX > PosX)
{
playerX = playerX + 10;
}
}
void player()
{
dbSetImageColorKey(255,0,255);
dbLoadImage("Images//player.bmp",playerimg);
dbSprite(playerspr,320,240,playerimg);
dbOffsetSprite(playerspr,dbSpriteWidth(playerspr) /2 ,dbSpriteHeight(playerspr) / 2);
}
void DarkGDK ( void )
{
player();
movement();
dbSyncOn ( );
dbSyncRate ( 60 );
while ( LoopGDK ( ) )
{
dbSync ( );
}
return;
}