Spawn sprite on random enemy death

Get help using Construct 2

Post » Mon Oct 28, 2013 9:39 am

Hi all,

i am at work currently so i cannot test anything, no matter i appreciate every bodies help thus far.

Thanks
B
4
Posts: 12
Reputation: 251

Post » Mon Oct 28, 2013 6:45 pm

[QUOTE=lennaert] [QUOTE=LittleStain] It would be probably even better to use choose(2,3) instead of random here.

If you do want to use random, make sure you use: floor(random(2,4)), for random(2,3) will never reach three and will give values inbetween 2 and 3 like 2,5678 when you really only want a value 2 or 3.. [/QUOTE]


Yup totally true,   

you could also int(random(1,4))

works well too

Various variations :)[/QUOTE]

Hi all, int(random(1,4)) worked a charm.

If possible can you advise what this solution is actually carrying out?

Just so i know for future reference?

Thanks all!
B
4
Posts: 12
Reputation: 251

Post » Mon Oct 28, 2013 6:49 pm

int turns the number that's between the brackets into an integer.

in the manual under system expressions, you'll find more usefull expressions and what they do..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Previous

Return to How do I....?

Who is online

Users browsing this forum: dahu, ketramtu18, Syazanie Amirin and 8 guests