
-----------------------------------
StrikerZ
Mon Dec 11, 2006 12:42 pm

Collision Help Please
-----------------------------------
i am making a game where two circles draw paths and when one of them collide into the other players path, that player loses, but i am having trouble making the collision detection so that it tells you what player won if you hit the other players path. im also having trouble with the boundaries...every time the circles hit the boundaries they get stuck...could someone help please...heres my code
var window : int := Window.Open ("graphics:1000;668")
View.Set ("offscreenonly")
var chars : array char of boolean
var x1, y1 : int
var x2, y2 : int
x1 := 800
y1 := 668 div 2
x2 := 200
y2 := 668 div 2

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
    if (x1 + 10) >= maxx or (x1 - 10) = maxy or (y1 - 10) = maxx or (x2 - 10) = maxy or (y2 - 10) = maxx or (x1 - 10) = maxy or (y1 - 10) 