how do i make it so i see the figure moving when i hold down the d pad in any direction so you dont see it disappear when it moves then just reappear at the place it stops at
To move your character try the following:
1) Change x and y positions when a corresponding button on the D-pad is pressed.
2) Have it draw characters on screen at those x and y positions.
3) Use Vsync by 1 frame.
4) Clear the character on screen.
5)Use a loop to return to the beginning and repeat.
Giving you a sample code, i think, is a bad idea. Since any game/app you're going to make has it's own unique challenges, so instead of copy/paste a code, try to learn how it works so you won't have these problems again in the future.
What @eddie tried to say is that anything you display onscreen is based on coordinates, so to move something on the screen you should modify those coordinates-CONT-
PX=0 'Player coordinates on X axis
PY=0 'Player coordinates on Y axis
IF BUTTON(2) AND #UP THEN DEC PY
IF BUTTON(2) AND #LEFT THEN DEC PX
IF BUTTON(2) AND #RIGHT THEN INC PX
IF BUTTON(2) AND #DOWN THEN INC PY
LOCATE PX,PY
PRINT "P"
To also add onto what Autz had said I would have added this to the end of the code:
VYSNC 1
CLS
What "VSYNC" will miss 1 frame out from your program in this case it's when you have to clear everything off screen to be painted on again. This will mean you won't be able to see the character disappear from the screen.
Attached is my text mode d-pad demo. The chkchr calls are so you can restore what was at the old spot before you move to the new one. Unfortunately what I have doesn't restore colors. Anyway, give it a try. Let me know if you have questions.
Moogle, to make a map I would save the information into arrays. If you don't know what an array is it's similar to a variable but it can have lots of information within it. An array like this: "DIM HOUSES[5,2]". The first number represent how many houses are on the map and the second number is to represent the x and y position of each of them.
To change the information of these arrays I would refer to them like this.
HOUSES[0,0] = 5
HOUSES[0,1] = 10
All this does is set the x and y of the first house to (5,10). Then later I could print a house back on screen by doing this.
FOR I=0 to 4
LOCATE HOUSES[I,0] , HOUSES[I,1]
PRINT "P"
NEXT
What this will do is go through every house and print them at their x and y position.
text mode as in its just there and graphic mode as in it moves with the sprite (im new ok i just got the 1st chapter out for my first game which is a text adventure portion of it)