princesse/état: copie de l'état entre niveaux
La princesse récupère son état d'un niveau à l'autre. De cette manière, on ne perd pas les fromages.
This commit is contained in:
31
princesse.gd
31
princesse.gd
@@ -43,6 +43,8 @@ var DASH_SPEED = WALKING_SPEED * 2
|
||||
@export var WALK_INCR_GROUND : int = 1
|
||||
@export var WALK_INCR_AIR : int = 3
|
||||
|
||||
@export var MAX_FARTS : int = 1
|
||||
|
||||
signal cheese_collected()
|
||||
signal princesse_is_dead()
|
||||
|
||||
@@ -92,9 +94,34 @@ var dashing : bool = false
|
||||
var dash_step : int = -1
|
||||
var dash_direction_x : int = 1
|
||||
var dash_direction_y : int = 1
|
||||
|
||||
var available_dashs = 0
|
||||
@export var MAX_FARTS : int = 1
|
||||
|
||||
func copy_from(other : Princess):
|
||||
direction = other.direction
|
||||
walking = other.walking
|
||||
walking_step = other.walking_step
|
||||
walk_incr_reserve = other.walk_incr_reserve
|
||||
init_decel = other.init_decel
|
||||
init_direction_change = other.init_direction_change
|
||||
jumping = other.jumping
|
||||
need_jump = other.need_jump
|
||||
jumping_step = other.jumping_step
|
||||
jump_key_counter = other.jump_key_counter
|
||||
kicking = other.kicking
|
||||
kick_step = other.kick_step
|
||||
kick_direction = other.kick_direction
|
||||
coyote_ground = other.coyote_ground
|
||||
coyote_grab = other.coyote_grab
|
||||
falling_step = other.falling_step
|
||||
pressing_wall_left = other.pressing_wall_left
|
||||
pressing_wall_right = other.pressing_wall_right
|
||||
pressing_wall = other.pressing_wall
|
||||
grab_wall = other.grab_wall
|
||||
dashing = other.dashing
|
||||
dash_step = other.dash_step
|
||||
dash_direction_x = other.dash_direction_x
|
||||
dash_direction_y = other.dash_direction_y
|
||||
available_dashs = other.available_dashs
|
||||
|
||||
################################################################################
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user