#๐ these particle thingys (the things drop when enemies die) are kinda jittering
30 messages ยท Page 1 of 1 (latest)
Click here to see this code in our pastebin.
@polar hornet
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.
Jitter is a well known issue in particle simulations. I can't debug exactly what's going on, but one solution is to dampen the motion or forces after they have reached a certain threshold and just set velocity and position to 0, etc.
did you see the vid
yes
you saw the enemies die right
yes
you saw what they drop
yes
they prob not jittering
lemme double check
i disabled their bounciness and its still the same
btw have you checked the code
Like I said, I won't be able to debug this. You'll have to dampen the forces or velocity on the particles after they fall below some threshold value. That is how you remove the jitter.
ok wait
Your projectiles have damping set at zero
(PhyE.x, PhyE.y), (vx, vy), 0.5, 0.1, 0, (11, 11)),
other than that:
tile_y = int(PhyD.y // t_size)
PhyD.on_ground = on_tile_ground(PhyD.x, PhyD.y - h_size)
if PhyD.on_ground:
PhyD.y = tile_y * t_size - h_size
(0, 0) is top left for pygame
this is rounding your Y coordinate upwards, resulting in the snap-bounce effect as it gets smaller
I suggest building in toggleable slomo so you can see the exact behaviors of each step in non-real-time to understand your physics engine better
other tricks you can use is graphing/tracing
Since you know the particles are what is misbehaving, what you can do is keep track of their Y coordinate and dump a list on exit. Then you can load that into matplotlib or similar and you'd see the abrubt square shape of the motion and be able to see what's wrong
nvm i fixed it
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.