
-----------------------------------
StrikerZ
Mon Dec 11, 2006 10:03 pm

whatdotcolor help
-----------------------------------
How do i use whatdotcolor to detect color? For example 2 circles make paths both different colors and when one circle hits the other players path, then that person loses. i know whatdotcolor can detect collision between circles but how does it detect the collision between a circle and the other circles path? 

var window : int := Window.Open ("graphics:1000;668")
var chars : array char of boolean
var x1, y1, x2, y2, intX, intY : int
var intColor1, intColor2 : int
x1 := 200
y1 := 668 div 2
x2 := 800
y2 := 668 div 2

locatexy (420, 335)
put "*The colors cannot be the same*"
locatexy (395, 330)
put "Enter the color of Player 1 (1 to 255)"
locatexy (395, 310)
get intColor1
locatexy (395, 290)
put "Enter the color of Player 2 (1 to 255)"
locatexy (395, 270)
get intColor2
if intColor1 = intColor2 then
    quit
end if
cls

var gametime : int := Time.Sec
View.Set ("offscreenonly")

loop
    Input.KeyDown (chars)
    %Player 1
    if chars (KEY_UP_ARROW) then
        y1 := y1 + 1
    end if
    if chars (KEY_DOWN_ARROW) then
        y1 := y1 - 1
    end if
    if chars (KEY_LEFT_ARROW) then
        x1 := x1 - 1
    end if
    if chars (KEY_RIGHT_ARROW) then
        x1 := x1 + 1
    end if
    %Boundary
    if (x1 + 10) >= maxx or (x1 - 10) = maxy or (y1 - 10) = maxx or (x2 - 10) = maxy or (y2 - 10) 