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 / how do I make a sprite move left and right with the arrow keys?

Author
Message
Skull breaker
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location:
Posted: 3rd Sep 2008 04:02
I know how to make the top and bottom make the sprite go up and down, but how do I use it to make the left and right go left and right??

This is a signiture
RancidRat
16
Years of Service
User Offline
Joined: 19th Feb 2008
Location:
Posted: 3rd Sep 2008 13:04
I can think of 2 ways, lets say your sprite id is 10 and image is 5:

1. first make the point of rotation in the centre of the sprite:

dbOffsetSprite(10,dbSpriteWidth(10)/2,dbSpriteHeight(10)/2);

Use the dbMoveSprite() function, in your loop you will have to say something like:




2. You could use an int value, this does not rotate the sprite:

int MoveX;

in the loop:

Skull breaker
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location:
Posted: 4th Sep 2008 00:12
thanks for the help!

This is a signiture

Login to post a reply

Server time is: 2024-09-30 05:27:59
Your offset time is: 2024-09-30 05:27:59