O
O
OccamaRazor2017-04-17 16:23:37
Python
OccamaRazor, 2017-04-17 16:23:37

How to apply a method to multiple objects?

Player = Character((0,0,60,60))
Player1 = Child((0,0,100,100))

# после основного цикла нужно вызывать метод update()
Player.update(DISPLAY)
Player1.update(DISPLAY)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Tyuvaev, 2017-04-17
@OccamaRazor

Put them in a list and in a loop call the desired method for each element of the list.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question