Animation speed scale 800 600 60 10 false GDevelop JS platform Text 20 BuiltinCommonInstructions::Comment The "Player" object has an automatism called "Platformer object": You can move it using the arrows key and the Shift key to jump. The platforms are recognized thanks to their "Platform" automatism. L'objet "Player" possède un automatisme appelé "Personnage déplaçable sur les plateformes": Vous pouvez le bouger avec les flèches directionnelles et utiliser la touche Shift ( ou Maj ) pour sauter. Les plateformes ont toutes un automatisme "Plateforme" afin d'être reconnues comme telles. BuiltinCommonInstructions::Standard Player = 1 BuiltinCommonInstructions::Comment Change the animation according to what the player do. On change l'animation en fonction de ce que fait le joueur. BuiltinCommonInstructions::Standard Player PlatformerObject Player = 1 BuiltinCommonInstructions::Standard Player PlatformerObject Player = 1 BuiltinCommonInstructions::Standard Player PlatformerObject BuiltinCommonInstructions::Standard Player PlatformerObject Player = 0 BuiltinCommonInstructions::Standard Player PlatformerObject Player = 2 BuiltinCommonInstructions::Standard Left Player yes BuiltinCommonInstructions::Standard "movementTime" BuiltinCommonInstructions::Comment We use a timer to know the time elasped since the beginning of the movement. Then, we use this time to determine the speed of the player (and update the animation speed scale to accelerate the animation) On utilise un chronomètre pour connaître le temps écoulé depuis le début du mouvement du personnage. Ensuite, on utilise ce temps pour déterminer la vitesse du personnage (et mettre à jour l'échelle de vitesse de l'animation du personnage). BuiltinCommonInstructions::Standard Player PlatformerObject = 800*(1-exp(-0.5*TimerElapsedTime("movementTime"))) Player = (800*(1-exp(-0.5*TimerElapsedTime("movementTime"))))/400 BuiltinCommonInstructions::Standard Right Player no BuiltinCommonInstructions::Standard "movementTime" BuiltinCommonInstructions::Standard Player PlatformerObject = 800*(1-exp(-0.5*TimerElapsedTime("movementTime"))) Player = (800*(1-exp(-0.5*TimerElapsedTime("movementTime"))))/400 BuiltinCommonInstructions::Comment Make sure the camera follows the player. On s'assure que la caméra suit le joueur. BuiltinCommonInstructions::Standard = Player.X() AnimationScaleText = ToString(Player.AnimationSpeedScale()) BuiltinCommonInstructions::Comment Management of the moving platform: Gestion de la plateforme bougeante: BuiltinCommonInstructions::Standard GoLeft GoRight