If you want the character to stop moving when you hold the mouse button down, I am not entirly sure how to do that
I don't think darkbasic has a command to find out if the mouse has been held down or not, so you will have to code your own. This is obviously not going to be really simple, but I'll try and help. For starters, we will have a function the you call when the mouse is clicked, and we will call this function Check_For_Mouse_Hold()
Here is some code
FUNCTION Check_For_Mouse_Hold()
rem this variable tells the program
rem wether the mouse button is being
rem held down or not. 0 = false, 1 = true
rem we set it to zero when we call the function
rem so that it never changes to 1 and gets stuck
rem that way.
Mouse_Held_Down = 0
rem now lets see if the mouse is down
IF MOUSECLICK() = 1
rem this is a timer variable, it holds the start
rem time of when the mouse was held down
Start_Time = TIMER()
rem enter a SMALL loop, if the mouse is down
rem for about 0.5 seconds, this will override
rem the movement command, and stop movement
WHILE MOUSECLICK() = 1
rem computer time is clocked in milliseconds,
rem so by adding 500 to start time, we
rem basicly say that, after 0.5 seconds, do whatever
IF TIMER() => (Start_Time+500)
rem set the mouse held down variable to 1
Mouse_Held_Down = 1
rem exit our loop
EXIT
ENDIF
REPEAT
ENDIF
rem return the Mouse_Held_Down variable so that the main program
rem knows wether the user held down the mouse button or not
ENDFUNCTION Mouse_Held_Down
Now, the place to put that function call, and a bit more code, is right about here inside the origianl program
rem these are old
Futer_X = MOUSEX()- 25
Futer_Y = MOUSEY()- 25
Movement_Needed = 1
rem THIS IS NEW
IF Check_For_Mouse_Hold() = 1
Futer_X = 0
Futer_Y = 0
Movement_Needed = 0
ENDIF
rem something else to add to the code, this will
rem help to speed it up. just place the new lins were I
rem am about to show you
rem these three are all old lins
IF Amount_Y < 0 THEN Amount_Y = -1
Player_X = Player_X + Amount_X
Player_Y = Player_Y + Amount_Y
rem THIS IS NEW
IF Player_X = Futer_X AND Player_Y = Futer_Y THEN Movement_Needed = 0
This code (mostly my function right now) still needs a lot of work, perhapes a way to check for the mouse hold without entering a loop, as this will cause a "glitch" if the user hold the mouse button down. Maybe someone has an idea? Untill later, Good Luck!
P.S sorry about the typo, since they both needed the same kind of statments I just copy/pasted it, and then forgot to change the variable names
Someday, I'll finish a game. Until then, I'll just start writting them.