Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Zombie game
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Dodad bouldershoulder




PostPosted: Mon Jun 05, 2006 1:55 pm   Post subject: 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 <= 0 then
font1 := Font.New ("serif:50") %%%Message
Font.Draw ("You killed a zombie!", 200, 370, font1, brightgreen)
delay (2000)
zombie := 5
end if
end hit %%%end of hit procedure

proc instr %%%procedure that gives instructions to user
drawfillbox (0, 0, maxx, maxy, black)
locate (1, 1)
put "O.K., you're going on a secret mission. Zombie's are coming, and they threaten the world!"
put "We need to send the zombie's back to their grave's, and you're the one to do it!"
put "You are equipped with a shotgun, and googles that can see the sensitive area's of the zombie's"
put "Their is four area's you must concentrate on.They are the head, the chest, shoulder's and legs"
put "The head is worth the most at three points, the chest is next at two and the limbs are worth one."
put "You must reach 5 points to kill one zombie. However there is plenty more after you kill the first"
put "You also have five health. If you don't kill the zombie's you see in 40 seconds, you will lose a health point, and the timer will reset."
put "If you lose all you're lifes, you have let down the world, and become a zombie yourself."
put "You will also keep track of how many zombie parts you have hit."
put "Good, now that you have been briefed, you're ready. Good luck!"
put "Press 'e' to go to the game"
put "Press 'q' to quit"
View.Update
get choice2
if choice2 = "q" then
quit
else
end if
end instr %%%end of procedure

proc menu %%%main menu procedure
drawfillbox (0, 0, maxx, maxy, black)
colourback (black)
colour (brightred)
Pic.Draw (picID3, 310, -335, picMerge) %%%giving cooridinates to picture
Pic.Draw (picID4, -150, -335, picMerge) %%%giving cooridinates to picture
font1 := Font.New ("serif:50") %%%Greetings in different font
Font.Draw ("Zombie Game!", 175, 370, font1, yellow)
font1 := Font.New ("serif:50")
Font.Draw ("By James", 250, 300, font1, brightblue)
locate (12, 1)
put "Welcome to James' Zombie game!Please select an option - "
locate (13, 1)
put "Press 'E' to enter straight to the game" %%%menu instructions
locate (15, 1)
put "Press 'Q' to quit"
locate (14, 1)
put "Press 'I' to get to instuctions on the game"
View.Update
get choice
if choice = "i" then
instr
elsif choice = "q" then
quit
else
end if
end menu %%%end of menu procedure

menu

loop %%%main loop
loop %%%small loop
cls
Pic.Draw (picID, 0, -50, picCopy) %%%coordinates that create background
Pic.Draw (picID2, 290, 75, picMerge) %%%coordinates that create and merge zombies
Pic.Draw (picID2, 100, 5, picMerge)
Pic.Draw (picID2, 560, 100, picMerge)
aimer %%%calls apon aimer procedure
View.Update
mousewhere (x, y, b)
exit when b = 1
end loop %%%end of small loop
hit (x, y) %%%calls apon hit procedure
View.Update
end loop %%%end of main loop
Sponsor
Sponsor
Sponsor
sponsor
upthescale




PostPosted: Mon Jun 05, 2006 1:58 pm   Post subject: (No subject)

Numbner 1- if your gunna post ur code, place it between

[ code ] and[/code]

Numbner 2-You have pictures, so we get an error because we dont have the pictures, put it in a folder
Dodad bouldershoulder




PostPosted: Mon Jun 05, 2006 2:14 pm   Post subject: (No subject)

how do you attach pic's in a folder? And what does a lamer mean on your rank, does that mean you are best?
Delos




PostPosted: Mon Jun 05, 2006 2:42 pm   Post subject: (No subject)

To wit:
- This post is asking for help, therefore it should be posted in [Turing Help].
- Since you've already posted another topic there, this will be locked.
- As mentioned, please use [code] tags in the future, and note that a more descriptive problem description is requested. Read the Turing FAQ for a quick synopsis.
- As for upthescale's rank...well...yeah, something like that.
This thread is locked
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: