removed window management and added coordinate debug key
This commit is contained in:
@@ -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)
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user