1. Home
  2. /
  3. Godot
  4. /
  5. Basic Player Movement

Basic Player Movement - Godot Typing CST Test

Loading…

Basic Player Movement — Godot Code

Implements simple player movement using input actions in GDScript for a 2D scene.

# Player.gd
extends CharacterBody2D

@export var speed = 200

func _physics_process(delta):
	var direction = Vector2.ZERO
	if Input.is_action_pressed("ui_right"):
		direction.x += 1
	if Input.is_action_pressed("ui_left"):
		direction.x -= 1
	if Input.is_action_pressed("ui_down"):
		direction.y += 1
	if Input.is_action_pressed("ui_up"):
		direction.y -= 1
	velocity = direction.normalized() * speed
	move_and_slide()

Godot Language Guide

Godot Engine is a free, open-source, cross-platform game engine that allows developers to build 2D, 3D, and hybrid games using an intuitive scene system, GDScript, C#, or visual scripting.

Primary Use Cases

  • ▸2D platformers and adventure games
  • ▸3D indie games and prototypes
  • ▸Mobile and casual games
  • ▸Game jams and rapid prototyping
  • ▸Web games exported to HTML5

Notable Features

  • ▸Node/scene architecture
  • ▸GDScript - Python-like language optimized for games
  • ▸C# support via Mono
  • ▸2D and 3D physics engines
  • ▸Cross-platform deployment

Origin & Creator

Godot was originally created by Juan Linietsky and Ariel Manzur, and later open-sourced under the MIT License to empower global developers.

Industrial Note

Godot excels for indie game studios, prototyping, 2D art-heavy games, and teams that want full control with open source tools and no licensing fees-even at massive scale.

More Godot Typing Exercises

Godot Simple 2D Todo Game PrototypeGodot Object SpawnerGodot Collectible CoinsGodot Simple TimerGodot Simple Door InteractionGodot Simple ProjectileGodot Simple Enemy AIGodot Simple HUD UIGodot Scene Switcher

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher