
-----------------------------------
MiX-MaztA-M8riX
Fri Nov 26, 2004 12:25 pm

:: Race Game ::
-----------------------------------
I Was trying to go for that old school feel, with the over the top - view.  I dunno how to get the drifting goin on after you let go of the direction you wanna go, its really.. REALLY REALLY basic right now I think  :oops: but hey, its just the main thing, if anyone wants to improve on it go straight ahead, I need the help  :wink: 


setscreen ("graphics:600;400,position:center;center")

var font1 : int
var keys : array char of boolean
var x, y : int
var laps : int := 5
var check : int := 0
var yes : int := 1
font1 := Font.New ("Arial :20")
x := 230
y := 25

%% Graphics

colorback (255)
cls

%Start/Finish Line
Draw.Line (190, 30, 190, 0, 68)

%Checkpoint Line
Draw.Line (190, maxy - 25, 190, maxy - 68, 72)

%Borders
Draw.Line (1, 1, maxx, 1, 79)
Draw.Line (maxx - 1, maxy - 21, maxx - 1, 0, 79)
Draw.Line (1, maxy - 21, 1, 21, 79)
Draw.Line (1, maxy - 25, maxx - 1, maxy - 25, 79)

%Track Outline
Draw.Line (75, 30, 500, 30, 0)
Draw.Line (500, 30, 500, 180, 0)
Draw.Line (500, 180, 350, 180, 0)
Draw.Line (350, 180, 350, 280, 0)
Draw.Line (425, 230, maxx, 230, 0)
Draw.Line (350, 280, 500, 280, 0)
Draw.Line (500, 280, 500, 330, 0)
Draw.Line (500, 330, 75, 330, 0)
Draw.Line (75, 330, 75, 30, 0)
Draw.Fill (100, 80, 8, 0)

%% Procedures

%Draw Piece
procedure Char

    Draw.FillBox (x, y, x + 10, y + 5, 10)

end Char

%Get Keys
procedure Keys

    Input.KeyDown (keys)

    if keys (KEY_RIGHT_ARROW)
            then
        x += 1
        delay (10)

    elsif keys (KEY_LEFT_ARROW)
            then
        x -= 1
        delay (10)

    elsif keys (KEY_UP_ARROW)
            then
        y += 1
        delay (10)

    elsif keys (KEY_DOWN_ARROW)
            then
        y -= 1
        delay (10)

    end if

end Keys

procedure AllElse

    %Collision Detection

    if whatdotcolour (x + 5, y + 5) = 8
            or whatdotcolour (x + 10, y) = 8
            or whatdotcolour (x - 1, y) = 8
            or whatdotcolour (x + 5, y + 5) = 0
            or whatdotcolour (x + 10, y) = 0
            or whatdotcolour (x - 1, y) = 0

            then
        Font.Draw ("YOU CRASHED!", maxx div 5, maxy div 2, font1, 15) %