i have 4 different balls for the game. Starting with one ball visible and in use. When the total score gets to multiples of 5 i want to add a new ball into play.
so far i have:
python
if total_score == 5:
ball2.showturtle()
ball2.dx = 0.12
if total_score == 10:
ball3.showturtle()
ball3.dx = 0.08
if total_score == 15:
ball4.showturtle()
ball4.dx = 0.15`
where ball.dx just varies the speed of each ball, and whilst hidden each ball is just travelling vertically up and down so its ‘spawn’ position is unknown when it first comes into play
i want to make this code more efficient but I cant figure it out, as i am very new to coding.
James Kelley is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.