Skip to content
AI-powered appsNewChat, vision, voice, generationBookings & schedulingAppointments that book themselvesShops & sellingA storefront in every pocketClient & businessRun the operation from one placeCommunities & clubsA home that is not a group chat
Health & wellnessHabits, tracking and calmGames2D, 3D and multiplayerPersonal & toolsThe tool you wish existedInternal toolsThe tool ops never had time for
See all use cases
ArcadeNewPricingSecurity
EngineThe game engine and World EditorHow it worksFrom one sentence to a live productDocsGuides for building and publishingBlogStories, guides and newsChangelogWhat shipped latelyStatusUptime of every serviceSupportGet help from the team
AI-powered appsBookings & schedulingShops & sellingClient & businessCommunities & clubsHealth & wellnessGamesPersonal & toolsInternal tools
See all use cases
ArcadeNewPricingSecurity
EngineHow it worksDocsBlogChangelogStatusSupport
Language
Blog
Game mechanicsNovember 22, 20266 min read

How to Add a Stamina System

Stamina turns running, dodging and attacking into a budget. Here are the numbers that make it a decision instead of a nag.

Startbase Team
Editorial ink illustration of a brass hourglass tipped beside worn running shoes, the pouring sand in ember orange

Key takeaways

  • Stamina is a budget for actions: a max of 100, costs of 10 to 25 per action, and regen of 25 to 40 per second after a 0.5 to 1 second delay.
  • Exhaustion at zero needs a penalty and a restart threshold, or sprint flickers on and off every frame.
  • If players spend most of the game waiting for the bar, the costs are too high or the regen too slow. Stamina should bite in fights, not on walks.

A stamina system gives the player a shared pool, usually 100 points, that actions like sprinting, dodging, attacking and blocking spend from, and that refills after a short pause when the player stops spending. It works when it forces a choice in tense moments (dodge now or save it for the next swing) and fails when it simply slows the player down between fights. The values below are starting points that land on the right side of that line.

The core loop: spend, wait, refill

Every stamina system has the same four parts. Each has a number, and each number changes how the game feels:

  1. 01Max stamina: 100. Use 100 even if you never show the number. It makes costs read as percentages when you tune them.
  2. 02Costs. Instant actions take a chunk (dodge 20 to 25, light attack 10 to 15, heavy attack 25 to 35, jump 5 to 10 if it costs at all). Held actions drain per second (sprint 15 to 25 per second, block 5 to 10 per second plus a chunk per blocked hit).
  3. 03Regen delay: 0.5 to 1 second after the last spend. This is the most important number. Without it, players spam actions at the regen rate; with too long a delay, the game feels sluggish.
  4. 04Regen rate: 25 to 40 per second. A full bar refills in roughly 2.5 to 4 seconds from empty. Faster suits arcade games, slower suits deliberate combat.

Run the arithmetic for your design before you build. With sprint at 20 per second, a full bar gives 5 seconds of sprinting. Is that enough to cross the arena? With dodge at 25, the player gets four dodges back to back. Is a boss combo longer than four attacks? Those two questions catch most bad stamina tuning on paper.

Exhaustion: what happens at zero

The moment the bar empties is where stamina gets its teeth. There are two common designs:

  • Soft floor. Any action is allowed if stamina is above zero, even if it costs more than what is left, and the bar simply hits zero. Generous and fluid. Many action games do this so the last dodge always comes out.
  • Hard floor. An action needs its full cost available. Strict and readable, but it can feel like the game ate an input.

Either way, hitting zero should trigger an exhausted state: the regen delay grows (1.5 to 2 seconds instead of 0.75), sprinting is locked until stamina climbs back to a threshold (25 to 35 percent), and the character shows it, with a slower walk, a panting animation, a breath sound and a bar that changes color. That threshold is not optional. Without it, a held sprint button drains to zero, regenerates one frame of stamina, sprints for one frame, and flickers forever.

Tip

Make the exhausted state visible on the character, not only on the bar. In a fight, players are watching their character and the enemy, never the corner of the screen.

Showing it

  • Near the character, or right under health. Action games often float a small arc or bar beside the character and hide it when full. A HUD bar works if it sits directly below health with a distinct color (green or yellow is conventional) and a thinner height.
  • Hide when full. Fade the bar out 1 to 2 seconds after it fills. It reappears the moment the player spends.
  • Preview the cost. On a dodge, flash the part of the bar about to be spent. It teaches costs without a tutorial.
  • Flash the bar on a failed action. If the player presses dodge without enough stamina, flash the bar and play a dull sound so the missing dodge is explained, not mysterious.

The chip bar technique from health bars works here too, but shorter: a 0.2 second hold, then a quick drain. See our HUD guide for placement.

