Feb-06-2022, 06:46 AM
Hello,
I'm trying to program a breakout clone.
With lives = ball.move(lives) I'm trying to send "lives" to the move method of Ball.
But an error occurs:
Traceback (most recent call last):
File "D:/Daten/Breakout-neu/main.py", line 89, in <module>
main()
File "D:/Daten/Breakout-neu/main.py", line 45, in main
lives = ball.move(lives)
File "D:\Daten\Breakout-neu\ball.py", line 43, in move
lives -= 1
TypeError: unsupported operand type(s) for -=: 'NoneType' and 'int'
What I'm doing wrong?
-----------------------------------------------
Moreover:
Do I have to add a bounce method to Ball?
I tried:
if ball.collpaddle(paddlegroup):
ball.dy *= -1
-----------------------------------------
I'm politely asking for help...
Please be so kind an help me...
(main and Ball is attached as text files)
I'm trying to program a breakout clone.
With lives = ball.move(lives) I'm trying to send "lives" to the move method of Ball.
But an error occurs:
Traceback (most recent call last):
File "D:/Daten/Breakout-neu/main.py", line 89, in <module>
main()
File "D:/Daten/Breakout-neu/main.py", line 45, in main
lives = ball.move(lives)
File "D:\Daten\Breakout-neu\ball.py", line 43, in move
lives -= 1
TypeError: unsupported operand type(s) for -=: 'NoneType' and 'int'
What I'm doing wrong?
-----------------------------------------------
Moreover:
Do I have to add a bounce method to Ball?
I tried:
if ball.collpaddle(paddlegroup):
ball.dy *= -1
-----------------------------------------
I'm politely asking for help...
Please be so kind an help me...
(main and Ball is attached as text files)