3D Battle Royale Player Setup
Prompt
Create a complete 3D Battle Royale-style game featuring a player character inspired by Free Fire with the following specifications: - Character Properties: - Realistic height of 1.75 meters. - Realistic physics including gravity, mass, and collision detection. - Environment: - Tropical island terrain with diverse elements including buildings, trees, mountains, roads, and obstacles. - Spawn points for player or items. - Camera: - Third-person camera that follows the player. - Camera allows free movement and rotation controlled by the mouse. - Player Controls: - Movement: Run using WASD keys. - Sprint with Shift key. - Jump with Space key, with realistic jump height (~1.5 meters). - Crouch using the 'C' key. - Aim and shoot using mouse right-click (aim) and left-click (shoot). - Switch among multiple weapon types: Assault Rifle (AR), Submachine Gun (SMG), and Shotgun. - Interact: Pick up weapons and shields from the environment. - Throw grenades and use healing items during gameplay. - Animations: - Idle animation when standing still. - Running animation during movement. - Jumping animation. - Aiming and shooting animations. - Physics and Collision: - Implement physics-based collision to prevent walking through buildings or obstacles. - Ensure jumping does not cause unnatural flying into the sky. - Development Requirements: - Export all game logic in TypeScript (TSX). - Use React Three Fiber for 3D rendering. - Use @react-three/rapier physics engine for realistic physics. - Structure code to be modular, scalable, and optimized for performance. - Additional Constraints: - Replicate player controls and behaviors similar to Free Fire. # Steps 1. Define the player model with accurate height and realistic physics properties. 2. Generate a detailed tropical island environment including buildings, trees, roads, mountains, spawn points, and obstacles. 3. Implement a third-person camera with flexible movement and rotation controllable via mouse input. 4. Setup player input controls for running, sprinting, jumping, crouching, aiming, shooting, switching weapons, picking up items, throwing grenades, and using healing items. 5. Integrate animations for all player states and actions. 6. Apply physics and collision detection ensuring natural interaction with environment and no unreal jumps. 7. Organize code using TypeScript and React Three Fiber coupled with @react-three/rapier. 8. Ensure modularity, scalability, and optimization throughout the codebase. # Output Format Provide the full game logic code in TypeScript (TSX), compatible with React Three Fiber and @react-three/rapier physics engine, well-commented and modularized for scalability and performance. Include all player control implementations, animations, physics setups, environment generation, and camera controls as described. No additional narrative or explanation—only source code and necessary inline comments. # Notes - The player character and controls should closely emulate the feel and mechanics of Free Fire. - Use realistic physics parameters for gravity, mass, and collisions. - The environment should support gameplay elements such as spawning weapons and items on the ground for pickup. - Camera must allow the player full rotational freedom around the character. - Avoid any physics glitches like unnatural flying or clipping through objects. This prompt is suitable for platforms supporting code or video game generation with detailed 3D and physics capabilities (e.g., Sora or similar).
Related Coding Prompts
Write Code
As a seasoned programmer, your task is to write code in [programming language] to [perform action]. The code should be efficient, well-structured, and optimized for performance. Make sure to follow best practices and industry standards while implementing the necessary algorithms and logic to achieve the desired functionality. Test the code thoroughly to ensure it functions as intended and meets all requirements. Additionally, document the code properly for future reference and maintenance.
Debug Code
Act as a seasoned programmer with over 20 years of commercial experience. Analyze the provided [piece of code] that is causing a specific [error]. Your task involves diagnosing the root cause of the error, understanding the context and functionality intended by the code, and proposing a solution to fix the issue. Your analysis should include a step-by-step walkthrough of the code, identification of any bugs or logical mistakes, and a detailed explanation of how to resolve them. Additionally, suggest any improvements or optimizations to enhance the performance, readability, or maintainability of the code based on your extensive experience. Ensure that your solution adheres to best practices in software development and is compatible with the current development environment where the code is being executed.
Do Code Review
As a seasoned programmer with over 20 years of commercial experience, your task is to perform a comprehensive code review on the provided [piece of code]. Your review should meticulously evaluate the code's efficiency, readability, and maintainability. You are expected to identify any potential bugs, security vulnerabilities, or performance issues and suggest specific improvements or optimizations. Additionally, assess the code's adherence to industry standards and best practices. Your feedback should be constructive and detailed, offering clear explanations and recommendations for changes. Where applicable, provide examples or references to support your suggestions. Your goal is to ensure that the code not only functions as intended but also meets high standards of quality and can be easily managed and scaled in the future. This review is an opportunity to mentor and guide less experienced developers, so your insights should be both educational and actionable.