#how would i make one of those earclacks ball fight games?
4 messages · Page 1 of 1 (latest)
neither have we, nor has the computer, so you'll need to really really clarify what "this" is
break it down into teeny tiny parts. what does what? what does the player do? what responds to a player button press? what do the numbers display?
Incase you mean those randomly bouncing ball thingys that damage each other:
for the movement you basically just have to make them change their rotation based on the angle of the wall and their angle
so for example:
wallangle = 90
balldir -= wallangle
output: balldir = -45```
then u can calculate the angle by doing this math:
60 × π / 180 = π/3 ≈ 1.047 rad
x = cos(1.047) × 5 ≈ 2.5
y = sin(1.047) × 5 ≈ 4.33
and then just add collision detection between the balls for the damage
and also make sure the balls spawn at a random pos because if they are always at the same place the outcome will be the same
there might be an easier way to do this but this is the only way i can come up with; maybe try watching some videos if u want an easier solution