Vesper103,
something you need to understand about variables and operators.
When you are using the equals operator:
the variable on the
left will be
given the value of the variable on the
right.
If you want to put the value of A into B, you say B=A. This is read "b equals a", and you can think of that as commanding B to match the value of A.
Not to mention the function dbSpritePosition(1) does not
take a value, it
gives one. In order to make the sprite
take the value of "px", you must use the dbPositionSprite command, and put "px" as the X parameter. Pseudo-code:
px=dbSpriteX(1); //this command gives the value returned by dbSpriteX to your px variable
//px now holds the current position
if(dbRightKey())
{
px++; //increase px
}
if(dbLeftKey())
{
px--; //decrease px
}
dbPositionSprite( 1, px,0, img ); //1 is the sprite number
//px is put in as the x coordinate
//0 is put in as the y coordinate
//img is the image number for the sprite
That last line takes four values. The first one is the ID number of the sprite we want to move. The next two are X and Y respectively—I put in "px" as the x coordinate, so that it will be where you want it on the left-to-right axis. I just put in 0 as the Y coordinate, meaning the sprite will be on the top edge of the screen, because I was lazy. img is a variable holding the ID number of the image you want your sprite to be.