Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Yeah, we also used a RigidBody2D for the ball and StaticBody2D for the bumpers. But the bounce effect was done in our case by changing a "bounce" value in the graphical interface on the bumpers objects.

The way you coded an impulse whose direction depends on the angle of the ball creates a much better effect!

I considered using the “bounce” property for some of the physics, but rejected it because, if I understand correctly, a bouncy object means the ball would bounce back harder the harder it hits, whereas pinball bumpers have their own power source, so they should really push the ball away with equal force no matter how fast or slowly it’s going when it arrives. Hence the idea of using impulse instead.

Yes I can clearly see what you're saying and from the gameplay of your game I can also see that it was the right call.