#๐Ÿ”’ Flappy bird pipes generation

30 messages ยท Page 1 of 1 (latest)

uncut craneBOT
#

@stark cradle

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

buoyant yacht
#

I would create them at random heights, and place them in a list. Just create them all at the beginning. Iterate over the list to move them.

#

I've done something similar with turtle graphics.

stark cradle
#

Oh I forgot to say i want the seperation distance to be PIPE_SEPARATION = 300

#

But still same thing, I apprecaite the help

frigid wharf
#

I would define like certain limits, like limit for pipe 1 and then u can generate the other witha pipe separation

#

yea exactly that

#

and idk use random library for pipe generation

stark cradle
#

and like pipe_gap

frigid wharf
#

yea

stark cradle
#

I think I kinda off understand how I'll have a try

buoyant yacht
#

I'm at work on my phone, so I can't help with the details, but the general approach should help. Objects off the screen aren't visible

stark cradle
#

Oh yeah objects need to be deleted when off the screen too

frigid wharf
stark cradle
#

but thats just like .delete or something right?

frigid wharf
stark cradle
#

Just real quick should pipe_gap be a constant in the gui class

#

or just self._pipe_gap = 300 is fine?

stark cradle
frigid wharf
stark cradle
#

Nah I think i understand actually maybe they should both be constants in the gui class

#

Thanks ๐Ÿ™‚

frigid wharf
#

yw

frigid wharf
stark cradle
#

Okay i'll have a crack at it all ping if i need help tysm

stark cradle
# frigid wharf Remember this

sorry dont mean to bother but do you think I should maybe return when the pipes are off the screen in this function which is in the pipe class. Adding something like this
self._x + self._pipe_width < 0
Or is there a different method you'd do?

#

So that they can be deleted

stark cradle
#

!close

uncut craneBOT
#
Python help channel closed with !close

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.