M
M
michadimin2021-01-01 14:10:05
Python
michadimin, 2021-01-01 14:10:05

How to make PyGame draw with lines instead of dots?

I am writing a program using PyGame + Pymunk (for physics processing)

I wanted to give the user the ability to draw obstacles himself and the initial algorithm is the dot drawing algorithm. But it turned out to be ineffective due to the fact that with fast line movements, the obstacle breaks (and there are still a lot of problems with this approach).

I tried to implement a drawing algorithm using lines, but in the end - everything is still drawn with dots ...

I've been struggling with this for the second day, can anyone help?

Here is the code (the problem starts from line 80) - https://pastebin.com/k1uGG9fS

PS There you can see that I actually draw with Pymunk, but this does not matter, since Segment is almost an analogue of the line from PyGame.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alan Gibizov, 2021-01-01
@michadimin

Look, I once tinkered with this case, the code is at the link .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question