Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 need some help with mousewhere
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
darkdude749




PostPosted: Wed Nov 07, 2007 8:37 pm   Post subject: need some help with mousewhere

I'm making a simple program but I'm stuck on it!!! This is what i need:
- When the mouse is not in motion i need a filled oval to start from where the mouse is and keep growing outward
- When the mouse is in motion i want the oval to disappear and start over again from the beginning when the mouse stops moving

This is what I have so far... If someone could just tell me what i'm missing that would be great!!!

code:
View.Set ("offscreenonly")
View.Set ("nocursor")

colourback (255)

buttonchoose ("singlebutton")

var button : int
var x : int
var y : int

loop
    for z : 1 .. maxx
        mousewhere (x, y, button)
        drawfilloval (x, y, z, z, 31)
        View.Update
        delay (20)
        cls
    end for
    cls
end loop


CODE TAGS. HOLY SHIT CODE TAGS. GREEN TEXT? NO, USE CODE TAGS.

I MEAN COME ON.


The answer is probably going to be something that's going to make me go "oh my god i'm such an idiot" SmileSmileSmile
Sponsor
Sponsor
Sponsor
sponsor
Nick




PostPosted: Wed Nov 07, 2007 8:52 pm   Post subject: RE:need some help with mousewhere

have an oldx and oldy varible
code:
if x not = oldx or oldy not = y then
exit
else
drawfilloval (yadda yadda)
endif
oldx:=x
oldy:=y
Zampano




PostPosted: Thu Nov 08, 2007 9:47 am   Post subject: Re: need some help with mousewhere

On a side note is there any way to waive the other results to mousewhere. Suppose I didn't want to have to use more variable than necessary, and thence didn't want anything to do with the mousewhere. What then?
Clayton




PostPosted: Thu Nov 08, 2007 2:07 pm   Post subject: RE:need some help with mousewhere

What exactly are you asking? Slow down for a second and try and explain your problem so we can understand it.
Zampano




PostPosted: Thu Nov 08, 2007 2:25 pm   Post subject: Re: need some help with mousewhere

Sorry.
The question I'm asking concerns the fact that mouse.where returns threee variable: x, y, and buttons. If I don't really need to know if the button clicks are entered, and just x and y, is there a way to waive that feature so that I don't need to occupy an extra integer variable with the butto clicks information? Last time I amateurishly created a new variable just so I wouldn't get the error message.
Clayton




PostPosted: Thu Nov 08, 2007 2:30 pm   Post subject: RE:need some help with mousewhere

Well.... no there isn't. You're going to have to create that extra variable to hold that "useless" value.
darkdude749




PostPosted: Thu Nov 08, 2007 4:07 pm   Post subject: Re: need some help with mousewhere

Thanks momop i got it working now Very Happy
this is what it looks like now:
code:
View.Set ("offscreenonly")
View.Set ("nocursor")

colour (31)
colourback (255)
cls

buttonchoose ("singlebutton")

var button : int
var x : int
var y : int
var oldx : int := 0
var oldy : int := 0

loop
    for z : 1 .. 1000000
        mousewhere (x, y, button)
        if x = oldx and y = oldy then
            put "Move your mouse around the screen."
            drawfilloval (x, y, z, z, 31)
            View.Update
            delay (10)
            cls
        else
            exit
        end if
    end for
    oldx := x
    oldy := y
end loop

Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: