
-----------------------------------
RedRogueXIII
Sat Nov 05, 2005 11:11 pm

Game - Pooyan from class project
-----------------------------------

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
View.Set ("graphics:800,600")

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Music Files/ Not Implemented Yet
process hit
    Music.Play ("c")
end hit

process background
    loop
        Music.PlayFile ("disclaimer.mid")
    end loop

end background

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%The Title Procedure - Draws the title screen and waits for the user to click before proceeding
proc title (font, picid : int)

    var mx, my, mb : int
    drawfillbox (0, 0, maxx, maxy, black)
    %Puts In a Picture
    %Pic.Draw (picid, (maxx div 2) - 200, maxy - 200, picMerge)
    %%%%%%%%%%%%%%%%%%
    Draw.Text ("PooYan", (maxx div 2) - 150, maxy div 2, font, red)
    delay (1000)
    loop
        mousewhere (mx, my, mb)
        if mb = 1 then
            drawfillbox (0, 0, maxx, maxy, white)
            exit
        end if
    end loop
end title

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Choose Difficulties - Affects Arrow Speed, Wolf Fall Speed - Needs to affect amount of wolves on screen at a time.
proc difficulty (var input : int)
    locate (10, maxrow div 2)
    put "Choose Your Difficulty."
    put "1- Easy Mode"
    put "2- Normal Mode"
    put "3- Hard Mode"
    put "4- Hyper Mode"
    loop
        locate (15, maxrow div 2)
        get input
        if input  -100 then
        wy -= inputvar %drops wolf

        drawfilloval (wx, wy + inputvar, wolfsize + 1, wolfsize + 1, white)
        drawfilloval (wx, wy, wolfsize, wolfsize, green)

        delay (5)
    elsif wolffallflag = true then
        wolffallflag := false
    end if
end dropwolf

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Wolves set uo for round 2 , speed is adjusted to difficulties, wolves fire more than one shot in round two,(Need to fix: Get wolves to set up without delaying program.)
proc wolfup (var wx, wy, mis : int, var wolfupflag, oneshotperwolf : boolean, var deadWolf : int, var currentWolfCount : int, wolfsize, my, input : int, var bulletshotflag : boolean, wolfbulletx,
        wolfbullety : int)
    %changes according to dificulty
    var topwolf : boolean := false
    var inputvar : int := 10
    if input = 1 then
        inputvar := 1
    elsif input = 2 then
        inputvar := 2
    elsif input = 3 then
        inputvar := 3
    elsif input = 4 then
        inputvar := 5
    end if

    var rwx : int

    if currentWolfCount not= deadWolf then
        wolfupflag := false
        currentWolfCount := deadWolf
    end if %check to see if one died


    if wolfupflag = false then %resets wolf
        drawfilloval (wolfbulletx, wolfbullety, 5 + 1, 5 + 1, white) % THis will destroy wolf's attack if wolf is destroyed
        drawfilloval (wx, wy + inputvar, wolfsize + 1, wolfsize + 1, white)

        randint (wx, 40, maxx - 200)
        wolfupflag := true
        bulletshotflag := false
        oneshotperwolf := true
        wy := 30
        %sets wolf up to be dropped
        rwx := wx

        for rx : 0 .. rwx
            drawfilloval (rx, 30, wolfsize + inputvar, wolfsize + inputvar, white)
            drawfilloval (rx, wy, wolfsize, wolfsize, red)
            delay (2)

        end for
    end if





    if wolfupflag = true and wy  maxy - 120 then
            drawfilloval (wx, wy, wolfsize + 1, wolfsize + 1, white)
            locate (4, 1)
            put "Over the top."
        end if


        if oneshotperwolf = false then
            oneshotperwolf := true
        end if


    elsif wolfupflag = true then
        wolfupflag := false


    end if
end wolfup

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Handles when a wolf reaches the top - right now a wolf at the top takes away 1 life
proc wolftop (wx, wolfsize : int, var wy : int, deadWolf : int, var lifecount : int, var oneshotperwolf, wolfupflag : boolean)

    if wy > (maxy - 120) then
        oneshotperwolf := true
        drawfilloval (wx, wy + 10, wolfsize, wolfsize, white)
        lifecount := lifecount - 1
        wolfupflag := false
        wy := 0

    end if
end wolftop



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Wolf Attack Code - Under Construction - Should shoot according to where my is, gets more accurate/faster the higher the difficulties
%(Try making the projectile attackable for points.) TRYING TO MAKE PARABOLAS>>!!!! NOT WORKING - TO COMPLEX
proc wolfattack (wx, wy, my, mis : int, var lifecount : int, wolfFallFlag : boolean, var oneshotperwolf : boolean)
    var px, py : int
    if wolfFallFlag = true and oneshotperwolf = false and wy = maxx then
        drawfilloval (wolfbulletx, wolfbullety, 5 + 1, 5 + 1, white)
        bulletshotflag := false
        oneshotperwolf := false
    end if

    if wy = maxx then
        oneshotperwolf := true
    end if

end wolfshoot
%< = less than, > = greater than

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Wolf Projectile Collision Code - if shot connects to player then player loses one life
proc projcoll (my : int, var wolfbulletx, wolfbullety : int, var lifecount : int, var bulletshotflag, oneshotperwolf : boolean)

    if wolfbulletx >= maxx - 120 and wolfbulletx = wx - 40 and arrowy + 5 