new file naming

This commit is contained in:
2022-11-15 18:18:01 +01:00
parent 84f1d48766
commit f00b24274d
9 changed files with 50 additions and 50 deletions

View File

@@ -1,7 +1,7 @@
using Godot;
using System;
public class Main : Node2D
public class main : Node2D
{
public override void _Ready()

View File

@@ -1,7 +1,7 @@
using Godot;
using System;
public class Player : KinematicBody2D
public class player : KinematicBody2D
{
[Export]
public int speed = 400;

View File

@@ -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
View 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]);
// }
}
}