Page 1 of 1

Randomly generating objects

Posted: Thu Jan 07, 2021 11:49 am
by konrmat171
Hi everyone, I have a little problem. When creating a game, he draws 2 barrels which are to move towards the protagonist over time. However, I would like the barrels to generate randomly with a minimal distance between themselves. The problem is that I can't reference the x variable that is being updated. is it possible to somehow funk draw put a delay function to which I will give the time with which the barrels will be drawn?

Re: Randomly generating objects

Posted: Thu Jan 07, 2021 12:11 pm
by pgimeno
That was a bit difficult to understand. What is the problem? Do you have trouble with spawning at a minimum distance between barrels? Do you have trouble with delaying the spawn? With both? What does "the x variable that is being updated" mean? What does "funk draw put a delay function" mean?

Re: Randomly generating objects

Posted: Tue Jan 12, 2021 5:40 pm
by milon
If you can share your code, or a similar piece of code, that will also help us to help you. :)

Re: Randomly generating objects

Posted: Thu Jan 14, 2021 2:13 pm
by RNavega
Looks related to their thread about making a flappybird clone game, in here:
https://love2d.org/forums/viewtopic.php?t=90016