change player scale

This commit is contained in:
TudbuT 2024-11-24 10:29:07 +01:00
parent 4a17dd2e25
commit 040866718c
No known key found for this signature in database
GPG key ID: B3CF345217F202D3

View file

@ -1,7 +1,12 @@
use std::{any::Any, hash::Hash, time::Duration};
use animation::{run_animations, AnimBundle, Animation};
use bevy::{ecs::system::SystemId, prelude::*, sprite::MaterialMesh2dBundle, utils::HashMap};
use bevy::{
ecs::system::SystemId,
prelude::*,
sprite::{Anchor, MaterialMesh2dBundle},
utils::HashMap,
};
use bevy_rapier2d::prelude::*;
@ -158,11 +163,11 @@ fn add_player(
asset_server: Res<AssetServer>,
player_coords: Res<PlayerCoords>,
) {
let tex_idle = asset_server.load("idle.png");
let tex_idle = asset_server.load("idle_egg.png");
let layout_idle = TextureAtlasLayout::from_grid(UVec2::splat(512), 2, 1, None, None);
let layout_idle_handle = texture_atlas_layouts.add(layout_idle);
let tex_walk = asset_server.load("walk.png");
let tex_walk = asset_server.load("walk_egg.png");
let layout_walk = TextureAtlasLayout::from_grid(UVec2::splat(512), 4, 1, None, None);
let layout_walk_handle = texture_atlas_layouts.add(layout_walk);
@ -185,7 +190,7 @@ fn add_player(
},
SpriteBundle {
sprite: Sprite {
custom_size: Some(Vec2::splat(1.)),
custom_size: Some(Vec2::splat(1.3)),
..Default::default()
},
transform: (*player_coords).into(),