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 / 2d sprite problem

Author
Message
M shock
16
Years of Service
User Offline
Joined: 18th Jan 2008
Location:
Posted: 19th Jan 2008 06:34
hi , I am a newbie.

how can I move a sprite horizontally without dbRotateSprite?

that command make the character sprite falls down.

and I'm sorry about my poor english.
Deagle
19
Years of Service
User Offline
Joined: 28th Aug 2005
Location: Finland
Posted: 19th Jan 2008 11:27
if (dbLeftKey( )) {
Sprite.X--;
} else if (dbRightKey( )) {
Sprite.X++;
}

Deagle aka D-Eagle
John Goewert
16
Years of Service
User Offline
Joined: 1st Jan 2008
Location: Cornfield, MO
Posted: 19th Jan 2008 18:49 Edited at: 19th Jan 2008 18:50
Yeah, dbSpriteMove() only moves a sprite in the direction the sprite is facing with a velocity.

I move my sprites like this:

dbSprite ( iPlayerSpriteID, dbSpriteX(iPlayerSpriteID)+xOffset,dbSpriteY(iPlayerSpriteID)+yOffset, 2 );


I get it's current position and add an offset to that position.

You can see this in use from the player class of some code I have.

You can grab it using SVN at http://www.goewert.org/repos/loz/
Login and Password are "guest".

Using DGDK since 01/01/2008
Blah - http://www.john.goewert.org
M shock
16
Years of Service
User Offline
Joined: 18th Jan 2008
Location:
Posted: 20th Jan 2008 04:59
thanks!

Login to post a reply

Server time is: 2024-11-19 23:02:46
Your offset time is: 2024-11-19 23:02:46