What is it you are trying to achieve?
 
I'm trying to program collision detection.
 
 
 
What is the problem you are having?
 
I have no idea where to begin
 
 
 
Describe what you have tried to solve this problem
 
Make the frog coordinates (fx,fy) if they equal car coordinates then exit loop. I've tried but I don't know exactly how to do it.
 
 
 
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
 
 
 
	  | Turing: | 	 		  
%By Matt
import GUI
 View.Set ("graphics:800;480,noecho")
var fx, fy  : int %staring point for frog
var c1x, c1y  : int
var getkey  : array char of boolean %keyboard input
var pic  : int := Pic.FileNew ("pictures/frog.bmp") %Imports Frog
Pic.SetTransparentColor (pic,  grey) %Makes the bmp.s transparent
var bgid  : int %"Pic.Free"
%cars
var pic4  : int := Pic.FileNew ("pictures/carblue.bmp")
%Draws Background
Draw.FillBox (0,  48,  800,  0,  118)
Draw.FillBox (0,  96,  800,  48,  grey)
Draw.FillBox (0,  144,  800,  96,  grey)
Draw.FillBox (0,  192,  800,  144,  grey)
Draw.FillBox (0,  240,  800,  192,  grey)
Draw.FillBox (0,  288,  800,  240,  119)
Draw.FillBox (0,  336,  800,  288,  54)
Draw.FillBox (0,  384,  800,  336,  54)
Draw.FillBox (0,  432,  800,  384,  54)
Draw.FillBox (0,  480,  800,  432,  120)
View.Update
process frog
     var x, y  := 0
    loop
        bgid  := Pic.New (x, y, x +  48, y +  48) %takes picture of background
        Pic.Draw (pic, x, y,  picMerge) %Draws Frog
        delay (10)
        Pic.Draw (bgid, x, y,  picMerge) %Draws background over frog
        Pic.Free (bgid ) %frees the background
        %Movement
        Input.KeyDown (getkey )
        if getkey  (KEY_UP_ARROW) then
            y  := y +  48
            delay (200)
        end if
        if getkey  (KEY_DOWN_ARROW) then
            y  := y -  48
            delay (200)
        end if
        if getkey  (KEY_RIGHT_ARROW) then
            x  := x +  2
        end if
        if getkey  (KEY_LEFT_ARROW) then
            x  := x -  2
        end if
        fx  := x
 
        fy  := y
     end loop
end frog
 %car movemnet
process car1
     var x  := - 100 %road 1 cars
    loop
        %delays cars
        delay (10)
        %Cars Row 1
        Pic.Draw (pic4, x,  48,  picMerge)
        x  := x +  2
        %Sets cars back to left side Row 1
        if x >=  800 then
            x  := - 100
        end if
        c1x  := x
 
        c1y  := 48
    end loop
end car1
 %calls cars out
fork frog
 fork car1
 delay (1200)
fork car1
 delay (1200)
fork car1
 delay (1200)
fork car1
   | 	  
 
 
Please specify what version of Turing you are using
 
Turing 4.1.1 |