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

Username:   Password: 
 RegisterRegister   
 help with mouse effects
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Zasalamel




PostPosted: Fri Dec 18, 2009 4:37 pm   Post subject: help with mouse effects

What is it you are trying to achieve?

A better way to scroll the program down

What is the problem you are having?

scrolls to fast to get the require effect

Describe what you have tried to solve this problem

i have tried different ways;
put statements (put"",put skip,put" ")
locate(r,c)

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)


Turing:


var x, y, z, a, b : int := 100
loop
    Mouse.Where (x, y, z)
    put ""
    Draw.Line (x, y, a, b, black)
    View.Update
    a := x
    b := y
end loop



Please specify what version of Turing you are using
V 4.0.5 and V 4.1.1

This took me about 5 minutes and i plan to expand it into a full mouse effects program
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Fri Dec 18, 2009 5:13 pm   Post subject: RE:help with mouse effects

you can trying using a delay
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Zasalamel




PostPosted: Fri Dec 18, 2009 5:25 pm   Post subject: RE:help with mouse effects

Where exactly? ive tried it and it doesn't seem to work
TheGuardian001




PostPosted: Fri Dec 18, 2009 6:02 pm   Post subject: Re: help with mouse effects

Putting it anywhere inside the loop seems to work fine for me...
Zren




PostPosted: Fri Dec 18, 2009 6:47 pm   Post subject: RE:help with mouse effects

delay(1) means your stopping for 1 millisecond.
delay(1000) means you stopping for 1 second.
Try delay(50)

Unless your talking about the distance between the lines?
Zasalamel




PostPosted: Sat Dec 19, 2009 2:55 pm   Post subject: RE:help with mouse effects

yes i am talking about the distance between the dots.
Zren




PostPosted: Sat Dec 19, 2009 6:58 pm   Post subject: RE:help with mouse effects

Well if you had any control over the font size of the console (height of the put statements) then this would be easily possible. However, you can't. Can you think of a way to achieve the same results without using put statements to scroll the screen?
Zasalamel




PostPosted: Sat Dec 19, 2009 7:16 pm   Post subject: RE:help with mouse effects

That's what im here for help with.
Sponsor
Sponsor
Sponsor
sponsor
i'm not sure




PostPosted: Tue Dec 22, 2009 10:31 pm   Post subject: Re: help with mouse effects

I'm pretty sure you have to go in a different direction. Instead of using puts and lines try drawing dots, saving thier x positions in an array and then drawing them at a y position higher than before until you reach maxy it has the same affect but with adjustable distance between dots and none of those slashes across the screen.
Here's my code using that and it works pretty well. Oh and sorry the x isn't in a flexible array i've been looking into the tutorials and haven't got through them enough to understand yet.

setscreen ("offscreenonly")
loop
Mouse.Where (x, y, z)
for i : y .. maxy by 4 %<--------- change the 4 to change the distance between the dots.
drawdot (p (b) , i, black)
b += 1
end for
for decreasing i : 1000-1..1
p (i+1) := p (i)
end for
p (1):= x
b:= 1
View.Update
cls
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  [ 9 Posts ]
Jump to:   


Style:  
Search: