Hey, it's me... again
I have a slider like thing (image attached), when you click the left arrow button, a circle slides left 50 pixels click the right arrow button, the same circle slides right 50 pixels. Well, here's the problem. If the person holds down the left mouse button, it slides really fast. What I want to have happen is:
If the user clicks the right button, the circle slides right 50 pixels, but then the user has to click AGAIN before it slides another fifty pixels. The same goes for when the left arrow button is clicked.
I used the same idea for playing a click sound when the user clicks the left mouse button. If this happenedm, a sound would play. But if the user held the mouse down, the sound would repeat really fast, and that sounded terrible. Well, in the end, I got the mouse sound thing working, but for some reason I can't get the slider issue solved. Here's the code I'm useing:
Dim cursorsliderx(1)
cursorsliderx(1) = 397
Sprite 24,cursorsliderx(1),324,11
MX = MouseX()
MY = MouseY()
mousedown =0
If MX >374 And MX <392 And MY >324 And MY <341
Show Sprite 18
If Mouseclick() =1
If mousedown =0
cursorsliderx(1) = cursorsliderx(1) -50
mousedown =1
Endif
Endif
Endif
If MX >618 And MX <636 And MY >324 And MY <341
Show Sprite 23
If Mouseclick() =1
If mousedown =0
cursorsliderx(1) = cursorsliderx(1) +50
mousedown =1
Endif
Endif
Endif
If cursorsliderx(1) <397 Then cursorsliderx(1) =397
If cursorsliderx(1) >597 Then cursorsliderx(1) =597
If Mouseclick() <>1 Then mousedown =0
Sinc this code was based on the mouse clicking code, I'll post it here. Again, this code DOES work. So if you think you have found a bug with the code above, check this one to see if the same bug should have applied to it. If so, then it most likly isn't a bug
Rem This function will play the clicking sound when you click
Function CursorClickSound()
If Sound Exist(2) =0 Then Load Sound "click.wav",2
Rem Test to see if the mouse was clicked. If so then play the
Rem clicking sound
If Mouseclick() =1
If clicksound =0
Play Sound 2
clicksound =1
Endif
Endif
If Mouseclick() <>1 Then clicksound =0
EndFunction
Hope someone gets this figured out!
Thanks for the help,
-Sunflash T. Mace
When FPSC develops enough, lets make a Redwall game!
