peachyontop

hrthtrhrth

Apr 6th, 2026
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. "Tanks!" Logic & Mechanics
  2.  
  3. Role: You are an expert Game Developer specializing in 2D physics and arcade mechanics.
  4. Objective: Develop a fully playable "Tanks!" game using [Insert Language, e.g., Python/Pygame or JavaScript/p5.js].
  5. 1. Core Gameplay Mechanics
  6.  
  7. The Tank: A tank consists of a Body (independent rotation) and a Turret (rotates toward the mouse cursor). Movement is tank-style (Forward/Backward and Rotate Left/Right).
  8.  
  9. The Projectile: Tanks fire slow-moving shells.
  10.  
  11. Ricochet: Shells must bounce off walls exactly once before exploding on the second impact.
  12.  
  13. Velocity: Shells travel faster than the tank but slow enough for a player to dodge.
  14.  
  15. Combat: One-hit-kill system. If a shell hits a tank’s hitbox, that tank is destroyed.
  16.  
  17. 2. Map & Environment
  18.  
  19. The Grid: Generate a fixed arena with a border.
  20.  
  21. Obstacles: Include "Blocks" that are indestructible.
  22.  
  23. Line of Sight: Implementation must include a simple ray-casting check so shells and AI can recognize wall collisions.
  24.  
  25. 3. AI Behavioral Logic
  26.  
  27. Create an EnemyTank class with the following "Think" loop:
  28.  
  29. State - Idle: Rotate the turret slowly to scan for the player.
  30.  
  31. State - Attack: If a direct Line of Sight (LOS) to the player exists, stop moving and fire.
  32.  
  33. State - Evade: If a shell is detected within a certain radius, move perpendicular to the shell's trajectory.
  34.  
  35. Movement: Use simple pathfinding (like A* or basic Breadth-First Search) to navigate around blocks toward the player’s last known position.
  36.  
  37. 4. Technical Specifications
  38.  
  39. Collision Detection: Use Axis-Aligned Bounding Boxes (AABB) for walls and Circle-to-Rectangle collision for the shells.
  40.  
  41. Frame Rate: Target 60 FPS with delta time integration for smooth movement.
  42.  
  43. Input Map: * WASD or Arrow Keys for Movement.
  44.  
  45. Mouse Move for Turret Aim.
  46.  
  47. Left Click or Space to Fire (Limit: Max 5 shells on screen at once).
  48.  
  49. 5. Mathematical Requirements
  50.  
  51. Please use the following logic for shell bouncing:
  52.  
  53. When a shell hits a vertical wall, invert its x-velocity: vx​=−vx​.
  54. When it hits a horizontal wall, invert its y-velocity: vy​=−vy​.
  55. Maintain a bounce_count variable for each shell; if bounce_count > 1, destroy the shell.
  56.  
  57. Ensure the game is functionaly sound and that the graphics are the best they can be.
  58.  
  59. The game engine is "GODOT 4.5". Ensure everything is compatible with this version
Advertisement
Add Comment
Please, Sign In to add comment