mirror of
https://git.kittycat.homes/zoe/codename-routes.git
synced 2024-08-15 03:18:26 +00:00
fucking signals, how do they work
This commit is contained in:
parent
bcd4a1b031
commit
9d9348faca
6 changed files with 10 additions and 16 deletions
|
@ -39,8 +39,8 @@ impl StateServer {
|
|||
}
|
||||
|
||||
#[export]
|
||||
fn generate_world(&self, _owner: &Node) {
|
||||
let mut new_world = world::World::new(3, 3, 3);
|
||||
fn generate_world(&self, _owner: &Node, xsize: usize, ysize: usize, zsize: usize) {
|
||||
let mut new_world = world::World::new(xsize, ysize, zsize);
|
||||
new_world.generate();
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,6 @@ impl StateServer {
|
|||
// signals
|
||||
impl StateServer {
|
||||
fn register(builder: &ClassBuilder<StateServer>) {
|
||||
builder.signal("jumpled").done();
|
||||
builder
|
||||
.signal("changed_tile")
|
||||
.with_param("position", VariantType::Vector3)
|
||||
|
|
|
@ -11,18 +11,15 @@ pub struct World {
|
|||
|
||||
impl World {
|
||||
pub fn generate(&mut self) {
|
||||
let mut tiles = get_vec3(self.xsize, self.ysize, self.zsize);
|
||||
godot_print!("{:#?}", tiles);
|
||||
self.tiles = get_vec3(self.xsize, self.ysize, self.zsize);
|
||||
for x in 0..self.xsize {
|
||||
for y in 0..self.ysize {
|
||||
for z in 0..self.zsize {
|
||||
let tile = tiles::Tile::new(tiles::Tiletypes::Dirt);
|
||||
tiles[x][y][z] = tile;
|
||||
self.tiles[x][y][z] = tile;
|
||||
}
|
||||
}
|
||||
}
|
||||
self.tiles = tiles;
|
||||
godot_print!("{:?}", self.tiles);
|
||||
}
|
||||
pub fn new(xsize: usize, ysize: usize, zsize: usize) -> World {
|
||||
World {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue