Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Mouse alignment

Author
Message
Jonathan Fachola
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location:
Posted: 13th Dec 2011 16:17
Hey, I'm new. I hope I'm posting in the right area, anyways I'm having an issue, I have a 2d game in mind for my computer science course, tic-tac-toe using darkgdk but, I want to use the mouse, so you can place the piece. I do have another and simple idea instead of pointing, like using keys with set coordinations, if I cannot figure out or find any fixes. My problem is the mouse and sprite are not aligned, could someone help me, I've tried dividing and subtracting but no luck, this is my example code.
#include "DarkGDK.h"
#include "windows.h"

void DarkGDK(void)
{

dbSyncOn();
dbSyncRate(60);
dbDisableEscapeKey();

while(LoopGDK())
{
dbText ( dbMouseX(), dbMouseX(), "Hey" );
else if(dbEscapeKey() == 1)
{
break; //Breaks out of program
}
dbSync();
}

for (int pKilled = 0; pKilled < 2; pKilled++)
{
dbDeleteImage(pKilled);
dbDeleteSprite(pKilled);
}
return;
}
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 13th Dec 2011 17:29
For starters, use dbMouseX and dbMouseY. You're using dbMouseX for both checks. Beyond that, I'm not understanding your issue.

JTK

Login to post a reply

Server time is: 2024-11-19 06:41:12
Your offset time is: 2024-11-19 06:41:12