diff options
| author | realtradam <[email protected]> | 2020-03-14 15:12:51 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2020-03-14 15:12:51 -0400 |
| commit | f435ce10e93d7798ad4fe43be33cd01a4edd3dfb (patch) | |
| tree | f77f4c781c1ebdea88cc89b4132c33c310acb69d /Racing-Game/Camera2D.gd | |
| parent | b536ec904471c8995c1910477ca1c829c2e31af5 (diff) | |
| download | optimal-direction-f435ce10e93d7798ad4fe43be33cd01a4edd3dfb.tar.gz optimal-direction-f435ce10e93d7798ad4fe43be33cd01a4edd3dfb.zip | |
Initial adding of files
Diffstat (limited to 'Racing-Game/Camera2D.gd')
| -rw-r--r-- | Racing-Game/Camera2D.gd | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Racing-Game/Camera2D.gd b/Racing-Game/Camera2D.gd new file mode 100644 index 0000000..e17493a --- /dev/null +++ b/Racing-Game/Camera2D.gd @@ -0,0 +1,30 @@ +extends Camera2D + +# Declare member variables here. Examples: +# var a = 2 +# var b = "text" +var printfps = 0; + +# Called when the node enters the scene tree for the first time. +func _ready(): + zoom = Vector2(2,2) + connect("pos",get_node("Cars/4WheelCar"),"_on_CarBody_pos") + pass # Replace with function body. + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): +# #print fps +# printfps += delta +# if(printfps > 1): +# print(1/delta) +# printfps -= 1 + pass + +func set_position(pos): + position = pos; + + +func _on_CarBody_pos(pos): + #velocity = velocity/100 + 1.5 + #zoom = Vector2(velocity,velocity) + position = pos |
