# Someone explain these lines of code

Attention Topic was automatically imported from the old Question2Answer platform.

I’m new to programming (i only know the basics of python) and i watched a tutorial on how to make a 2d platformer character move, i blindly copied these lines of code and it worked, but i still have some questions:
1- can someone explain what each of these functions do ? (and please make it as beginner friendly as possible)
2- why aren’t these functions called ?
3- i have a rough time understanding the delta part and the gravity * delta …

``````extends KinematicBody2D

var speed = 400
var jump_speed = -600
var gravity = 1500

var vel = Vector2.ZERO

func get_input():
vel.x = 0
if Input.is_action_pressed("right"):
vel.x += speed
if Input.is_action_pressed("left"):
vel.x -= speed

func _physics_process(delta):
get_input()
vel.y += gravity * delta
vel = move_and_slide(vel, Vector2.UP)
if Input.is_action_just_pressed("jump"):
if is_on_floor():
vel.y = jump_speed
``````
1. `get_input()` is called - it’s the first line of `_physics_process()`. As for how `_physics_process()` is called, that’s explained in the above link. It’s a built-in function that’s called automatically by the engine every frame.
2. `delta` is the frame time. It’s the duration of one frame - typically 1/60 second. You use it in any time-based calculations, so that movement is consistent. This comes from the basic kinematic equations of motion, from beginner-level physics. This might help with that: