Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Scoring/Time code?

Author
Message
9911MU51C
10
Years of Service
User Offline
Joined: 4th Feb 2014
Location:
Posted: 28th Feb 2014 18:36
Hello, I'm making a game for school and it has a timer and score system, right now I have it so it displays both right and the countdown works right, but when I touch the objects it doesn't add time or score. I'll post the parts of the code through out my game

CTtimer = timer()
CTVal = 10

SCORE# = 0
~~~~~~~~~~~~~~~~~~~~~~~~~~
(In do loop)

if Timer() - CTtimer => 1000
Dec CTVal
CTtimer = Timer()
EndIf

center text screen width()/2, screen height()/2, Str$(CTVal)

IF CTVal = 0 THEN GOTO ENDSCREEN

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

IF OBJECT COLLISION (1,50)>0 THEN CTVal = CTVal+2

IF OBJECT COLLISION(1,50)>0 THEN SCORE# = SCORE#+200
CENTER TEXT 320,200, Str$(SCORE#)
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 1st Mar 2014 15:26
Well since we can't see the collision part of the code I can only makes guesses...

First and foremost, have you tested to see that a collision is actually occurring?

666GO†O666

Login to post a reply

Server time is: 2024-04-25 08:11:12
Your offset time is: 2024-04-25 08:11:12