MCPcopy Create free account
hub / github.com/FrameworkComputer/inputmodule-rs / new

Method new

fl16-inputmodules/src/games/snake.rs:30–38  ·  view source on GitHub ↗
(random: u8)

Source from the content-addressed store, hash-verified

28
29impl SnakeState {
30 pub fn new(random: u8) -> Self {
31 SnakeState {
32 head: (4, 0),
33 direction: HeadDirection::Down,
34 body: Vec::new(),
35 game_over: false,
36 food: place_food(random),
37 }
38 }
39 pub fn tick(&mut self, random: u8) {
40 if self.game_over {
41 return;

Callers

nothing calls this directly

Calls 1

place_foodFunction · 0.85

Tested by

no test coverage detected