Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Tanks!" Logic & Mechanics
- Role: You are an expert Game Developer specializing in 2D physics and arcade mechanics.
- Objective: Develop a fully playable "Tanks!" game using [Insert Language, e.g., Python/Pygame or JavaScript/p5.js].
- 1. Core Gameplay Mechanics
- 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).
- The Projectile: Tanks fire slow-moving shells.
- Ricochet: Shells must bounce off walls exactly once before exploding on the second impact.
- Velocity: Shells travel faster than the tank but slow enough for a player to dodge.
- Combat: One-hit-kill system. If a shell hits a tank’s hitbox, that tank is destroyed.
- 2. Map & Environment
- The Grid: Generate a fixed arena with a border.
- Obstacles: Include "Blocks" that are indestructible.
- Line of Sight: Implementation must include a simple ray-casting check so shells and AI can recognize wall collisions.
- 3. AI Behavioral Logic
- Create an EnemyTank class with the following "Think" loop:
- State - Idle: Rotate the turret slowly to scan for the player.
- State - Attack: If a direct Line of Sight (LOS) to the player exists, stop moving and fire.
- State - Evade: If a shell is detected within a certain radius, move perpendicular to the shell's trajectory.
- Movement: Use simple pathfinding (like A* or basic Breadth-First Search) to navigate around blocks toward the player’s last known position.
- 4. Technical Specifications
- Collision Detection: Use Axis-Aligned Bounding Boxes (AABB) for walls and Circle-to-Rectangle collision for the shells.
- Frame Rate: Target 60 FPS with delta time integration for smooth movement.
- Input Map: * WASD or Arrow Keys for Movement.
- Mouse Move for Turret Aim.
- Left Click or Space to Fire (Limit: Max 5 shells on screen at once).
- 5. Mathematical Requirements
- Please use the following logic for shell bouncing:
- When a shell hits a vertical wall, invert its x-velocity: vx=−vx.
- When it hits a horizontal wall, invert its y-velocity: vy=−vy.
- Maintain a bounce_count variable for each shell; if bounce_count > 1, destroy the shell.
- Ensure the game is functionaly sound and that the graphics are the best they can be.
- The game engine is "GODOT 4.5". Ensure everything is compatible with this version
Advertisement
Add Comment
Please, Sign In to add comment