Variants by genre

  • Melee action: attacks, dodges and blocks share one pool. This is where stamina creates the rhythm of attack, back off, recover. Enemies that pressure the player during regen make it tense.
  • Exploration and platforming: stamina covers climbing, gliding or swimming. Drain per second while hanging (10 to 15), more while climbing up, and put rest spots on long walls. This variant is about route planning, not reflexes.
  • Survival: max stamina itself is reduced by hunger, cold or injury, so the survival game meters feed into it. A starving character has a bar capped at 60.
  • Sports: sprint stamina per player creates the choice between pressing now and having legs at the end. Usually refills slowly and only partly during play.
  • Shooters: stamina usually only covers sprint and maybe a slide, and is often hidden. Players feel it as a run that ends.

Bugs and edge cases

  • Frame rate dependence. Drain and regen must multiply by the frame time (`stamina -= drainPerSecond × dt`). Code that subtracts a fixed amount per frame drains twice as fast on a 120 Hz phone as on a 60 Hz laptop.
  • Sprint without movement. Holding sprint while standing still or pushing into a wall should not drain. Drain only when actually moving faster than walk speed.
  • Regen during actions. Regen should stay paused for the whole action, including its animation, not only the frame it started. Otherwise long attacks regenerate halfway through.
  • Pause and menus. Opening the pause menu or inventory must freeze stamina. Easy to miss when the regen runs on a timer outside the game loop.
  • Restoring a save. Save stamina or reset it to full on load; never leave it at whatever value the object was created with, which is often zero.
  • Buffered inputs at zero. If the game buffers a dodge press for 0.1 seconds (a good idea), check stamina when the dodge fires, not when it was pressed.

How stamina combines with other systems

Stamina connects to almost everything in an action game. Power-ups can grant a few seconds of infinite stamina, a strong and easily read reward. Upgrades raise max stamina or lower costs (a 10 percent cost cut is very noticeable). Equipment weight can scale costs, which turns inventory choices into movement choices. Enemy design should account for it: an enemy with a five-hit combo against a player with four dodges is a designed problem; make sure blocking or spacing solves it. And difficulty settings can tune stamina directly: an easier mode with 30 percent faster regen is a gentle assist. Our difficulty curve guide covers how to present options like that.

When not to add stamina

Stamina is friction. In a platformer about precise jumps, a stamina cost on jumping only punishes the player for playing. In an arcade shooter, a sprint meter that empties while crossing an empty screen adds nothing. The test: in your game's tensest moment, does stamina create a choice? If the answer is only 'it makes me wait', remove it or put it only on the actions that need a cost.

A brief to paste

Add a stamina system to my top-down action game. Max 100. Sprint drains 20 per second only while moving; dodge roll costs 25; light attack 12; heavy attack 30. Regen 35 per second after a 0.75 s pause from the last spend, paused for the whole duration of an action. Soft floor: any action works if stamina is above 0. Hitting 0 makes the hero exhausted for 1.5 s: slower walk, panting sound, bar turns orange, and sprint stays locked until the bar is back to 30. Show stamina as a thin yellow bar under health that fades out 1.5 s after filling, flashes the cost on use, and flashes red with a dull thud if an action is refused. All drain and regen use frame time. Expose max, each cost, delay, regen and the exhausted threshold as dials.

On Startbase, the dials land in the game's engine panel (see the games template docs), so you can fight the same enemy three times with three regen rates in a couple of minutes and keep the one that feels like a decision.

Frequently asked questions

How fast should stamina regenerate?

A common starting point is 25 to 40 points per second out of 100, after a pause of 0.5 to 1 second since the last action. That refills an empty bar in roughly three seconds.

Should jumping cost stamina?

Only if jumping is a combat or survival decision in your game. In platformers about movement, a jump cost usually just feels like punishment.

Why does sprint flicker on and off when stamina runs out?

The game re-enables sprint as soon as a tiny amount regenerates. Add an exhausted state that locks sprint until stamina climbs back to around 25 to 35 percent.

On this page

  • The core loop: spend, wait, refill
  • Exhaustion: what happens at zero
  • Showing it
  • Variants by genre
  • Bugs and edge cases
  • How stamina combines with other systems
  • When not to add stamina
  • A brief to paste

Keep reading

More in Game mechanics
Editorial ink illustration of a wooden toy figure in mid-air above a gap, the puff cloud under its feet in ember orange
Game mechanicsNovember 22, 2026

How to Add a Double Jump to Your Game

A double jump is one counter and one reset rule, but the details decide whether it feels like control or like cheating. Here are the values and the bugs to watch for.

8 min read
Editorial ink illustration of a small figure streaking along a stone floor with faded ghost copies behind it, the front figure's scarf in ember orange
Game mechanicsNovember 22, 2026

How to Add a Dash Move

A dash is a short burst of fixed speed that overrides normal movement. Get its distance, its ending and its refill rule right and it becomes the move players use most.

7 min read

Read less. Ship more.

Everything in this post is one prompt away. Describe your app and watch it build.

Start building

Apps, games, backends and publishing from one conversation.

Product

  • Features
  • Use cases
  • Pricing
  • Changelog

Resources

  • Blog
  • Docs
  • Support
  • Status
  • Security

Contact

  • w@startbase.ai
  • X / Twitter
  • LinkedIn
  • Instagram

Legal

  • Terms
  • Privacy

© 2026 Startbase. All rights reserved.