Dies ist eine alte Version des Dokuments!
Godot 3 - Platformer Tutorial (UmaiPixel)
Getting started
- Einstellungen (Project Settings)
- Rendering | 2D | Use GPU Pixel Snap = on
- Display | Window | Size (16:9) z.B. 320 x 180
- Test Width & Height = 1280 x 720 (vier mal Originalgröße)
- Stretch Mode = 2d
- Aspect = keep
- erste Szene erstellen
- Hauptszene erstellen (Node2D) und speichern
- Playerszene erstellen
- KinematicBody2D
- Sprite
Sprite Reimport mit Preset 2D Pixel
Sprite Einstellungen für CharacterMap - CollisionsShape2D
- First Script
extends KinematicBody2D var velocity = Vector2() func _physics_process(delta): if Input.is_action_pressed(„ui_right“): velocity.x = 30 move_and_slide(velocity)
next Version
extends KinematicBody2D var velocity = Vector2() func _physics_process(delta): if Input.is_action_pressed(„ui_right“): velocity.x = 30 elif Input.is_action_pressed(„ui_left“): velocity.x = -30 else: velocity.x = 0 move_and_slide(velocity)
Version 3 - links, rechts, stop
extends KinematicBody2D var velocity = Vector2() func _physics_process(delta): if Input.is_action_pressed(„ui_right“): velocity.x = 30 elif Input.is_action_pressed(„ui_left“): velocity.x = -30 else: velocity.x = 0 move_and_slide(velocity)

