How do I call random number for a condition ?

Get help using Construct 2

Post » Sun Sep 06, 2015 6:08 pm

I want to call an action based on a condition ...
The condition is based on a random number that i also need to call .
This may have an easy solution but how can i achieve the second part , ( creating a condition based on a random number )
Thank you ! Hopefully ill get an answer :)
'Image'Image'Image
B
19
S
5
G
2
Posts: 97
Reputation: 2,374

Post » Sun Sep 06, 2015 10:30 pm

I think you have to specify your problem a bit more. What exactly are you trying to achieve? In C2 you can use "random()" or your own functions while building (for example) "Compate two values" condition.
ImageImageImage
B
27
S
16
G
73
Posts: 974
Reputation: 41,157

Post » Tue Nov 17, 2015 5:14 pm

found a shortcut for my case ... really appreciate your response BackendFreak :D
'Image'Image'Image
B
19
S
5
G
2
Posts: 97
Reputation: 2,374

Post » Tue Nov 17, 2015 5:55 pm

Yesterday, I use for have diferente Speed for enemy, this way:

I create a variable "Speed" for enemy object and when ennemy collision with a special invisible objet (a simple rectangle sprite) = action = enemy set Speed to choose(80,120,160,240)

you can have many numbers like you want and you can create a function for that and call it when you need.
B
5
Posts: 33
Reputation: 299


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests