MCPcopy Create free account
hub / github.com/TanTanDev/rusty_demon_attack / new

Method new

src/player.rs:32–47  ·  view source on GitHub ↗
(
        pos: Vec2,
        texture: Texture2D,
        bullet_decoy_texture: Texture2D,
        texture_explotion: Texture2D,
    )

Source from the content-addressed store, hash-verified

30
31impl Player {
32 pub fn new(
33 pos: Vec2,
34 texture: Texture2D,
35 bullet_decoy_texture: Texture2D,
36 texture_explotion: Texture2D,
37 ) -> Self {
38 Player {
39 pos,
40 texture,
41 bullet_decoy_texture,
42 texture_explotion,
43 shoot_timer: 0f32,
44 collision_rect: Rect::new(pos.x, pos.y, 7.0f32, 6.0f32),
45 state: PlayerState::Normal,
46 }
47 }
48
49 pub fn reset(&mut self, resources: &Resources) {
50 let player_spawn_y =

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected