Using viewport texture instead of manual rect blending

This commit is contained in:
Martin Felis
2024-01-27 01:15:01 +01:00
parent 4501b19bc4
commit 52e3db3041
8 changed files with 99 additions and 40 deletions
+7 -1
View File
@@ -1,4 +1,4 @@
class Player extends CharacterBody3D
extends CharacterBody3D
@export var color : Color = Color.DODGER_BLUE
@@ -7,9 +7,12 @@ class Player extends CharacterBody3D
@export var move_down_action := "move_down"
@export var move_up_action := "move_up"
@export var dash_action := "dash"
@export var bomb_action := "bomp"
@onready var geometry = $Geometry
signal bomb_triggered
var angle = 0
var is_dashing = false
var dash_time = 0
@@ -30,6 +33,9 @@ func _physics_process(delta):
# Handle jump.
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
velocity.y = JUMP_VELOCITY
if Input.is_action_just_pressed(bomb_action):
emit_signal("bomb_triggered", self)
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.