T
Tempus
Guest
Hello together
I try to place a tilemap in GML in game maker 2 but I can’t figure it out how to program it. I read the docs for game maker 2 but I it doesn´t help me.
I have programed a random dungeon with a ds_grid.
The ds_grid looks like
000000
011110
000010
011110
000000
1 -> wall => object on separate layer (I have made an obj_wall)
0 -> floor => tile on separate layer (I have made a tileset with 2*5 different tiles)
Tiles and obj_wall are 32*24 Pixels
Now i go through the ds_grid with a for next loop.
If it is a floor
· take a tile form the tileset (a tile from tileset position 2; 3).
· multiply the position on the ds_grid with the height and width of the tile.
· Place the tile on the layer for the floor
If it is a wall
· Take the obj_wall
· multiply the position on the ds_grid with the height and width of the obj_wall.
· Place the tile on the layer for the wall.
Can you give me a code example how to create the layers and place a specific tile on the tile_layer in GML?
Thanks
I try to place a tilemap in GML in game maker 2 but I can’t figure it out how to program it. I read the docs for game maker 2 but I it doesn´t help me.
I have programed a random dungeon with a ds_grid.
The ds_grid looks like
000000
011110
000010
011110
000000
1 -> wall => object on separate layer (I have made an obj_wall)
0 -> floor => tile on separate layer (I have made a tileset with 2*5 different tiles)
Tiles and obj_wall are 32*24 Pixels
Now i go through the ds_grid with a for next loop.
If it is a floor
· take a tile form the tileset (a tile from tileset position 2; 3).
· multiply the position on the ds_grid with the height and width of the tile.
· Place the tile on the layer for the floor
If it is a wall
· Take the obj_wall
· multiply the position on the ds_grid with the height and width of the obj_wall.
· Place the tile on the layer for the wall.
Can you give me a code example how to create the layers and place a specific tile on the tile_layer in GML?
Thanks