Skip to content

Commit

Permalink
Update _index.md
Browse files Browse the repository at this point in the history
Updated Getting Started docs to match the change at bevyengine/bevy#6247 and replace from_seconds(time, bool) with from_seconds(time, TimerMode)
  • Loading branch information
jackbackes authored Nov 12, 2022
1 parent bd4f611 commit bc0fe6d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions content/learn/book/getting-started/resources/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,11 @@ fn greet_people(
}
```

Now all that's left is adding a `GreetTimer` Resource to our `HelloPlugin`:
Now all that's left is adding a `GreetTimer` Resource to our `HelloPlugin`. Use `TimerMode::Repeating` to make the timer repeat.
```rs
impl Plugin for HelloPlugin {
fn build(&self, app: &mut App) {
// the reason we call from_seconds with the true flag is to make the timer repeat itself
app.insert_resource(GreetTimer(Timer::from_seconds(2.0, true)))
app.insert_resource(GreetTimer(Timer::from_seconds(2.0, TimerMode::Repeating)))
.add_startup_system(add_people)
.add_system(greet_people);
}
Expand Down

0 comments on commit bc0fe6d

Please sign in to comment.