Hello Chilli and guys,
first of all, many thanks to Chilli for his greater than great tutorials, he is making our dreams come true!
So, I finished my assignment from lesson 9, then started to watch tutorial 10, wondering if I did it all right and stuff. My code was actually working, so I was pretty sure I chose the right way .
I used the "for" loop instead of while, I think they are doing pretty same stuff, aren't they? To make long story short, I just made a DrawLine function, and then made "for" loop for DrawLine so I got the DrawRectangle function.
And I'd like to ask you guys with more experiences, what are the advantages and disadvantages of doing it this way, and how about the way Chilli did it in tutorial?
Thanks a lot, Chrajdal
Lesson 9 assignment 1
Lesson 9 assignment 1
- Attachments
-
- Lesson_9_Assignment_1.rar
- (26.35 KiB) Downloaded 140 times
Re: Lesson 9 assignment 1
It works, so it's fine. However, as a function it would be far better if you could specify both the coordinates and the dimensions of the rectangle. As it stands in the current program, the dimensions of the rectangle drawn are tied directly to vars in the game class. If you want to draw multiple rectangles with different dimensions, you're screwed brah.
Chili