Collisions Without a Physics Library!
🔗 Code Example: Collisions Without a Physics Library!
🔗 References:
🔗 Resources:
🔗 Timestamps:
01:23 Approach
04:07 Use p5.js 2.0 and create a bouncing ball
08:08 Create a Ball class
17:17 Collide function - Step 1: Check if balls collide & Step 2: Correct their positions
24:08 Collide function - Step 3: Calculate new velocities
31:24 Create multiple Ball objects
34:39 Write a sleep method when ball is at rest (pushing effect)
38:27 Draw eyes and mouth and add colors!
46:18 Remove objects that are off the screen
50:50 Add some typography
57:22 Vary text weights for animation
Next