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 »

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: 3657
Joined: Sun Oct 18, 2015 2:58 pm

Re: Randomly generating objects

Post 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?
User avatar
milon
Party member
Posts: 472
Joined: Thu Jan 18, 2018 9:14 pm

Re: Randomly generating objects

Post by milon »

If you can share your code, or a similar piece of code, that will also help us to help you. :)
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
RNavega
Party member
Posts: 355
Joined: Sun Aug 16, 2020 1:28 pm

Re: Randomly generating objects

Post by RNavega »

Looks related to their thread about making a flappybird clone game, in here:
https://love2d.org/forums/viewtopic.php?t=90016
JulieQ
Prole
Posts: 1
Joined: Wed Jan 20, 2021 9:44 am
Location: Boston

Re: Randomly generating objects

Post by JulieQ »

Oh, I had the same problem
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests