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

Username:   Password: 
 RegisterRegister   
 need help in making a diagonal line move back and forth.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
khanguy_99




PostPosted: Fri Feb 20, 2004 5:43 pm   Post subject: need help in making a diagonal line move back and forth.

hi guys, i am writing a turing program to represent winshield wipers of a car.
I have made the arms and the wiper blades of the car but how do i make both the arms(along with the wiper blades) rotate back and forth???
Please help.....
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Fri Feb 20, 2004 6:53 pm   Post subject: (No subject)

yeah I know its prolly not that efficiant Confused

code:

setscreen ("offscreenonly")
var a : real := 0
var x, y : real
var back : boolean := false
var forth : boolean := true
loop
    if a < 0 then
        forth := true
        back := false
    end if
    if a > 180 then
        a -= 1
        back := true
        forth := false
    end if
    if forth = true then
        a += 1
    end if
    if back = true then
        a -= 1
    end if
    x := 320 + (100 * cosd (a))
    y := 240 + (100 * sind (a))
    drawline (320, 240, round (x), round (y), black)
    View.Update
    drawline (320, 240, round (x), round (y), white)
end loop


credit to shorthair for the forumulas Razz
Andy




PostPosted: Fri Feb 20, 2004 6:56 pm   Post subject: (No subject)

use a process or just have them move in the same loop
recneps




PostPosted: Fri Feb 20, 2004 8:38 pm   Post subject: (No subject)

you could use pic.rotate, make the wipers pics and rotate them over the base of the wiper (part that does not move)
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  [ 4 Posts ]
Jump to:   


Style:  
Search: