31 October 2015, 21:57 | #1 |
Registered User
Join Date: Mar 2015
Location: Sheffield UK
Posts: 360
|
=Timer= woes.
I'm currently getting back into Amos, but just encountered a minor setback...
I need a constant timer which is reset for each subgame completion, after which I need to reset the (AMOS)Timer. Which is fine, however it also affects the RND seed, causing predictable sequences. Short of writing my own ticker/timer follower for my usage (which will obviously slow things down) has anyone any ideas how to avoid this issue? Pseudo code example 1 set Timer=0 2 Print timer 3 do something random <----- no longer very random 4 loads of other AMOS stuff 5 collision > goto 1 6 goto 2 else end I'd like to do this without much overhead to alleviate the "no longer very random " bit Anyone any good ideas? TIA |
31 October 2015, 22:27 | #2 |
Puttymoon inhabitant
|
How this affects random seed? It generates always the same value in RND command?
|
31 October 2015, 23:00 | #3 | |
Registered User
Join Date: Mar 2015
Location: Sheffield UK
Posts: 360
|
Quote:
Stops typing............. Bangs forehead on keyboard........... Just realises to take random number BEFORE resetting Timer! I feel more than a bit stupid now.... Sorry for wasting your time. |
|
02 November 2015, 18:58 | #4 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Yes, the usual way to get a random number is to use a timer to count how long it takes a user to start the game (e.g. length of time title screen is displayed). You can use RND to generate random(ish) numbers too.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
555 timer A600 | Michel | support.Hardware | 8 | 25 July 2016 08:33 |
in-game timer/clock | Lonewolf10 | Coders. Asm / Hardware | 2 | 26 September 2014 19:59 |
AMOS timer/clock? | Djay | Coders. General | 7 | 30 December 2011 20:51 |
Using timer.device in C (VBCC) | DBAlex | Coders. General | 2 | 28 June 2011 22:10 |
Old timer, new member ! | cyberknight | Member Introductions | 14 | 23 May 2009 11:07 |
|
|