FANDOM


Dbmovesprite

This command moves a sprite a specified distance in the direction it is currently facing.

SyntaxEdit

dbMoveSprite( SpriteNumber, Velocity );

UsageEdit

dbMoveSprite can be used to move a sprite along the direction it is facing. SpriteNumber is the ID number of the sprite you wish to move, and Velocity is the distance to move it. When a sprite is created, its default direction is north (towards the top of the screen). By using dbRotateSprite, the direction the sprite is facing may be changed. The next time dbMoveSprite is called, the sprite will move in its new direction.


For example:


dbMoveSprite( 1, 100 );


moves sprite number 1 forward in its current direction by 100 pixels, while


dbMoveSprite( 1, -100 );


moves it backwards.


Note that by using this command and dbRotateSprite together, you can easily create the movement for a 2D top down character.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.