| 129 | } |
| 130 | |
| 131 | pub fn draw_state_normal(&self) { |
| 132 | draw_texture_ex( |
| 133 | self.texture, |
| 134 | self.pos.x, |
| 135 | self.pos.y, |
| 136 | WHITE, |
| 137 | DrawTextureParams { |
| 138 | //dest_size: Some(vec2(screen_width(), screen_height())), |
| 139 | ..Default::default() |
| 140 | }, |
| 141 | ); |
| 142 | |
| 143 | let decoy_frame_index = ((self.shoot_timer / PLAYER_SHOOT_TIME) * 3f32) as i32; |
| 144 | |
| 145 | draw_texture_ex( |
| 146 | self.bullet_decoy_texture, |
| 147 | self.pos.x + 3., |
| 148 | self.pos.y - 1., |
| 149 | WHITE, |
| 150 | DrawTextureParams { |
| 151 | source: Some(Rect::new( |
| 152 | self.bullet_decoy_texture.width() / 3f32 * decoy_frame_index as f32, |
| 153 | 0f32, |
| 154 | self.bullet_decoy_texture.width() / 3f32, |
| 155 | self.bullet_decoy_texture.height(), |
| 156 | )), |
| 157 | ..Default::default() |
| 158 | }, |
| 159 | ); |
| 160 | } |
| 161 | |
| 162 | pub fn draw_state_invisible(&self, time_left: &f32) { |
| 163 | let anim_frames = 7f32; |