Lesson 9 assignment 1

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
Chrajdal
Posts: 22
Joined: December 15th, 2012, 2:18 pm

Lesson 9 assignment 1

Post by Chrajdal » December 15th, 2012, 11:40 pm

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 :mrgreen:.
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
Attachments
Lesson_9_Assignment_1.rar
(26.35 KiB) Downloaded 140 times

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Lesson 9 assignment 1

Post by chili » December 16th, 2012, 1:52 pm

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

Post Reply