#๐Ÿ”’ third part glitching

41 messages ยท Page 1 of 1 (latest)

willow knotBOT
#

@undone fossil

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.

undone fossil
#

@sly talon

sly talon
#

gimme 20 mins, i gtg, i'll be back asap

undone fossil
sly talon
#

!paste

willow knotBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

undone fossil
#

line 43

eternal wharf
#

head is not global inside the function

undone fossil
#

ight lemme try

#

nope

#

nothing changed

#

the 3rd part is index 2

sly talon
#

alr, i'll debug this on my machine for a while :P

undone fossil
#

thank you

sly talon
#

Part 1 overlaps with Part 0

#

this is what i've gathered

#

as of now

undone fossil
#

oh

#

alr

#

thx

#

bruv

#

it's almost 6am

#

i can barely type

#

i need to sleep

#

sorry but ill have to read your answer tmr if you will continue the problem

#

bc i really can't stay awake anymore

#

so cya brother and gn

sly talon
#

alr, this thread closes after 1 hour of inactivity

undone fossil
#

oh

sly talon
#

so check this out later

#

i'll mention ya

undone fossil
#

kk

#

thx

#

cya

sly talon
#

@undone fossil found the issue

#

remember i told you to reverse the order of assignment so the last parts get assigned first

#

well, we forgot to move the assignment to part[0] downwards

#
def update_body_positions():
    for i in range(len(parts)-1, 0, -1):
        parts[i].x = parts[i-1].x
        parts[i].y = parts[i-1].y
    if len(parts) >= 1:
        parts[0].x = head.x
        parts[0].y = head.y
#

here is the fix

willow knotBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.