when you press the down key it misses out highlighting "2" and goes to "3" but from "3" if you press the upkey it highlights "2". can anyone tell me whats going on (or not going on) as i cant see any problems.
Thanks
`setup
sync on : sync rate 30 : set display mode 800,600,16
`end setup
select = 1
`creates an array to store keypresses
dim key(250) : dim oldkey(250)
do
`checks for key press to stop repeated presses
for a = 1 to 250
if key(a) = 1 then oldkey(a) = 1
if keystate(a) = 1 and oldkey(a) = 0 : key(a) = 1 : else : key(a) = 0 : endif
if keystate(a) = 0 then oldkey(a) = 0
next a
`finish check
`calls battle command function
commandbox()=1
`end function call
if commandbox()=1 then select = 1
if select = 1
ink rgb(255,255,255),0
text 10,10,"1"
ink rgb(128,128,0),0
text 10,30,"2"
text 10,50,"3"
else
if select = 0
ink rgb(128,128,0),0
text 10,10,"1"
endif
endif
if select = 2
ink rgb(255,255,255),0
text 10,30,"2"
ink rgb(128,128,0),0
text 10,10, "1"
text 10,50, "3"
else
if select < 0
ink rgb(128,128,0),0
text 10,30,"2"
endif
endif
if select = 3
ink rgb(255,255,255),0
text 10,50,"3"
ink rgb(128,128,0),0
text 10,10,"1"
text 10,30,"2"
else
if select < 0
ink rgb(128,128,0),0
text 10,30,"3"
endif
endif
`downkeys
if key(208)=1 and select = 1 then select = 2
if key(208)=1 and select = 2 then select = 3
`upkeys
if key(200)=1 and select = 2 then select = 1
if key(200)=1 and select = 3 then select = 2
`end select attack etc calls
sync
loop
function commandbox()
draw to front
ink rgb(255,255,255),0
box 0,0,150,150
ink rgb(0,0,128),0
box 2,2,148,148
endfunction
kR