Basic Breakout
Player
- KinematicBody2D
- Sprite
- CollisionShape2D
- später
- Ancor
- Timer
Welt
Wand
- Wall als StaticBody2D
- CollisionPoligon2D
Steine / Bricks
- Gruppe als Node2D
- Einzelstein als StaticBody2D
- Sprite
- CollisionScape2D
Erstes Script
func _physics_process(delta: float) → void: var y = get_position().y var mouse_x = get_viewport().get_mouse_position().x set_position(Vector2(mouse_x, y)) if Input.is_action_just_pressed(„ui_mouse“): var ball = ball_scene.instance() ball.set_position(get_position() - Vector2(0,16)) get_tree().get_root().add_child(ball)