Random Platform
Ayolabi12345
Member Posts: 30
In my game, platforms are supposed to randomly pop up as the player advances. But I don't know the coding for that.
It's supposed to be programmed so that when the person exits the app, the platforms are never the same.
Comments
create an invisible actor called platform manager or something and have that actor manage (spawning of randomly generated platforms) the platforms.
This tutorial might help:
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Okay so I did that. But how do I make a door randomly spawn at random times?
like a door that appears at random time and then disappears?
maybe add game attribute called last_time, and an attribute called next_time
then in your invisible manager
add a these rules
change attribute next_time = random(1,5) (to make it random from 1 second to 5 seconds)
if numerical expression
(self.time - last_time) >= next_time
do
- change attribute last_time to self.time
- change attribute next_time = random(1,5)
- spawn door
then in your door actor....
timer after 1 second
destroy
so this will make your door appear randomly between 1 to 5 seconds and disappear after 1 second.