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 / Top Down Sprite Rotation w/ the mouse?

Author
Message
Aturaya
15
Years of Service
User Offline
Joined: 8th Mar 2009
Location:
Posted: 9th Mar 2009 04:59
I'm new to C++, and to make games I thought I'd try out the Dark GDK. Extremely basic functions to me are very easy, however I'm trying to figure out how to use the mouse to rotate a sprite. At the moment, I have the sprite moving with the WSAD keys with friction applied, and rotating with the left and right keys. Only being able to rotate with the arrow keys is aggravating considering that there's no perfect rotate speed you could have it at; it's always too fast or too slow. I want the rotation to be like a top down shooter game.

Please don't recommend the Dark GDK help documentation. I already use that for 3/4ths of the things I do.

Thanks.

If I ask stupid questions, you don't have to point it out.
AlexZinn
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 9th Mar 2009 15:44
i dont know if it will help you... its fiderent from what you want but it may can help understand...




so if you click in one side of the map it moves to that side... something like that

if you want it to click someone and rotate to where you clicked.. you can make something like

when you click check distance... down a 90 grades... and then use sin -1 to that... but i think its complicated

If someone need something, add me to your msn
Was SuperKid , now AlexZinn
Aturaya
15
Years of Service
User Offline
Joined: 8th Mar 2009
Location:
Posted: 11th Mar 2009 00:13
Still confused. If my first post wasn't clear enough, I want the character to stay in one position and rotate according to the mouse, similar to a turret. if the mouse is at 90%, the sprite will rotate 90%, if the mouse is at 180% the sprite rotates to 180% and so on. Just imagine a top down shooter game where you aim with the mouse.

If I ask stupid questions, you don't have to point it out.

Login to post a reply

Server time is: 2024-09-30 19:26:08
Your offset time is: 2024-09-30 19:26:08