How can I draw a Sprite on Screen

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By RobinGerst99
:warning: Old Version Published before Godot 3 was released.

Basically, I am working on a maze generator and right now I am using draw_texture() to draw a wall at a specific location. However, later on I want to add collisions and physics so I may need a more sophisticated way of drawing walls. I am quite new to godot so are there any nodes or so that I would have to setup or so?

:bust_in_silhouette: Reply From: quijipixel

Instead of drawing a texture use the physics bodies: StaticBody2D, KinematicBody2D and RigidBody2D. You can add collision shapes and sprites with the CollisionShape node (and CollisionPolygon2D) and Sprite node respectively to this nodes. This physics bodies will allow you to implement objects that collide but don’t move (Static), objects that move the way you want (Kinematic) and objects that follow the laws of physics (Rigid). You can find all the info you need in the docs.