adding in some example pegs and their actions. organizing folders, still working on pathing for some reason it won't move sometimes, and causes the looping to break
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
public partial class Shortsword : PegAction
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
base._Ready();
|
||||
_priority = 1000;
|
||||
_healthChange = -2;
|
||||
_cost = 2;
|
||||
_range = 0;
|
||||
_usesMax = 1;
|
||||
_usesRemaining = _usesMax;
|
||||
}
|
||||
public override Tween CreateAnimation(Peg PEG)
|
||||
{
|
||||
Vector2 target = PEG.GlobalPosition + (Vector2.Up * 50);
|
||||
Tween subtween = CreateTween();
|
||||
subtween.TweenProperty(_image, "visible", true, 0.0f);
|
||||
subtween.TweenProperty(_image, "global_position", target, 0.5f);
|
||||
subtween.TweenCallback(Callable.From(() =>
|
||||
{
|
||||
PEG._pegController._playerController.ChangeHealth(_healthChange, this);
|
||||
_image.Position = Vector2.Zero;
|
||||
_image.Visible = false;
|
||||
}));
|
||||
return subtween;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user