File size: 6,118 Bytes
105b77b 6d54fec 105b77b fc30dd6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
---
title: HF Map
emoji: ๐ป
colorFrom: purple
colorTo: green
sdk: static
pinned: false
---
# Battlefield Simulator
Battlefield Simulator is an immersive real-time military strategy game that runs directly in your web browser, featuring autonomous Blue and Red forces battling across an interactive map.
Watch as 14 different unit typesโfrom basic infantry and tanks to elite special forces and missile batteriesโengage in dynamic combat with realistic movement patterns, health systems, and tactical AI.
The game progresses through days and hours, unlocking new unit types over time while tracking detailed battle statistics including casualties, reinforcements, territory control, and active engagements.
With its intuitive click-to-inspect interface, pause/resume controls, and visually striking battle animations, this simulation offers an engaging strategic experience where you can observe complex military scenarios unfold in real-time without requiring any downloads or installations..
## ๐ฎ Features
### Core Gameplay
- **Real-time Simulation**: Units move, engage, and battle autonomously in real-time
- **Interactive Map**: Built with Leaflet.js for smooth map interactions
- **Dynamic Combat**: Units engage in battles based on proximity and attack ranges
- **Unit Progression**: 14 different unit types that unlock over time
- **Day/Night Cycle**: Time progression affects unit availability and events
### Unit Types
- **Base Units** (Available from start):
- Infantry Battalion ๐ค
- Tank Division ๐ก๏ธ
- Artillery Battery ๐ฅ
- Reconnaissance Unit ๐
- Air Defense Unit ๐
- Command Center โญ
- Medical Corps ๐ฉบ
- **Advanced Units** (Unlock over time):
- Airborne Division ๐ช (Day 2)
- Special Forces ๐ฅท (Day 3)
- Mechanized Infantry ๐ (Day 4)
- Combat Engineers ๐ง (Day 5)
- Naval Support โ (Day 6)
- Air Squadron โ๏ธ (Day 7)
- Missile Battery ๐ (Day 10)
- Elite Force ๐ (Day 15)
### Battle Mechanics
- **Strength-based Combat**: Unit strength affects combat effectiveness
- **Range-based Engagement**: Different unit types have varying attack ranges
- **Health System**: Units take damage and can be eliminated
- **Reinforcements**: New units spawn periodically
- **Territory Control**: Visual representation of battlefield dominance
### Statistics & Monitoring
- **Real-time Stats**: Active units, casualties, reinforcements
- **Battle Tracking**: Monitor ongoing engagements
- **Territory Control Bar**: Visual battlefield control indicator
- **Unit Information Panel**: Detailed stats for selected units
## ๐ Getting Started
### Prerequisites
- Modern web browser (Chrome, Firefox, Safari, Edge)
- No additional software installation required
### Installation
1. Clone or download this repository
2. Open `index.html` in your web browser
3. The simulation will start automatically
### File Structure
```
HF-Map/
โโโ index.html # Main HTML structure
โโโ script.js # Game logic and simulation engine
โโโ style.css # Styling and animations
โโโ README.md # This file
```
## ๐ฏ How to Play
### Basic Controls
- **Click on units**: View detailed information in the info panel
- **Pause/Resume**: Use the pause button to stop/start the simulation
- **Observe**: Watch as battles unfold automatically
### Understanding the Interface
#### Map View
- **Blue circles**: Blue faction units
- **Red circles**: Red faction units
- **Size**: Larger circles represent stronger units
- **Animations**: Battle effects appear during combat
#### Information Panel
- **Unit Information**: Click any unit to see its details
- **Battle Statistics**: Real-time combat metrics
- **Territory Control**: Visual bar showing battlefield dominance
#### Statistics Tracked
- **Active Units**: Current operational forces per faction
- **Casualties**: Units eliminated in combat
- **Reinforcements**: New units added to the battlefield
- **Active Battles**: Ongoing combat engagements
- **Territory Control**: Percentage control by each faction
## ๐ง Technical Details
### Technologies Used
- **HTML5**: Structure and layout
- **CSS3**: Styling, animations, and responsive design
- **JavaScript (ES6+)**: Game logic and simulation engine
- **Leaflet.js**: Interactive mapping library
- **OpenStreetMap**: Map tile provider
### Key Features Implementation
- **Unit AI**: Autonomous movement and target selection
- **Combat System**: Range-based engagement with damage calculations
- **Event System**: Random events and environmental effects
- **Time Management**: Day/hour progression with unlockable content
- **Visual Effects**: Battle animations and unit status indicators
### Performance Optimizations
- Efficient unit movement calculations
- Optimized battle detection algorithms
- Smooth animations with CSS transitions
- Responsive design for various screen sizes
## ๐จ Customization
### Modifying Unit Types
Edit the `unitTypes` object in `script.js` to adjust:
- Movement speed
- Attack power
- Attack range
- Unlock timing
- Visual icons
### Adjusting Game Balance
Modify these variables in `script.js`:
- Initial unit counts
- Spawn rates
- Battle mechanics
- Time progression speed
### Styling Changes
Update `style.css` to customize:
- Color schemes
- Unit appearance
- UI layout
- Animation effects
## ๐ Known Issues
- Map interactions are disabled to prevent interference with unit selection
- Performance may decrease with very large numbers of units
- Mobile responsiveness could be improved for smaller screens
## ๐ฎ Future Enhancements
- Save/load game states
- Multiplayer functionality
- More detailed unit customization
- Advanced AI strategies
- Sound effects and music
- Mobile app version
## ๐ License
This project is open source and available under the MIT License.
## ๐ค Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.
## ๐ง Contact
For questions or feedback about this project, please open an issue in the repository.
---
**Enjoy the battle!** ๐๏ธ
|