Computer Science Canada

Game Timer

Author:  skatelhs [ Thu May 29, 2003 12:59 pm ]
Post subject:  Game Timer

Hey, im in need of some help on my game. Im trying to make it so you can enter the time you want to play, and then you only play for that long, since its like a target-shooting game. Right now you can enter the time- but for some reason the text shows up white and you cant see what your entering. Also, with the timer counting down, theres a delay of (1000) which is putting a delay right in the game, which relaly sucks. If you can help me out that would be great. Theres also a sound in there, but i just made it a comment since you dont have the sound.

[/code]View.Set ("offscreenonly")
var x, y, button, bulletsleft, timeleft : int := 0

bulletsleft := 8

put "How long would you like your game to be, in seconds?"
get timeleft

timeleft := timeleft - 1
delay (1000)
%Bullets Left- Shown at the Top
locate (1, 1)
put "There are ", bulletsleft, " bullets left in the Clip", " ", timeleft, "seconds left"
drawfillbox (x - 15, y - 1, x + 15, y + 1, white)
drawfillbox (x - 1, y - 15, x + 1, y + 15, white)
Mouse.Where (x, y, button)
if button = 1 and bulletsleft > 0 then
bulletsleft := bulletsleft - 1
%Music.PlayFile ("gunshot.wav")
drawfillbox (x - 15, y - 1, x + 15, y + 1, brightblue)
drawfillbox (x - 1, y - 15, x + 1, y + 15, brightblue)
delay (10)

end if
if bulletsleft <= 0 then
bulletsleft := 0

end if

end loop

also, the crosshair used to turn red when you fired, but it stopped working.  If anyone could fix that back for me that would be great too.
(ask me if you want bits, i dont even know what i can use em for)

Author:  JSBN [ Thu May 29, 2003 3:44 pm ]
Post subject: 

arent u the one we helped cheat? for this u get no help from me

Author:  Homer_simpson [ Thu May 29, 2003 4:34 pm ]
Post subject: 

what's with the dorky avatar...?!

Author:  Tony [ Thu May 29, 2003 4:44 pm ]
Post subject: 

you cant see what you're typing because you set your screen mode to "offscreenonly" and you dont call View.Update while typing Confused

for the timer, use clock() function.

if c>= timeToQuit then
end if

Author:  skatelhs [ Fri May 30, 2003 12:23 pm ]
Post subject: 

1st- the avatar is a pretty accurate representation of you as a kid
2nd- Why ask me a question when im askin you for help

Author:  JayLo [ Fri May 30, 2003 2:51 pm ]
Post subject: 

why are you flaming a mod? ph34r him... Twisted Evil

Author:  Homer_simpson [ Fri May 30, 2003 4:16 pm ]
Post subject: 

well this is a baby picture of me and looks nothing like that...
Posted Image, might have been reduced in size. Click Image to view fullscreen.
i think u really shouldn't be afraid to admit that ,u are the dorky picture

Author:  skatelhs [ Fri May 30, 2003 5:01 pm ]
Post subject: 

1st- i was kinda jokin, i know your proabably not lookin like that
2nd- all i got a was a big x anyway for your pic
3rd- its not me, i just looked up nerd in google image search
4th- what the hell does ph34r mean? you want someone to ph34r me?

Author:  Dan [ Fri May 30, 2003 5:52 pm ]
Post subject: 

*dan's hand gets closer and closer to the ban buttion*

Author:  Tony [ Fri May 30, 2003 7:53 pm ]
Post subject: 

one day I'm gonna snap at all of you guys, break into our host's building and pull the powerplug Twisted Evil

since the site was moved from Dan's server, I no longer have the easy access to the power plug... lucky you guys...

If you wanna argue, plz do that in spam area