-
Notifications
You must be signed in to change notification settings - Fork 199
/
3d_iso.rs
40 lines (35 loc) · 1.22 KB
/
3d_iso.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use bevy::prelude::*;
use bevy_ecs_tilemap::prelude::*;
mod helpers;
fn startup(mut commands: Commands, asset_server: Res<AssetServer>) {
commands.spawn(Camera2dBundle::default());
let map_handle: Handle<helpers::tiled::TiledMap> = asset_server.load("iso_map.tmx");
commands.spawn(helpers::tiled::TiledMapBundle {
tiled_map: map_handle,
render_settings: TilemapRenderSettings {
// Map size is 12x12 so we'll have render chunks that are:
// 12 tiles wide and 1 tile tall.
render_chunk_size: UVec2::new(3, 1),
y_sort: true,
},
..Default::default()
});
}
fn main() {
App::new()
.add_plugins(
DefaultPlugins
.set(WindowPlugin {
primary_window: Some(Window {
title: String::from("3D Isometric Example"),
..Default::default()
}),
..default()
})
.set(ImagePlugin::default_nearest()),
)
.add_plugins((TilemapPlugin, helpers::tiled::TiledMapPlugin))
.add_systems(Startup, startup)
.add_systems(Update, helpers::camera::movement)
.run();
}