In a shoot them up I have an enemy (a boss) that I want to be bouncing around in a way that seems random.
So I made it into a RigidBody2D, and I disposed around it some invisible StaticBody2D. I have a physics material for bounce.
It works fine, however I would like it to be less predictible. So when it collides with the screen border (implemented with a StaticBody2D) I want to add a small, random angle to the bounce. So instead of a perfect bounce, we get something less predictible.
Any idea how to implement it?
I've looked into writing code on collision in GDScript but I can't find much info on RigidBody2D, apparently all the collision-related methods are only defined on KinematicBody2D.