Background.cs 578 Bytes
Newer Older
Emery Tanghanwaye's avatar
Emery Tanghanwaye committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using Godot;
using System;

public class Background : AnimatedSprite
{
    private Camera2D Cam;

    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        Cam = GetNode<Camera2D>("../../Camera2D");
    }


    public override void _PhysicsProcess(float delta)
    {
        Vector2 Pos = new Vector2(Cam.Offset.x - 640, Position.y);

        SetPosition(Pos);
    }
//  // Called every frame. 'delta' is the elapsed time since the previous frame.
//  public override void _Process(float delta)
//  {
//      
//  }
}