Randomly generating objects

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
konrmat171
Prole
Posts: 4
Joined: Sun Dec 20, 2020 4:28 pm

Randomly generating objects

Post by konrmat171 » Thu Jan 07, 2021 11:49 am

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?

User avatar
pgimeno
Party member
Posts: 2479
Joined: Sun Oct 18, 2015 2:58 pm

Re: Randomly generating objects

Post by pgimeno » Thu Jan 07, 2021 12:11 pm

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?

milon
Citizen
Posts: 89
Joined: Thu Jan 18, 2018 9:14 pm

Re: Randomly generating objects

Post by milon » Tue Jan 12, 2021 5:40 pm

If you can share your code, or a similar piece of code, that will also help us to help you. :)

RNavega
Citizen
Posts: 59
Joined: Sun Aug 16, 2020 1:28 pm

Re: Randomly generating objects

Post by RNavega » Thu Jan 14, 2021 2:13 pm

Looks related to their thread about making a flappybird clone game, in here:
https://love2d.org/forums/viewtopic.php?t=90016

Post Reply

Who is online

Users browsing this forum: No registered users and 54 guests