SaveStation, save & load properly
This commit is contained in:
parent
d4acde846c
commit
847670821d
16 changed files with 129 additions and 13 deletions
|
@ -40,6 +40,7 @@ onready var muzzle = $Sprite/PlayerGun/Sprite/Muzzle
|
|||
onready var fireBulletTimer = $FireBulletTimer
|
||||
onready var blinkAnimator = $BlinkAnimator
|
||||
onready var powerupDetector = $PowerupDetector
|
||||
onready var cameraFollow = $CameraFollow
|
||||
|
||||
signal hit_door(door)
|
||||
|
||||
|
@ -50,6 +51,10 @@ func set_invincible(value):
|
|||
func _ready():
|
||||
PlayerStats.connect("player_died", self, "_on_died")
|
||||
MainInstances.Player = self
|
||||
call_deferred("assign_world_camera")
|
||||
|
||||
func assign_world_camera():
|
||||
cameraFollow.remote_path = MainInstances.WorldCamera.get_path()
|
||||
|
||||
func _exit_tree():
|
||||
MainInstances.Player = null
|
||||
|
@ -87,7 +92,7 @@ func _physics_process(delta):
|
|||
|
||||
if Input.is_action_pressed("fire_missile") and fireBulletTimer.time_left == 0 and PlayerStats.missiles > 0 and PlayerStats.missiles_unlocked:
|
||||
fire_missile()
|
||||
|
||||
|
||||
func fire_bullet():
|
||||
var bullet = Utils.instance_scene_on_main(PlayerBullet, muzzle.global_position)
|
||||
bullet.velocity = Vector2.RIGHT.rotated(playerGun.rotation) * bullet_speed
|
||||
|
|
|
@ -130,6 +130,7 @@ script = ExtResource( 2 )
|
|||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
position = Vector2( 0, -12 )
|
||||
z_index = 10
|
||||
texture = ExtResource( 1 )
|
||||
hframes = 12
|
||||
frame = 11
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue