Gorillas — Artillery, Wind, and AI
Core loop
- Players alternate shots. Each turn sets an angle (0–90°) and initial velocity, then launches a spinning banana affected by gravity and wind.
- Round ends when a player hits the other’s gorilla; scores increment and turns swap.
Physics
- Projectile: Position integrates velocity per frame; gravity applies downward acceleration; wind adds horizontal acceleration sampled per round.
- Rotation: Banana sprite rotates proportional to velocity for readable motion.
- Collisions: Skyline/building silhouettes are checked for impact; boundary checks handle out‑of‑bounds.
UI
- Two control panels (one per player) expose angle/velocity inputs, “AI controlled” toggles, and “Throw” buttons.
- Center HUD shows turn and scores; a fixed top bar keeps controls visible.
AI
- Heuristic learning: The AI remembers last error (miss distance) and adjusts angle/velocity to close the gap on subsequent tries, with safeguards against wall‑hugging trajectories.
- Turn sync: AI requests a shot only on its turn, after a brief delay to mimic reaction time.
Polish
- Audio SFX for throws and impacts, wind display, building generation, subtle shadows, and responsive layout sizing the play area under the control bar.
Extensions
- Terrain destruction, varying gravity, gusty wind model, power‑ups (bounce, split‑shot), or per‑match handicaps.