Not sure, but nothing is for free so I would expect something back to them in return such as Royalty rates, etc...
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: ampos on 2011-May-25
TYPE GameObjectTimer
initialTime = 0
deltaTime = 0
countTime = 0
pausedTime = 0
elapsedTime = 0
paused = FALSE
// Initialize the amount of time you want to pass before the trigger
FUNCTION InitializeTimer: countTo
self.initialTime = GETTIMERALL()
self.countTime = countTo
self.paused = FALSE
ENDFUNCTION
// Call once per update loop
FUNCTION UpdateTimer:
IF self.paused = FALSE
self.deltaTime = GETTIMERALL()-self.initialTime
ENDIF
ENDFUNCTION
// Call after the UpdateTimer. This needs to be called or the timer will never reset
FUNCTION CheckTimer:
IF self.paused = FALSE
IF INTEGER(self.deltaTime/1000) >= self.countTime
self.ResetTimer()
RETURN TRUE
ENDIF
ENDIF
ENDFUNCTION
// If you want to reset the timer but keep the orignal value for your check, use this
FUNCTION ResetTimer:
self.initialTime = GETTIMERALL()
ENDFUNCTION
// If you want to change the value that gets checked on, it also calls ResetTimer()
FUNCTION ChangeTimer: startTime
self.countTime = startTime
self.ResetTimer()
ENDFUNCTION
//Call this function when you pause the game passing in TRUE to pause and FALSE to unpause it
FUNCTION PauseTimer: isPaused
IF isPaused
self.pausedTime = GETTIMERALL()
self.paused = TRUE
ELSE
self.elapsedTime = GETTIMERALL()-self.pausedTime
self.initialTime = self.initialTime+self.elapsedTime
self.paused = FALSE
ENDIF
ENDFUNCTION
ENDTYPE
LOCAL testTime AS GameObjectTimer
LOCAL pauseTheTime = FALSE
LOCAL PkeyPressed = FALSE
LOCAL UkeyPressed = FALSE
testTime.InitializeTimer(10)
WHILE NOT KEY(01)
IF KEY(25) AND PkeyPressed = FALSE
testTime.PauseTimer(TRUE)
PkeyPressed = TRUE
ENDIF
IF NOT KEY(25)
PkeyPressed = FALSE
ENDIF
IF KEY(22) AND UkeyPressed = FALSE
testTime.PauseTimer(FALSE)
UkeyPressed = TRUE
ENDIF
IF NOT KEY(22)
UkeyPressed = FALSE
ENDIF
testTime.UpdateTimer()
PRINT testTime.deltaTime,10,10
PRINT testTime.initialTime,10,20
PRINT testTime.pausedTime,10,30
testTime.CheckTimer()
SHOWSCREEN
WEND
END