Additional Info
|
That's a stupid way to write an if-statement. It means something like this:
If(this.score < 0) this.score = 0; else this.score = this.score; It's just making sure you don't get a negative score |
Additional Info
|
Ok, thx for your reply. Now I understand this, but what about the first line... Math.random()*5 means a random number from 0 to 4, or from 1 to 5?
|
Additional Info
|
I don't know the differences between flash and C/C++, but in C/C++ that would generate a random number and multiply it by five. If that actually means mod, it would generate a random number from 0~4
|
Additional Info
|
Math.random()
Pseudo-random number between 0 and 1 (0 <= n < 1). Math.random() * i Pseudo-random number between 0 and i (0 <= n < i). Math.random() * 5 Pseudo-random number between 0 and 5 (0 <= n < 5). I assume score is an integer, so it automatically rounds it. |
Additional Info
|
Thx now I know what exacly this game does with score. Close the thread (broken image removed).
|