:DelVar H
:
:Repeat H=45
:
:Text(G6+1,(F-1)4+2,"θ"
:
:Repeat Ans
:getKey→H
:End
:
:If H=24 and F>1 or H=26 and F<23
:Then
:H-25+F
:If L1(G23+Ans)<4 //checks if the map piece isnt "solid"
:Ans→K
:End
:
:If H=25
:Then
:If L1((G-1)23+F)<4
:G-(G>1)→L
:End
:
:If H=34
:Then
:If L1((G+1)23+F)<4
:G+(G<8)→L
:End
:
:L1(G23+F)
:If Ans
:Then
:sub(",F()Y-^.{}[]I/O:",Ans,1 //replaces the character over the map piece,
:Else
:" " //or overwrites it with spaces
:End
:Text(G6+1,(F-1)4+2,Ans
:
:K→F
:L→G
:
:If H=31
:prgmMENU
:
:If H=21
:Then
:L1(23G+F)→J //map piece
:If J=2
:Then
:prgmθLOADSCR //just clears and creates borders on screen
:prgmMAPCHOOS //load an adjacent map
:End
:If J=3
:prgmFISHING //leveling fishing skill, anyone?
:End
:
:End
The code is for movement in a 23x9 character map on the graphscreen, char is theta, F and G for X and Y.
L1 is the map data, 207 numbers for the map space entry and 23 zeros so as not to cause a DIM error.
When opened from the game's main menu, the first arrow key pressed sends the character to an odd part of the screen, not close to an adjacent position, after this first glitchy move the program moves the character fine.
Coming from the main menu program:
F=12
G=5
H=getKey, of course
"I want you" to find the problem, seriously ive scoured it completely and cant find why it does this.