Spawning Random Objects

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
• Hi,

I just finished the Chocobreak tutorial (in the Games Factory 2, trying that out first) and am working on improving it with improved controls, power ups and so forth. I've figured out how to create new objects so I can spawn power ups when the bricks are broken - the problem is, I don't want them to spawn every time.

So my question is:

• How do you create objects that spawn from a random value?

Currently it's "If Ball Golden has a collision with Milk > Create new Champagne Glass"

But I would prefer that it somehow checked for a random number between say 1 and 4, and if it's a 2, it spawns a champagne glass, if it's a 3, it spawns a muffin, and if it's a 1 or a 4 it spawns nothing. How do you do that in the Games Factory? It's a pretty fundamental question for game dev and I've skimmed some beginner and intermediate tutorials with no luck. All the tutorials I've seen just use timers, but I want it based on random chance, pure chance.

Thanks, this is my first post in this forum, liking the product so far. Looking forward to meeting some of you on here.
Stu

• You can use the built-in condition for that:

Working as fast as I can on Fusion 3

• Now that you point it out it's blindingly obvious! Thanks!

• I'm just trying to get my head around their way of logic, so can you help clarify for me exactly what it means and how to use it?

For example, it comes up with 2 windows. The first says, "Enter the chances" and then "Enter the total number of chances".

So say I said, "Enter the chances = 1" and "Total chances = 4", would that mean there was a 1 in 4 chance of the event occurring? Is that how it works?

Thanks

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!