-
Notifications
You must be signed in to change notification settings - Fork 0
Randomize Ball Velocity #15
Copy link
Copy link
Open
Description
alienboy13
opened on Oct 17, 2021
Issue body actions
- Create a maxSpeed variable in the Ball Object
- Set the maxSpeed variable in the Start Method
- Initialize the Ball's Speed as only a positive y component of MaxSpeed
- In the OnCollision Enter method, create local variables for the x and y components of the Ball's velocity
- Check what the position of the collider is relative to the ball, checking for up, down, left, and right
- If the collider is up, invert the y direction and randomize the x
- if the collider is down, invert the y direction and randomize the x
- if the collider is to the left, invert the x direction and randomize the y
- If the collider is to the right, invert the x direction and randomize the y
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels