lots of bugfixes
This commit is contained in:
@@ -36,7 +36,8 @@ public partial class dialog_bubble : CanvasLayer
|
||||
|
||||
if (parsedDlg.AsGodotDictionary()["dialogType"].AsString() != "villager" || introducedVillager)
|
||||
GetNode<Label>("box/name_label").Text = title;
|
||||
if (GetParent().Name == "player") player.allowMovement = false;
|
||||
|
||||
player.allowMovement = false;
|
||||
|
||||
//Get first key
|
||||
if (parsedDlg.AsGodotDictionary()["dialogType"].AsString() == "villager")
|
||||
|
@@ -26,9 +26,10 @@ public partial class player : CharacterBody2D
|
||||
}
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
if (allowMovement) movement = Input.GetVector("move_left", "move_right", "move_up", "move_down");
|
||||
if (allowMovement)
|
||||
movement = Input.GetVector("move_left", "move_right", "move_up", "move_down");
|
||||
else movement = Vector2.Zero;
|
||||
if (movement.Length() != 0) rotCenter.Rotation = new Vector2((float)Math.Round(movement.X, 0), (float)Math.Round(movement.Y, 0)).Angle();
|
||||
if (Math.Round(movement.Length(), 0) != 0) rotCenter.Rotation = new Vector2((float)Math.Round(movement.X, 0), (float)Math.Round(movement.Y, 0)).Angle();
|
||||
MoveAndCollide(movement * speed * 200 * (float)delta);
|
||||
}
|
||||
public override void _Process(double delta)
|
||||
@@ -36,6 +37,7 @@ public partial class player : CharacterBody2D
|
||||
if (Input.IsActionJustPressed("ui_accept") && dialogRayCast.IsColliding() && allowMovement)
|
||||
GetNode<dialog_bubble>("dialog_bubble").GetDialog(dialogRayCast.GetCollider().Get("file").AsString(), (Area2D)dialogRayCast.GetCollider());
|
||||
|
||||
|
||||
//animation system (with controller support wich cant get normalized vector)
|
||||
if (allowMovement == false)
|
||||
{
|
||||
@@ -63,6 +65,10 @@ public partial class player : CharacterBody2D
|
||||
animatedSprite.SpeedScale = Math.Abs(movement.Y * speed * 1.3f);
|
||||
}
|
||||
}
|
||||
public int BeginDialogue(int i)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public void OnAnimationChanged()
|
||||
{
|
||||
if (animatedSprite.Animation == "move_side")
|
||||
|
Reference in New Issue
Block a user