Start
First, I’ll start by setting up the basic HTML structure. I need a canvas element for the game, along with HUD elements for health and energy. The CSS should style the game container, players, projectiles, and HUD. I’ll use flexbox to center everything and set a dark background to match the bloodstream setting.
Next, the JavaScript part. The game loop is crucial for animation. I’ll use requestAnimationFrame. Player movement will be handled with keydown and keyup event listeners. The players should move with arrow keys and WASD. Collision detection is needed for projectiles and players. I’ll need variables for health, energy, and other stats.
The game mechanics include Sonic Boom attacks, which are projectiles. When a player presses the attack key (Space or Enter), a projectile is created. These projectiles move in the direction the player is facing. I’ll need to check for collisions between projectiles and the opposing player, then update health accordingly.
Cellular absorption is another feature. Collecting red blood cells gives a shield. I’ll spawn cells randomly and check if players collect them. Shields should be temporary, so a timeout will remove the shield after a few seconds.
The medical intervention event is a timed mini-game. I’ll create a progress bar and a moving cursor. Players need to press the key when the cursor is in the green zone. Success gives a health boost. This requires an interval to move the cursor and an event listener for the key press.
I need to handle game states: showing a title screen initially, then the game, and a game over screen when someone’s health reaches zero. The startGame function will reset all variables and spawn cells. The gameOver function stops the loop and displays the winner.
Testing is important. I’ll make sure all features work together without errors. Possible issues might be collision detection accuracy or performance with multiple projectiles. I’ll optimize by limiting projectiles and using efficient checks.
Finally, adding audio and images as per the tools mentioned. The user mentioned PNG, JPG, and sound files, so I’ll include placeholders for those. The generateImage and generateAudio tools will create the necessary assets with appropriate prompts related to the game’s setting.
I should ensure all parts from the synopsis are included: movement, combat, absorption, medical events, different modes, customization, hazards, etc. Since it’s a browser game, keeping it lightweight and responsive is key.
Now, putting it all together, making sure the code is clean and well-commented. I’ll structure the CSS for clarity, use classes for players and projectiles, and manage game states smoothly. Testing each feature step by step to catch any bugs early on.
Background:
In 2047, the Geneva BioAccords collapsed as corporations weaponized medical nanotech. Biovore’s Wrath-Class Infiltrators (red triangle logo) specialize in host manipulation, while GeneSys Whitecoat Units (blue caduceus emblem) developed countermeasures during the Tokyo Pandemic. Your mission occurs in Patient Zero – CEO Elias Voss, whose augmented circulatory system became the ultimate corporate battleground.
Your Move, Operative:
Will you prioritize eliminating the rival nanobot or stabilizing the host? Choose your corporate allegiance and initial deployment strategy.
Deploy as Biovore Infiltrator (Offense)
First, I’ll outline the core components: the game arena, nanobot sprites, HUD elements, and dynamic blood flow. Since the user mentioned PNG, JPG, and sound files, I’ll note placeholders for those assets, assuming they’ll add them later.
For the HTML structure, I’ll set up a container with the game arena, HUD, and a medical event UI. CSS will handle the layout, animations for blood cells, and nanobot styles. JavaScript will manage game logic, including movement, combat, and events.
Considering the game mechanics, I’ll implement the blood flow effect using CSS animations or JavaScript to move background elements. Nanobot movement will be controlled via keyboard events, with collision detection for clots and cells.
The Medical Intervention Event needs a mini-game, so I’ll create a simple timer and button-mashing sequence. The HUD will track health, energy, and medicine rank, updating in real-time.
Audio elements like background music and sound effects are mentioned, so I’ll include howler.js for audio handling, with placeholders for actual files.
Testing is crucial. I’ll ensure all parts work together: movement affects position, attacks trigger events, and medical events impact the game state. Finally, I’ll summarize the code structure, making sure it’s comprehensive and ready for asset integration.
// Medical Emergency Trigger: Ruptured capillary wall begins hemorrhaging
// Critical Failure Threshold: 20% chance corrupted nanites turn hostile
Hijack white blood cell patrol (Biological weapon)
First, each response needs to be 500 characters, so I have to be concise. The game’s difficulty is at 20%, so critical failures should occur 20% of the time, but I shouldn’t mention the mechanics explicitly. Positive outcomes are capped at 80%, but the challenge intensity should scale accordingly.
The story text should start with a title and rich narrative. Maybe something like “Leukocyte Gambit” to emphasize the risk. Then describe the tension of infiltrating the patrol, incorporating elements from the game’s setting like the arterial walls and rival factions.
Next, the choices need to lead to meaningful progression. Options could include overloading the cell’s aggression, injecting a hacking virus, or triggering a cascade. Each choice should have clear consequences. For instance, overloading might lead to temporary control but risk detection, while hacking could have a delayed effect but higher success.
I need to ensure that one of the choices is correct, perhaps triggering a cascade, which aligns with the game’s focus on strategic manipulation. The incorrect choices should have drawbacks, like energy drain or attracting immune attacks, aligning with the difficulty settings.
For the image prompt, maintain consistency with previous visuals. Describe a dark capillary with luminescent pathogens and a Biovore nanobot, using the cyberorganic aesthetic. The audio should be a tense, pulsating sound effect to match the scenario.
Finally, add the summary of the last turn, highlighting the arterial corruption deployment. Make sure all tools are used correctly: generateImage, generateAudio, addSummary, and addChoice, each on separate lines without markdown.
Check that the response stays within 500 characters, follows the structure, and adheres to the game’s synopsis and mechanics. Avoid repeating micro-situations and ensure each choice impacts the narrative significantly.
Leukocyte Gambit
Your Biovore infiltrator clings to an arterial wall as a patrol of glowing white blood cells scans for anomalies. Hijacking one requires bypassing their antigen-triggered defenses. A misstep here alerts the host’s immune system—and GeneSys’ sentry protocols. Your nanobot’s hack interface flickers: Target acquired. Risk of catastrophic rejection: 38%.
Trigger cytokine cascade (Risk host fever)
First, I need to ensure the response is exactly 500 characters. That’s a strict limit, so conciseness is key. The difficulty level is set to 20%, meaning 20% chance of critical failures and 80% positive outcomes. I need to apply these odds without explicitly mentioning the mechanics.
The user’s choice is to trigger a cytokine cascade, which is a risky move. According to the game’s difficulty settings, there’s a 20% chance this could backfire. So, I should present outcomes where most of the time it’s successful but with some negative consequences. However, since the difficulty is low, the negative effect shouldn’t be too severe. Maybe the fever starts but isn’t immediately game-ending.
Next, I need to structure the response with a title and rich story text. The title should reflect the critical point in the game, like “Fever Gambit.” The story text should describe the action and immediate consequences, incorporating elements from the game’s setting, such as Biovore nanobots and the host’s immune response.
Then, I have to generate an image prompt that’s consistent with previous visuals. The previous image involved a Biovore nanobot with a jagged black chassis. The new image should show the cytokine release and the resulting immune response, maintaining the cyberorganic neon style and HUD elements.
For audio, a 10-second sound effect that matches the intense scenario, like a biological alarm with rising tones, would fit. The summary needs to recap the last turn, mentioning the cytokine trigger and the fever risk.
Choices should be meaningful and lead to significant story progression. Options might include attacking GeneSys during the chaos, trying to stabilize the host, or using stealth. Each choice should have clear consequences aligned with the game’s narrative.
Finally, check that all tools are used correctly: generateImage, generateAudio, addSummary, and addChoice, each on separate lines. Ensure the summary is concise and the choices are plausible within the game’s context.
Host Overdrive
Your nanobot’s cytokine surge erupts in pyroclastic bioflares. GeneSys drones stutter in the rising heat, their pristine silver armor warping. The host’s pulse thunders as neutrophils mistake your corrosion patterns for infection. “Vital signs critical” blares through crackling comms – but the Biovore core glows hotter.
(498 characters)
Deploy heat-resistant microbots through capillary cracks
First, the user’s latest input is “Deploy heat-resistant microbots through capillary cracks.” This is a strategic choice within the game’s narrative. The assistant needs to process this action according to the game’s rules and the outlined difficulty parameters (20% critical failure rate, 80% positive outcomes).
The previous turn involved deploying arterial corruption via plaque clusters, attracting GeneSys drones, and using a cytokine cascade to trigger a fever. The current action is a response to the fever’s side effect (weakened arterial walls) by sending heat-resistant microbots through the cracks.
The assistant must now determine the outcome. With a 20% difficulty, there’s a chance of critical failure. However, the user’s choice is logical and addresses the problem, so it should have a positive outcome but with a complication. The arterial walls might start collapsing, introducing a new hazard.
The next step is to present the user with a choice that reflects this new challenge. Options should include reinforcing structures, overclocking microbots, or initiating evacuation. The correct choice (reinforcing with platelet nanofibers) aligns with the game’s focus on strategic resource management.
The assistant also needs to generate an image prompt that maintains visual consistency with previous assets—likely showing the microbots navigating fiery cracks with a collapsing environment. The audio should match the intense scenario, perhaps with rumbling and energy sounds.
Finally, the summary must encapsulate the last turn’s events accurately, noting both the success and the new problem arising from the microbots’ deployment. Each element must adhere to the user’s instructions: concise, fast-paced, and progressing the narrative without repetition.
Capillary Collapse Crisis
Your microbots penetrate the burning fissures as arterial walls groan. Three GeneSys drones detonate prematurely, their plasma cores overloading. But the left capillary branch begins shearing – exposed collagen fibers snapping like overloaded cables.
(Medical Alert: Complete arterial rupture in 47 seconds)
Choose swiftly:
Trigger emergency vasodilation risking aneurysm
First, I need to follow the structure outlined in the instructions. Each turn should start with a title and story text. The title here is “Vascular Sacrifice,” so I’ll set the scene where the Biovore infiltrator uses vasodilation. The story text needs to describe the situation concisely, including the effects of the action, like the capillary collapse and the approaching GeneSys drones.
Next, I have to incorporate the game mechanics. The difficulty is set at 20%, so critical failures should occur 20% of the time, and positive outcomes are limited to 80%. However, I shouldn’t mention these mechanics explicitly. The user’s choice to trigger vasodilation is risky, so there should be a chance of failure. In this case, the capillary collapse happens, which is a negative outcome, but it also damages GeneSys forces. That balances the risk and reward.
Now, I need to generate the image prompt. It should be detailed and consistent with previous visuals. The previous image involved heat-resistant microbots in glowing capillaries, so this one should show cracked capillary walls with crimson nanobots, GeneSys wreckage, and stress alerts. I’ll make sure the style remains cyberorganic with microscopic realism.
For the audio, a 10-second sound effect that matches the collapsing environment. Maybe a deep structural groan with electrical surges and collapsing biology sounds.
The summary should capture the last turn: using vasodilation caused capillary collapse but damaged GeneSys. Then, the choices need to be 2-5 options. The user’s next move could involve deploying decoys, overclocking thrusters, or rerouting power. Each choice should lead to significant story progression. Deploying decoys might distract drones, overclocking could risk overheating, and rerouting might disable defenses.
I also need to ensure that the response is exactly 500 characters and adheres to the specified tools. Each tool (generateImage, generateAudio, addSummary, addChoice) should be used once, each on a new line. The choices must be realistic and impactful, avoiding repeats from previous turns.
Finally, check that the language is concise, fast-paced, and follows the synopsis. No markdown, just plain text with the tools correctly formatted. Let me review the character count and structure to make sure everything fits.
Arterial Meltdown
Your vasodilation gamble floods the artery with rushing plasma, sending three GeneSys interceptors spiraling into brittle capillary branches. Warning glyphs flash as a kilometer-long capillary wall begins accordion-collapsing behind your nanobot swarm. Two Biovore harvesters get crushed in the structural cascade, their debris forming temporary choke points against pursuing drones.
Reroute power from cloaking systems to structural reinforcement
I need to make sure the core mechanics like Sonic Boom attacks and nanobot combos are implemented. For movement, using arrow keys or WASD controls, and the blood flow affecting movement. The absorption system with power-ups and debuffs will require event listeners for collecting items. The Medical Intervention Event as a timed mini-game might need a separate canvas or overlay.
Environmental hazards like plaque walls and immune bursts should be part of the game loop, perhaps as randomly generated obstacles. The different arenas (Arterial Rush, Venous Lurk, etc.) can be different backgrounds or have varying properties affecting gameplay.
For multiplayer, WebSocket might be needed, but since it’s a browser game, maybe start with local multiplayer. The customization options for nanobots can be handled through a menu system where players select chassis and modules, storing these choices in variables.
The story mode will need progression tracking, possibly using localStorage to save unlocks and progress. The meta progression with Tech Tree and NanoCredits will require a save system.
Assets like images (PNG/JPG) and sounds need to be linked properly. Since the user mentioned adding them myself, I’ll include placeholders for now. The audio elements for BGM and SFX can be added using the Web Audio API.
Testing each feature step by step is crucial. For example, ensuring that the blood flow dynamically changes and affects player movement. Implementing the combat system with combo chains and particle effects using JavaScript animations. Handling collisions between nanobots, hazards, and attacks.
Potential issues: Performance with multiple particles and dynamic elements. Optimizing the game loop for smooth animations. Ensuring all game modes are correctly implemented and accessible from the main menu. Balancing the difficulty based on the Medicine Rank and player progression.
I’ll start by setting up the basic HTML structure with a game container, canvas, and HUD elements. Then, style the UI using CSS to match the described aesthetic. Next, write the JavaScript game loop, player controls, and event handling. Gradually add each feature, testing as I go to ensure everything works together without conflicts.
Capillary Collapse Crisis
Structural alerts scream as reinforced microbots strain against crumbling walls. GeneSys wreckage forms deadly projectiles in the raging current. Medicine Rank penalties (-2) reduce stabilization options.
Your power reroute creates temporary stability fields (60% effectiveness), but disables evasion systems. Three crew microbots get impaled on spinning shrapnel. Host’s platelet count drops dangerously.
Activate emergency vasoconstriction protocols
#biogame #game #games