
Bevy App Resources
Bevy ECS skill for app-wide resources and schedules.
Install
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill bevy-app-resources -g -a claude-code -y- Repository
- thedivergentai/Game-Dev-Agentic-Skills917
- Category
- Engineering
- Updated
- 19d ago
- License
- LGPL-3.0
- Context cost
- Mediumabout 2,183 tokens
- Runs scripts
- No, instructions only
What it does
Bevy ECS skill for app-wide resources and schedules. Keywords: Bevy, Resource, App, Schedule, Plugin.
Bevy app resources
When to use
Load this when data or logic must exist for the whole app: one clock, one ruleset, startup spawn, or an ordered pair of systems. Pair with bevy-data-resources for the component-versus-resource split.
ECS shape
- App. The Apps page: an
Appcontains aWorldand the outer loop. It initializes resources (one copy), adds systems to aSchedule, and imports otherAppchanges through plugins. - Resources.
Resource,Res,ResMut, andinsert_resource(Resources page).Timearrives fromadd_plugins(DefaultPlugins). - Plugins. The Resources page implements
Pluginand inserts the resource insidebuild.DefaultPluginsis the plugin set that addsTime. Name only the plugins this page documents. - Schedules.
add_systems(Startup, ...)runs once before other systems.add_systems(Update, ...)is the repeating schedule in the ECS page..chain()orders systems that must see each other's writes.bevy::ecs::messagenamesFixedUpdateonly as the schedule after whichsignal_message_update_systemruns. Fixed-timestep clock types stay in bevy-character-movement. - States. App-wide modes are
bevy::state, not a global node. See bevy-state-machines.
App choices
| Need | Bevy idiom |
|---|---|
| One copy for the whole app | A Resource inserted on the App |
| Logic that ticks every frame | A system on Update (or a chained pair) |
| Boot setup | A Startup system or insert_resource in a Plugin |
| One-shot notice | A message or event. See bevy-events-messaging. |
Scope
- Insert app-wide data with
insert_resourceinsidePlugin::build, or from aStartupsystem. - Order two systems that both mutably use the same resource with
.chain(). - Save files are a
Resourceyou serialize yourself. The running copy stays in theWorld.
Examples
[package]
name = "app_resources"
version = "0.1.0"
edition = "2021"
[dependencies]
bevy = "0.20"
