Bluenix2 / crackout

A now archived breakout clone, crackout! Because crack is a synonym of break.
MIT License
1 stars 0 forks source link

Manipulate Ball with Platform #14

Open Bluenix2 opened 4 years ago

Bluenix2 commented 4 years ago

We need a way to manipulate the ball with our platform to actually play, since the game is deterministic otherwise. The new bouncing direction would be determined by the point of collision. Done in GDScript with a RigidBody2D like this:

set_linear_velocity(body.position.direction_to(position)*linear_velocity.length())