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 / dbRotateSprite problem

Author
Message
Devman115
16
Years of Service
User Offline
Joined: 20th Jan 2008
Location:
Posted: 20th Jan 2008 23:43
I'm currently playing with the GDK right now, and came across a bit of a problem. When I tried to rotate the sprite (top down), it made the change once, then hitting the key would have no effect after that.



The up and down works fine, but the rotate does not. One more thing. If I wanted the sprite to "strafe", how would I achieve this? This piece of code is under the main loop.
John Goewert
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Cornfield, MO
Posted: 21st Jan 2008 02:45
Per the documentation:

void dbMoveSprite ( int iNUmber, float fVelocity )
void dbRotateSprite ( int iSprite, float fAngle )

Velocity is the key here. That would be "Current Position + Your Value" for dbMoveSprite.

dbRotateSprite is hard set. "Put this prite at fAngle".

What you would need to do is use dbSpriteAngle and add the offset:




Using DGDK since 01/01/2008
Blah - http://www.john.goewert.org
Devman115
16
Years of Service
User Offline
Joined: 20th Jan 2008
Location:
Posted: 21st Jan 2008 16:39
Ok, thanks. But now I've reached a new problem. How do I create a moving backround (as in scrolling)?

I know it has something to do with dbFlipSprite, but I'm not sure what?
Devman115
16
Years of Service
User Offline
Joined: 20th Jan 2008
Location:
Posted: 22nd Jan 2008 02:40
*bumpity bump bump*

Login to post a reply

Server time is: 2024-09-29 09:15:31
Your offset time is: 2024-09-29 09:15:31