If you don't understand the concept of using variables you really should read some tutorials first before you start making your dream game.
TDKs Tutorials:
http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10
If you notice games like Mario the character doesn't really move but stays in the center of the screen.
` Set sync rate and turn syncing on
sync rate 0
sync on
` Set startind width and height of bitmap
BWidth=3000
BHeight=3000
` Create a huge image as a background
create bitmap 1,BWidth,BHeight
` Make a box
box 0,0,bitmap width(1),bitmap height(1),rgb(0,0,255),rgb(0,255,0),rgb(255,0,0),rgb(255,255,255)
` Grab the image
get image 1,0,0,bitmap width(1),bitmap height(1),1
` Delete the bitmap
delete bitmap 1
` Make a small box to represent the player
box 0,0,50,50,rgb(255,255,255),rgb(255,0,0),rgb(255,255,0),rgb(0,0,0)
` Grab the image
get image 2,0,0,50,50,1
` Make the player sprite
sprite 1,0,0,1
` Offset the sprite (so it's centered)
offset sprite 1,25,25
` Set starting X for background
BackX=0
` Set starting Y for background
BackY=0
do
` Show the background
paste image 1,BackX,BackY
` Show the player (at the center of the screen) (player does not move from center)
sprite 1,screen width()/2,screen height()/2,2
` Show current Background X and Y
text 0,0,"BackX = "+str$(BackX)
text 0,20,"BackY = "+str$(BackY)
` Check for up arrow
if upkey()
` Increase background Y
inc BackY
endif
` Check for down arrow
if downkey()
` Decrease background Y
dec BackY
endif
` Check for left arrow
if leftkey()
` Increase background X
inc BackX
endif
` Check for right arrow
if rightkey()
` Decrease background X
dec BackX
endif
` Update the screen
sync
loop
