|
|
@ -42,27 +42,18 @@ pub struct EntState<'a> {
|
|
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
fn main() {
|
|
|
|
|
|
|
|
|
|
|
|
let loader = Loader::new();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let loader = Loader::new();
|
|
|
|
let mut state = EntState {
|
|
|
|
let mut state = EntState {
|
|
|
|
dynamic_entities: Rc::new(RefCell::new(Vec::new())),
|
|
|
|
dynamic_entities: Rc::new(RefCell::new(Vec::new())),
|
|
|
|
static_entities: Rc::new(RefCell::new(Vec::new()))
|
|
|
|
static_entities: Rc::new(RefCell::new(Vec::new()))
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
loader.read_static_entities(String::from("static_entities.txt"), &state);
|
|
|
|
let mut state_borrow = &state;
|
|
|
|
|
|
|
|
loader.read_static_entities(String::from("static_entities.txt"), state_borrow);
|
|
|
|
|
|
|
|
}
|
|
|
|
state.dynamic_entities.borrow_mut().push(Sprite::new());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// sp.set_texture(&spritesheet_text, false);
|
|
|
|
|
|
|
|
// sp.set_texture_rect(&util::grab_sheet_rec(String::from("blockBrown.png"), &spritesheet_desc));
|
|
|
|
|
|
|
|
// sp.set_position((64.0, 64.0));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
// let mut block_sprite2 = Sprite::new();
|
|
|
|
|
|
|
|
// block_sprite2.set_texture(&spritesheet_text, false);
|
|
|
|
|
|
|
|
// block_sprite2.set_texture_rect(&util::grab_sheet_rec(String::from("blockBrown.png"), &spritesheet_desc));
|
|
|
|
|
|
|
|
// block_sprite2.set_position((128.0, 64.0));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let static_sprites: Vec<(&Sprite, AABB<f64>)> = vec![
|
|
|
|
let static_sprites: Vec<(&Sprite, AABB<f64>)> = vec![
|
|
|
|
// (
|
|
|
|
// (
|
|
|
@ -101,7 +92,7 @@ fn main() {
|
|
|
|
// sprite.set_texture_rect(&util::grab_sheet_rec(String::from("playerBlue_stand.png"), &spritesheet_desc));
|
|
|
|
// sprite.set_texture_rect(&util::grab_sheet_rec(String::from("playerBlue_stand.png"), &spritesheet_desc));
|
|
|
|
|
|
|
|
|
|
|
|
let mut window = RenderWindow::new(
|
|
|
|
let mut window = RenderWindow::new(
|
|
|
|
(500, 500),
|
|
|
|
(512, 512),
|
|
|
|
"Custom drawable",
|
|
|
|
"Custom drawable",
|
|
|
|
Style::CLOSE,
|
|
|
|
Style::CLOSE,
|
|
|
|
&Default::default(),
|
|
|
|
&Default::default(),
|
|
|
@ -183,6 +174,11 @@ fn main() {
|
|
|
|
window.draw(&player);
|
|
|
|
window.draw(&player);
|
|
|
|
window.draw(&collision_sprite);
|
|
|
|
window.draw(&collision_sprite);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for ent in state.static_entities.borrow().iter() {
|
|
|
|
|
|
|
|
window.draw(ent);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if interferences.len() == 0 {
|
|
|
|
if interferences.len() == 0 {
|
|
|
|
// window.draw(&block_sprite);
|
|
|
|
// window.draw(&block_sprite);
|
|
|
|
// window.draw(&block_sprite2);
|
|
|
|
// window.draw(&block_sprite2);
|
|
|
|