small smart dialogue system change
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
//WORK IN PROGRESS this code is very messy and will be fixed when it works
|
||||
using Godot;
|
||||
using System;
|
||||
|
||||
|
@@ -8,11 +8,13 @@ public partial class player : CharacterBody2D
|
||||
public Vector2 movement;
|
||||
public AnimatedSprite2D animatedSprite;
|
||||
public Marker2D rotCenter;
|
||||
public RayCast2D rayCast;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
animatedSprite = GetNode<AnimatedSprite2D>("animated_sprite_2d");
|
||||
rotCenter = GetNode<Marker2D>("rotation_center");
|
||||
rayCast = GetNode<RayCast2D>("rotation_center/ray_cast_2d");
|
||||
}
|
||||
public void ChangeProcess(bool process)
|
||||
{
|
||||
@@ -27,10 +29,9 @@ public partial class player : CharacterBody2D
|
||||
}
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
|
||||
//call event in raycasted object
|
||||
/*if (Input.IsActionJustPressed("ui_accept") && rayCast.IsColliding())
|
||||
rayCast.GetCollider().Call("OnInteraction", playerName);*/
|
||||
if (Input.IsActionJustPressed("ui_accept") && rayCast.IsColliding())
|
||||
rayCast.GetCollider().Call("OnInteraction", playerName);
|
||||
|
||||
//animation system (with controller support wich cant get normalized vector)
|
||||
if (movement.Length() != 0)
|
||||
|
Reference in New Issue
Block a user