1
Fork 0
mirror of https://github.com/Steffo99/pineapple-surf.git synced 2024-11-21 23:34:21 +00:00

Fix some playercontroller warnings

This commit is contained in:
Steffo 2023-01-08 13:13:09 +01:00
parent 41297e5ed4
commit ed9ee9860e
Signed by: steffo
GPG key ID: 6965406171929D01
4 changed files with 7 additions and 21 deletions

View file

@ -19,13 +19,6 @@ func _ready() -> void:
xNoise.seed = 0 xNoise.seed = 0
yNoise.seed = 1 yNoise.seed = 1
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _physics_process(delta: float) -> void:
pass
func _input(event: InputEvent) -> void: func _input(event: InputEvent) -> void:
if event is InputEventMouseMotion: if event is InputEventMouseMotion:

View file

@ -29,16 +29,12 @@ func _ready() -> void:
self._switch_weapon(BaseWeapon.WeaponSlot.ONE) self._switch_weapon(BaseWeapon.WeaponSlot.ONE)
func _process(delta: float) -> void:
pass
func _on_player_set(player: Player) -> void: func _on_player_set(player: Player) -> void:
for weapon in weapons: for weapon in weapons:
weapon.player = player weapon.player = player
func _input(event: InputEvent) -> void: func _input(_event: InputEvent) -> void:
if Input.is_action_just_pressed("slot1"): if Input.is_action_just_pressed("slot1"):
_switch_weapon(BaseWeapon.WeaponSlot.ONE) _switch_weapon(BaseWeapon.WeaponSlot.ONE)
# elif Input.is_action_just_pressed("slot2"): # elif Input.is_action_just_pressed("slot2"):
@ -54,12 +50,12 @@ func _switch_weapon(slot: BaseWeapon.WeaponSlot):
if weapon.weaponSlot == slot: if weapon.weaponSlot == slot:
# Remove active weapon # Remove active weapon
if active_weapon: if active_weapon:
await active_weapon.on_switch_out() active_weapon.on_switch_out()
remove_child(active_weapon) remove_child(active_weapon)
# Add new weapon # Add new weapon
add_child(weapon) add_child(weapon)
active_weapon = weapon active_weapon = weapon
await active_weapon.on_switch_in() active_weapon.on_switch_in()
emit_signal("weapon_switched", weapon) emit_signal("weapon_switched", weapon)
break break

View file

@ -45,9 +45,6 @@ func _ready():
OnHand.player = self OnHand.player = self
vport.size = viewport_resolution vport.size = viewport_resolution
func _process(delta):
pass
func _physics_process(delta): func _physics_process(delta):
last_frame_input_data = input_data last_frame_input_data = input_data
input_data = PlayerInputData.new() input_data = PlayerInputData.new()

View file

@ -22,7 +22,7 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame. # Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void: func _process(_delta: float) -> void:
var current_time = Time.get_ticks_msec() var current_time = Time.get_ticks_msec()
if Input.is_action_just_pressed("fire") and current_time > (last_fired + FIRE_RATE*1000): if Input.is_action_just_pressed("fire") and current_time > (last_fired + FIRE_RATE*1000):
@ -37,9 +37,9 @@ func shoot() -> void:
# $AnimationPlayer.play("shoot") # $AnimationPlayer.play("shoot")
if ray.is_colliding(): if ray.is_colliding():
var normal = ray.get_collision_normal() as Vector3 var _normal = ray.get_collision_normal() as Vector3
var point = ray.get_collision_point() as Vector3 var _point = ray.get_collision_point() as Vector3
var object = ray.get_collider() as Node3D var _object = ray.get_collider() as Node3D
try_placing_seed(ray) try_placing_seed(ray)
# decalInstance.position = point # decalInstance.position = point
# object.add_child(decalInstance) # object.add_child(decalInstance)