Pygame tutorial #7: more on lines This tutorial is a bit of a special. I’ve heard from several people who have had difficulty with Drawing lines – Exercise 6 in tutorial #2. So I am going to go through how to solve it here. Understand the problem To understand the problem we are trying to solve we need to draw a bit so get out your pen and paper. If you have square ruled paper, it might make things a bit easier for you. Draw a horizontal and a vertical line as in the picture below. You can of course use more squares than I have, but this should be enough to demonstrate the principle. Next, draw a line from (0, -5) to (1, 0) as I have. In each image, I have used blue to indicate the newest line. It is not something you need to do in your drawing. Next line goes from (0, -4) to (2, 0). Next line: (0, -3) to (3, 0): Then (0, -2) to (4, 0): Draw a final line from (0, -1) to (5, 0): Now you have the principle behind the pattern in the exercise. To get the horizontal and vertical lines you could do (0, -6) to (0, 0) and (0, 0) to (6, 0). To sum it all up: (0, -6) to (0, 0) (0, -5) to (1, 0) (0, -4) to (2, 0) (0, -3) to (3, 0) (0, -2) to (4, 0) (0, -1) to (5, 0) (0, 0) to (6, 0) Translating to python
Pygame tutorial #7: more on lines This tutorial is a bit of a special. I’ve heard from several people who have had difficulty with Drawing lines – Exercise 6 in tutorial #2. So I am going to go through how to solve it here. Understand the problem To understand the problem we are trying to solve we need to draw a bit so get out your pen and paper. If you have square ruled paper, it might make things a bit easier for you. Draw a horizontal and a vertical line as in the picture below. You can of course use more squares than I have, but this should be enough to demonstrate the principle. Next, draw a line from (0, -5) to (1, 0) as I have. In each image, I have used blue to indicate the newest line. It is not something you need to do in your drawing. Next line goes from (0, -4) to (2, 0). Next line: (0, -3) to (3, 0): Then (0, -2) to (4, 0): Draw a final line from (0, -1) to (5, 0): Now you have the principle behind the pattern in the exercise. To get the horizontal and vertical lines you could do (0, -6) to (0, 0) and (0, 0) to (6, 0). To sum it all up: (0, -6) to (0, 0) (0, -5) to (1, 0) (0, -4) to (2, 0) (0, -3) to (3, 0) (0, -2) to (4, 0) (0, -1) to (5, 0) (0, 0) to (6, 0) Translating to python
Pygame%20tutorial%207%20-%20Lorenzo%20E%20Danielsson.docx