This commit is contained in:
2024-10-19 19:19:46 +02:00
parent 7c50910690
commit bbf3c5e593
12 changed files with 262 additions and 13 deletions

View File

@@ -4,19 +4,35 @@ using System;
public partial class Player : CharacterBody2D
{
[Export] float Speed;
[Export] float sugar_speed;
[Export] AnimationPlayer anim;
[Export] Camera2D cam;
[Export] TextureProgressBar bar;
[ExportGroup("controls")]
[Export] Control menu;
public float PixelSize = 1.0f;
float sugar { get; set;}= 50;
const float MAX_SUGAR = 100;
public override void _PhysicsProcess(double delta)
{
Vector2 velocity = Velocity;
sugar -= (float)delta / sugar_speed;
bar.Value = sugar;
if(sugar <= 0)
{
}
else if (sugar >= 100)
{
}
Vector2 direction = Input.GetVector("left", "right", "up", "down");