How to Use OOPS instead of displaying to the window in a list

Joined
Dec 5, 2022
Messages
2
Reaction score
0
def draw_forest(win):

therow = 0
trees = 0
y = 14
tree_num = 1

list_of_trees = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]

while therow < 10:
x = 14
while trees < 15:
tree = Tree(Point(x,y), "0_tree.png", tree_num)


image = Image(tree.get_point(), tree.get_image())
image.draw(win)
x += 29
tree_num += 1
trees += 1




y += 29
trees = 0
therow += 1

list_of_trees = [list_of_trees] * therow
print(list_of_trees)
return list_of_trees


How to display the following using onject oriented projramming.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top