#๐Ÿ”’ Very bizarre issue with a game constant

24 messages ยท Page 1 of 1 (latest)

supple sonnetBOT
#

@true gull

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.

true gull
#

I have no idea what the error message even means and it isn't even consistently the same error

#

I've tried to debug and found out that there is a constant variable (Vector2.zero) that is suddenly changing, from (0,0) to (1184, 53) and then doubles for a inconsistent amount of time and then crash

#

One of the error messages (the one I do not understand at all)

Python runtime state: initialized

Current thread 0x00000001f7f3cf40 (most recent call first):
  File "/Users/jiaweilyu/Code/Python/PyGame/Procedural Animation/Engine2D.py", line 355 in Render
  File "/Users/jiaweilyu/Code/Python/PyGame/Procedural Animation/Engine2D.py", line 531 in Render
  File "/Users/jiaweilyu/Code/Python/PyGame/Procedural Animation/Engine2D.py", line 576 in RenderObjects
  File "/Users/jiaweilyu/Code/Python/PyGame/Procedural Animation/main.py", line 73 in <module>

Extension modules: pygame.base, pygame.constants, pygame.rect, pygame.rwobject, pygame.surflock, pygame.bufferproxy, pygame.math, pygame.surface, pygame.window, pygame.display, pygame.draw, pygame.joystick, pygame.event, pygame.imageext, pygame.image, pygame.key, pygame.mouse, pygame.time, pygame.mask, pygame.pixelcopy, pygame.transform, pygame.font, pygame.mixer_music, pygame.mixer, pygame.scrap, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, pygame.system, numba.core.typeconv._typeconv, numba._helperlib, numba._dynfunc, numba._dispatcher, numba.core.runtime._nrt_python, numba.np.ufunc._internal, numba.experimental.jitclass._box, pygame._freetype (total: 47)
zsh: abort      /usr/local/bin/python3```
#

I'll just send my entire code here as well

zenith sundial
#

!paste

supple sonnetBOT
#
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.

true gull
#

Oh thanks

#

thisss?

#

yep

#

the main.py file (first one) seems to be where the problem is taking place but there is probably something wrong with the other one as well

#

These 2 files are in the same directory as well

#

the issue seems to appear at random, I added a logger into the GameObject.Update() function that logs the amount of times that it ran and what the value of Vector2.zero is and heres what happens

#
0
<class '__main__.InputManager'>: (0,0)
1
<class '__main__.Head'>: (717,516)
<class 'Engine2D.SpriteRenderer'>: (717,516)
2
<class '__main__.InputManager'>: (1434,1032)
3
<class '__main__.Head'>: (3585,2580)
<class 'Engine2D.SpriteRenderer'>: (3585,2580)
etc```
#

oh i guess what i said earlier about jumping to (1184, 53) is wrong

#

so i guess uh

#

is the problem replicable?

zenith sundial
#

I'm not familiar with pygame so I don't know where to start. You are providing good information so hopefully someone who knows about it sees this and is able to help.

true gull
#

thanks for letting me know :)

#

Very bizarre issue with a game constant (pygame)

sleek iris
supple sonnetBOT
#
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.