
-----------------------------------
Dodad bouldershoulder
Mon Jun 05, 2006 1:55 pm

Zombie game
-----------------------------------
This is my basic game for a project. I need to know how to do a time limit  so that way you can die. You also need pictures to make it work. Need help! 



View.Set ("nocursor,noecho,graphics:725;450")
View.Set ("offscreenonly") %%%setting the screen
%%%picture varibles
var picID, picID2, picID3, picID4, picID5 : int
var x, y, b : int := 0
var oldbutton : int
%%%Zombie count varibles
var count : int := 0
var zombie : int := 5
%%%font varibles
var font1 : int
%%%user varibles
var health : int := 5
%%%menu varibles
var choice : string
var choice2 : string

picID := Pic.FileNew ("grave.jpg")
Pic.Draw (picID, 0, 0, picCopy) %%%load in background

picID2 := Pic.FileNew ("zombie2.jpg")
Pic.Draw (picID2, 400, 375, picCopy) %%%load in first zombie

picID3 := Pic.FileNew ("monster1.jpg")
Pic.Draw (picID3, 100, 100, picCopy) %%%load in second zombie

picID4 := Pic.FileNew ("monster2.jpg")
Pic.Draw (picID4, 100, 100, picCopy) %%%load in third zombie

proc aimer %%%procedure that creates the aimer icon
    colour (brightred)
    locate (1, 1)
    put "Zombie hits - ", count, " Zombie health - ", zombie, " Your health - ", health
    drawoval (x, y, 100 - 60, 100 - 60, 12) %%%coordinates that draw ovals
    drawoval (x, y, 100 - 85, 100 - 85, 12)
    Draw.ThickLine (x, y + 40, x, y + 15, 2, 12) %%%coordinates that draw thick line
    Draw.ThickLine (x, y - 40, x, y - 15, 2, 12)
    Draw.ThickLine (x + 40, y, x + 15, y, 2, 12)
    Draw.ThickLine (x - 40, y, x - 15, y, 2, 12)
end aimer %%%end of procedure

proc hit (x, y : int) %%%procedure that hits and counts the zombie hits
    if View.WhatDotColour (x, y) = blue then %%%hit zombie's heart
        count := count + 1 %%%update counter
        zombie := zombie - 2
        font1 := Font.New ("serif:50") %%%Greetings in different font
        Font.Draw ("You hit his chest!", 100, 370, font1, brightblue)
        View.Update
        delay (1000)
    elsif View.WhatDotColour (x, y) = red then %%%hit zombie's head
        count := count + 1 %%%update counter
        zombie := zombie - 3
        font1 := Font.New ("serif:50")   %%%Message
        Font.Draw ("Head shot!", 200, 370, font1, brightred)
        View.Update
        delay (1000)
    elsif View.WhatDotColour (x, y) = yellow then %%%hit zombie's shoulder
        count := count + 1 %%%update counter
        zombie := zombie - 1
        font1 := Font.New ("serif:50")     %%%Message
        Font.Draw ("You hit his shoulder!", 100, 370, font1, yellow)
        View.Update
        delay (1000)
    elsif View.WhatDotColour (x, y) = brightgreen then %%%hit zombie's leg
        count := count + 1 %%%update counter
        zombie := zombie - 1
        font1 := Font.New ("serif:50")   %%%Message
        Font.Draw ("You hit his leg!", 200, 370, font1, brightgreen)
        View.Update
        delay (1000)
    end if
    if zombie 