removed window management and added coordinate debug key

This commit is contained in:
2022-11-13 01:04:35 +01:00
parent b8e6fe9426
commit 69c8e437b8
6 changed files with 81 additions and 20 deletions

View File

@@ -1,19 +1,12 @@
using Godot;
using System;
using System.Diagnostics;
public class Main : Node2D
{
// Declare member variables here. Examples:
// private int a = 2;
// private string b = "text";
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
//window management
OS.WindowMaximized = OS.IsDebugBuild();
OS.WindowFullscreen = !OS.IsDebugBuild();
}
public override async void _Process(float delta)

View File

@@ -4,7 +4,6 @@ using System;
public class Player : KinematicBody2D
{
private Vector2 velocity;
[Export]
public int speed = 400;
@@ -13,7 +12,7 @@ public class Player : KinematicBody2D
GetInput();
MoveAndCollide(velocity * delta);
}
public void GetInput()
{
velocity = new Vector2();
@@ -35,5 +34,14 @@ public class Player : KinematicBody2D
}
}
public override async void _Process(float delta)
{
//player coordinates on foregroundgrid
var coordinates = GetNode<TileMap>("/root/Main/World/Foreground").WorldToMap(Position);
if (Input.IsKeyPressed((int)KeyList.F3))
{
GD.Print(coordinates);
}
}
}