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

Username:   Password: 
 RegisterRegister   
 Game Timer
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
skatelhs




PostPosted: 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
cls

loop
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"
%Crosshair
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")
else
%notshooting
drawfillbox (x - 15, y - 1, x + 15, y + 1, brightblue)
drawfillbox (x - 1, y - 15, x + 1, y + 15, brightblue)
View.Update
delay (10)

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

end if



end loop
code:

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)
Sponsor
Sponsor
Sponsor
sponsor
JSBN




PostPosted: Thu May 29, 2003 3:44 pm   Post subject: (No subject)

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




PostPosted: Thu May 29, 2003 4:34 pm   Post subject: (No subject)

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




PostPosted: Thu May 29, 2003 4:44 pm   Post subject: (No 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.
code:

clock(c)
if c>= timeToQuit then
quit
end if
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
skatelhs




PostPosted: Fri May 30, 2003 12:23 pm   Post subject: (No 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
JayLo




PostPosted: Fri May 30, 2003 2:51 pm   Post subject: (No subject)

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




PostPosted: Fri May 30, 2003 4:16 pm   Post subject: (No 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
skatelhs




PostPosted: Fri May 30, 2003 5:01 pm   Post subject: (No 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?
Dan




PostPosted: Fri May 30, 2003 5:52 pm   Post subject: (No subject)

*dan's hand gets closer and closer to the ban buttion*
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Tony




PostPosted: Fri May 30, 2003 7:53 pm   Post subject: (No 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: