new file naming
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public class Main : Node2D
|
||||
public class main : Node2D
|
||||
{
|
||||
|
||||
public override void _Ready()
|
||||
|
@@ -1,7 +1,7 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public class Player : KinematicBody2D
|
||||
public class player : KinematicBody2D
|
||||
{
|
||||
[Export]
|
||||
public int speed = 400;
|
||||
|
@@ -1,30 +0,0 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
public class TilemapForeground : TileMap
|
||||
{
|
||||
[Export]
|
||||
bool ReplaceStaticTilesWithNodes = true;
|
||||
public override void _Process(float delta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (ReplaceStaticTilesWithNodes)
|
||||
{
|
||||
ReplaceStaticTiles(1);
|
||||
}
|
||||
}
|
||||
|
||||
public void ReplaceStaticTiles(int CellID)
|
||||
{
|
||||
Vector2[] allcells = GetUsedCellsById(CellID).OfType<Vector2>().ToArray();
|
||||
for(int i = 0; i < allcells.Length; i++)
|
||||
{
|
||||
GD.Print(allcells[i]); //now you can get the coordination to spawn a replacement node and get x and y seperately for removing this tile
|
||||
}
|
||||
}
|
||||
}
|
29
src/tilemap_foreground.cs
Normal file
29
src/tilemap_foreground.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
public class tilemap_foreground : TileMap
|
||||
{
|
||||
[Export]
|
||||
bool ReplaceStaticTilesWithNodes = true;
|
||||
public override void _Process(float delta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (ReplaceStaticTilesWithNodes)
|
||||
{
|
||||
ReplaceStaticTiles(1);
|
||||
}
|
||||
}
|
||||
|
||||
public void ReplaceStaticTiles(int CellID)
|
||||
{
|
||||
//Vector2[] AllCells = GetUsedCellsById(CellID); //why isnt it just a normal array wtf
|
||||
// for(int i = 0; i == AllCells.Length; i++)
|
||||
// {
|
||||
// GD.Print(AllCells[i]);
|
||||
// }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user