433 - v2
Week 03 | 09/20/2022
- 433 - v2
Code was refined — I was able to combine some “&&” and “||” after this week’s class;
Soccer ball graphics are now upgraded. I downloaded a soccer ball graphic from NYU Adobe Stock and applied it into the project. Color if the soccer ball still changes every time the code is run;
Sliders for ball size, players size and goal keeper(GK) moving speed were added, the GK one is for fun; Sliders were rotated 90 degrees and aligned next to the pitch for ease of use and aesthetics. Buttons are planned to be added on the left side of the pitch.
Updated mouseIsPressed variable — now it only works when the ball(cursor) is on the pitch(canvas).
Next steps:
Adding buttons and spotlights to each player, so user can turn the spotlight/spotlights on or off and focus on certain player/players; as for now the spotlight for player no.7 is on and follows the real-time position of the player; spotlight() might be use here, however it required WebGL, which will be looked into.
Letting players be able to detect their distance to the ball, if the ball is too far away, they should not be sprinting towards it since it is unnecessary and a waste of stamina. Instead, players who are closer to the ball will move faster to contain.