예제 #1
0
파일: FruitTree.cs 프로젝트: Splagoon/ld44
    public override void _Ready()
    {
        base._Ready();

        FRUIT_TIMER = 30f;

        _sprite          = GetChild <ResourceSprite>(0);
        _noFruitTexture  = (Texture)GD.Load("res://Assets/fruittree.png");
        _fruitTexture    = (Texture)GD.Load("res://Assets/fruittree-fruit.png");
        _animationPlayer = GetChild <AnimationPlayer>(1);

        _sprite.SetTexture(_noFruitTexture);
        _sprite.RandomizePosition();
    }
예제 #2
0
파일: Bush.cs 프로젝트: Splagoon/ld44
    public override void _Ready()
    {
        base._Ready();
        _noFruitTexture = (Texture)GD.Load("res://Assets/bush.png");
        var textureIdx = RNG.Instance.Next(3);

        _fruitTexture = (Texture)GD.Load($"res://Assets/bush-fruit{textureIdx}.png");

        _sprite = GetChild <ResourceSprite>(0);
        _sprite.SetTexture(_noFruitTexture);
        _sprite.RandomizePosition();

        FRUIT_TIMER           = 15f;
        _timeSinceFruitPicked = (float)RNG.Instance.NextDouble() * FRUIT_TIMER;
    }
예제 #3
0
파일: Bush.cs 프로젝트: Splagoon/ld44
 protected override void Bloom()
 {
     base.Bloom();
     _sprite.SetTexture(_fruitTexture);
 }