
-----------------------------------
Ldomi
Tue Jan 09, 2007 7:20 pm

Delay help
-----------------------------------
I made a racing game where if you or the computer goes in a puddle of mud, your car slows down. My problem is that when the computer's car goes in the mud, it makes the other car slow even though it is not on the mud. How do i make only the car that goes in the mud slow down and not the other car that avoided the mud.

This is the part im having problems with:
loop
            exit when GUI.ProcessEvent
            drawfillbox (startpointx + 1, 70, 0, 300, gray)
            drawfillbox (0, startpointy - 1, 760, 300, gray)
            drawfillbox (0, startpointy + 1, 760, 70, gray)
            drawfilloval (390, 190, 100, 50, 114)
            drawfilloval (390, 405, 100, 50, 114)
            Pic.Draw (pictureP1, startpointx + 1, startpointy + 1, 0)

            drawfillbox (startpointx2 + 1, 400 + 1, 0 + 1, 450 + 1, gray)

            Input.KeyDown (key)

            if key ('M') or key ('m') then
                mainMenu
            end if
            if key (KEY_UP_ARROW) and endpointy = 85 then
                startpointy := startpointy - 10
                endpointy := endpointy - 10

            elsif key (KEY_RIGHT_ARROW) and endpointx  168 and startpointx < 450 and startpointy > 130 and startpointy < 220 then
                    startpointx := startpointx + 10
                    delay (30)
                end if
            else
                if key (KEY_LEFT_ARROW) and startpointx >= 1 then
                    startpointx := startpointx - 10
                    endpointx := endpointx - 10

                end if

            end if

            drawfilloval (390, 405, 100, 50, 114)

            Pic.Draw (pictureComp, startpointx2, startpointy2, 0)

            startpointx2 := startpointx2 + 8
            delay (2)

            if startpointx2 > 168 and startpointx2 < 450 and startpointy2 > 360 and startpointy2 < 450 then
                %or startpointx >168 and startpointx 160 and startpointy 