2020-01-09 16:23:20 +00:00
|
|
|
use super::utils::*;
|
2020-03-14 21:17:27 +00:00
|
|
|
use crate::{
|
|
|
|
comp::StateUpdate,
|
2020-12-01 00:28:00 +00:00
|
|
|
states::behavior::{CharacterBehavior, JoinData},
|
2020-03-14 21:17:27 +00:00
|
|
|
};
|
2020-07-06 14:23:08 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2019-12-26 14:43:59 +00:00
|
|
|
|
2020-03-07 19:55:15 +00:00
|
|
|
// const BLOCK_ACCEL: f32 = 30.0;
|
|
|
|
// const BLOCK_SPEED: f32 = 75.0;
|
2020-01-07 15:49:08 +00:00
|
|
|
|
2020-03-14 21:17:27 +00:00
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)]
|
|
|
|
pub struct Data;
|
2019-12-26 14:43:59 +00:00
|
|
|
|
2020-03-14 21:17:27 +00:00
|
|
|
impl CharacterBehavior for Data {
|
|
|
|
fn behavior(&self, data: &JoinData) -> StateUpdate {
|
2020-03-21 21:16:26 +00:00
|
|
|
let mut update = StateUpdate::from(data);
|
2020-02-24 19:57:33 +00:00
|
|
|
|
2020-03-26 19:02:01 +00:00
|
|
|
handle_move(&data, &mut update, 0.4);
|
2020-03-14 21:17:27 +00:00
|
|
|
|
|
|
|
update
|
2019-12-26 14:43:59 +00:00
|
|
|
}
|
|
|
|
}
|