I wonder if anyone could help me.
I'm making a 2d game using a similar controlling style as games such as MYST, where you click the right of the screen to go right, left to left, forwards to go straight on etc, etc.
I've worked out how to do this, thankfully without having to ask too many questions. But now I've hit a stumbling block.
whenever i click on a clickable part, it performs the action twice, so that if i click left (for example), I turn left, then i turn left again so that i'm facing behind me... of course i only want it to move once.
This is because it keeps reading that your finger is on the button. It seems that you really have to tap it quickly if you want to only turn left once, but this is difficult, and not ideal gameplay.
I've tried slowing the SYNC RATE down but this still occurs unless I slow it down to 10 or less but that just makes the cursor really slow.
I also tried putting CLS at the beginning of every new screen so try to block this from happening but a) it still happened and b) it flashed black in between screens.
I'll leave my code here in the hope that someone might be able to help me figure out what to do about this.
This is the code for a short experimental version of the game set in my living room. If anyone can give me hints on how to condense it aswell, i would be grateful.
REM _____________________________________
REM ---LIVING ROOM TECNICAL EXPERIMENT---
REM _________by Stuart Forbes____________
REM -------------July2006----------------
REM _____________________________________
REM Small textual introduction
SYNC rate 10
CLS
SLEEP 1000
PRINT "3"
SLEEP 1000
CLS
SLEEP 400
PRINT "2"
SLEEP 1000
CLS
SLEEP 400
PRINT "1"
SLEEP 3000
CLS
PRINT "Number20Studios Presents..."
SLEEP 3000
PRINT "A DarkBASIC Production..."
SLEEP 3000
PRINT "A Quick Interactive Look at My Living Room"
SLEEP 1000
PRINT "by Stuart Forbes"
SLEEP 3000
PRINT "Press any key to begin... press ESC to EXIT"
WAIT KEY
goto 1n:
REM Screens (node-direction)
REM Node 1
REM 1-north
1n:
LOAD BITMAP "lr-1n.bmp", 0
do
if mouseclick() = 1 and mousex() > 0 and mousex() < 50 and mousey() > 50 and mousey() < 430
goto 1w:
endif
if mouseclick() = 1 and mousex() > 590 and mousex() < 640 and mousey() > 50 and mousey() < 430
goto 1e:
endif
if mouseclick() = 1 and mousex() > 270 and mousex() < 370 and mousey() > 190 and mousey() < 290
goto 2n:
endif
loop
REM 1-east
1e:
LOAD BITMAP "lr-1e.bmp", 0
do
if mouseclick() = 1 and mousex() > 0 and mousex() < 50 and mousey() > 50 and mousey() < 430
goto 1n:
endif
if mouseclick() = 1 and mousex() > 590 and mousex() < 640 and mousey() > 50 and mousey() < 430
goto 1s:
endif
loop
REM 1-south
1s:
LOAD BITMAP "lr-1s.bmp", 0
do
if mouseclick() = 1 and mousex() > 0 and mousex() < 50 and mousey() > 50 and mousey() < 430
goto 1e:
endif
if mouseclick() = 1 and mousex() > 590 and mousex() < 640 and mousey() > 50 and mousey() < 430
goto 1w:
endif
loop
REM 1-west
1w:
LOAD BITMAP "lr-1w.bmp", 0
do
if mouseclick() = 1 and mousex() > 0 and mousex() < 50 and mousey() > 50 and mousey() < 430
goto 1s:
endif
if mouseclick() = 1 and mousex() > 590 and mousex() < 640 and mousey() > 50 and mousey() < 430
goto 1n:
endif
loop
REM 1-west-clock
1wb:
LOAD BITMAP "lr-1wb.bmp", 0
REM Node 2
REM 2-north-closedoor
2n:
LOAD BITMAP "lr-2n.bmp", 0
do
if mouseclick() = 1 and mousex() > 0 and mousex() < 50 and mousey() > 50 and mousey() < 430
goto 2w:
endif
if mouseclick() = 1 and mousex() > 590 and mousex() < 640 and mousey() > 50 and mousey() < 430
goto 2e:
endif
if mouseclick() = 1 and mousex() > 270 and mousex() < 370 and mousey() > 190 and mousey() < 290
goto 2nb:
endif
loop
REM 2-north-opendoor
2nb:
LOAD BITMAP "lr-2nb.bmp", 0
do
if mouseclick() = 1 and mousex() > 270 and mousex() < 370 and mousey() > 190 and mousey() < 290
goto 2n:
endif
if mouseclick() = 1 and mousex() > 0 and mousex() < 50 and mousey() > 50 and mousey() < 430
goto 2w:
endif
if mouseclick() = 1 and mousex() > 590 and mousex() < 640 and mousey() > 50 and mousey() < 430
goto 2e:
endif
loop
REM 2-east
2e:
LOAD BITMAP "lr-2e.bmp", 0
do
if mouseclick() = 1 and mousex() > 0 and mousex() < 50 and mousey() > 50 and mousey() < 430
goto 2n:
endif
if mouseclick() = 1 and mousex() > 590 and mousex() < 640 and mousey() > 50 and mousey() < 430
goto 2s:
endif
loop
REM 2-south
2s:
LOAD BITMAP "lr-2s.bmp", 0
do
if mouseclick() = 1 and mousex() > 0 and mousex() < 50 and mousey() > 50 and mousey() < 430
goto 2e:
endif
if mouseclick() = 1 and mousex() > 590 and mousex() < 640 and mousey() > 50 and mousey() < 430
goto 2w:
endif
if mouseclick() = 1 and mousex() > 270 and mousex() < 370 and mousey() > 190 and mousey() < 290
goto 1s:
endif
loop
REM 2-west
2w:
LOAD BITMAP "lr-2w.bmp", 0
do
if mouseclick() = 1 and mousex() > 0 and mousex() < 50 and mousey() > 50 and mousey() < 430
goto 2s:
endif
if mouseclick() = 1 and mousex() > 590 and mousex() < 640 and mousey() > 50 and mousey() < 430
goto 2n:
endif
loop
REMstart 2-west-mirror
2wb:
LOAD BITMAP "lr-2wb.bmp", 0
remend
END
Thanks guys
-Stu