mono_sample/game/TestSprite.cs

29 lines
597 B
C#
Raw Normal View History

2023-06-02 01:16:10 +02:00
using Godot;
using System;
public class TestSprite : Sprite
{
// Declare member variables here. Examples:
// private int a = 2;
// private string b = "text";
2023-06-11 18:16:16 +02:00
private float dt;
2023-06-15 00:22:39 +02:00
[Export]
public float XScale;
2023-06-02 01:16:10 +02:00
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(float delta)
{
2023-06-11 18:16:16 +02:00
dt += delta;
2023-06-15 00:22:39 +02:00
Position = new Vector2((float)Math.Sin(dt) * 100 * XScale, (float)Math.Cos(dt) * 200);
2023-06-11 18:16:16 +02:00
//Position += new Vector2(1, 1);
2023-06-02 01:16:10 +02:00
}
}