Trying to learn Godot and make games, I was wondering how people made Checkpoints. Now we know too!
Any comments and suggestions are more than welcome!
This is all new to me so I would love to hear what I can improve :D
Thank you to: [ Ссылка ] for his helpful tip!
Intro and outro animations made in Aseprite.
Outro song: [ Ссылка ]
Background song: [ Ссылка ]
Follow me on twitter if you wish to stuff I draw: [ Ссылка ]
Check out my games: [ Ссылка ]
0:00 Intro
0:04 Player Movement
1:29 A Trap to Reset the level
2:36 Checkpoint - Autoload Global Scene
4:14 Checkpoint - Spawn Location
5:05 Final Product
5:34 Outro
Awesome music by: Hart
find him: [ Ссылка ]
and here: [ Ссылка ]
[ Ссылка ]
----------CODE---------
#1. "Player":
var ACCELARATION = 4000
var MAX_SPEED = 200
var FRICTION = 1000
var velocity = Vector2.ZERO
func _physics_process(delta):
var input_vector = Vector2.ZERO
input_vector.x = Input.get_action_strength("ui_right") - Input.get_action_strength("ui_left")
input_vector.y = Input.get_action_strength("ui_down") - Input.get_action_strength("ui_up")
input_vector = input_vector.normalized()
velocity = velocity.move_toward(input_vector * MAX_SPEED, ACCELARATION * delta * 0.5)
velocity = move_and_slide(velocity)
#2. "Trap" (remember to connect body_entered! then paste the following:)
if body.name == "Player":
get_tree().reload_current_scene()
#3."Global" (remember to click "Add" on Project Settings-Autoload!)
var spawn_point = Vector2(0,0)
func update_spawn(new_point):
spawn_point = new_point
#4. "Spawn" (remember to connect body_entered! then paste the following:)
if body.name == "Player":
Global.update_spawn(self.global_position)
#Godot #Tutorial #Checkpoints
![](https://s2.save4k.ru/pic/YraYIe-q0uo/maxresdefault.jpg)