plein
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user