-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
presionar los botones no dispara el metodo que coloca un bloque, la c…
…amara se mueve con las acciones predefinidas del boton de direccion configurado
- Loading branch information
1 parent
25d2447
commit 1347723
Showing
3 changed files
with
50 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
extends Camera2D | ||
|
||
export var velocidadDeLaCamara = 10 | ||
export var limitesDeLaCamara = Vector2(200, 200) | ||
|
||
func _process(delta): | ||
var moverX = int(Input.is_action_pressed("ui_right")) - int(Input.is_action_pressed("ui_left")) | ||
var moverY = int(Input.is_action_pressed("ui_down")) - int(Input.is_action_pressed("ui_up")) | ||
|
||
var DeltaMultiplicado = velocidadDeLaCamara * delta | ||
|
||
position.x = lerp(position.x, position.x - moverX * velocidadDeLaCamara, DeltaMultiplicado) | ||
position.y = lerp(position.y, position.y - moverY * velocidadDeLaCamara, DeltaMultiplicado) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters