Skip to content

About

while learning godot engine , all of tries are here

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Godot Learning

A collection of Godot Engine learning projects, documenting my journey through game development with GDScript.

📚 Table of Contents

Overview

This repository contains my learning projects as I explore the Godot game engine and GDScript programming. Each project focuses on different aspects of game development.

Projects

6 - Learning About Godot Script

Focus: Basic GDScript concepts and node structure

Topics Covered:

  • Node types (Area2D, Sprite, Node2D)
  • GDScript syntax and structure
  • Variables and functions
  • _process() and _init() methods
  • Preloading resources
  • Creating and managing sprites

Key Files:

  • Player.gd - Player node implementation
  • mvtManager.gd - Movement manager
  • Directions.gd - Direction constants
  • Main.gd - Main scene script

7 - Player Movement & Collisions

Focus: Character movement and collision detection

Topics Covered:

  • KinematicBody2D for character movement
  • RayCast2D for collision detection
  • Input handling with _unhandled_input()
  • Tween animations for smooth movement
  • Collision groups
  • Tile-based movement

Key Files:

  • Player.gd - Player movement with raycast
  • Root.gd - Root scene management
  • goal.gd - Goal/objective handling
  • target.gd - Target interactions

Getting Started

Prerequisites

  • Godot Engine: Version 3.x or 4.x (check project.godot for version)
  • GDScript: Basic knowledge helpful but not required

Installation

# Clone the repository
git clone https://github.com/Ibrahimibrahimi/godot-learning.git
cd godot-learning

Running Projects

  1. Open Godot Engine
  2. Click "Import" or "Open Project"
  3. Navigate to the project folder (e.g., 6 - learning about godot script)
  4. Select the project.godot file
  5. Click "Import & Edit"
  6. Press F5 or click "Play" to run the project

Godot Concepts Covered

Node Types

Node Type Purpose Used In
Area2D 2D area for collisions/interactions Project 6
KinematicBody2D Physics-based character movement Project 7
Sprite 2D image display Project 6
Node2D Base 2D node Both
RayCast2D Directional collision detection Project 7
Tween Smooth property animations Project 7

GDScript Basics

# Variables
var speed = 100
var direction = Vector2.UP

# Functions
func _process(delta):
    # Called every frame
    move(delta)

# Signals
func _on_body_entered(body):
    # Called when body enters area
    print("Collision with: ", body.name)

Input Handling

# Using built-in input actions
func _unhandled_input(event):
    if event.is_action_pressed("ui_up"):
        move(Vector2.UP)
    if event.is_action_pressed("ui_down"):
        move(Vector2.DOWN)

Collision Detection

# RayCast for collision checking
onready var ray = $RayCast2D

func can_move(direction):
    ray.cast_to = direction * PIXEL_SIZE
    ray.force_raycast_update()
    return not ray.is_colliding()

Tween Animations

# Smooth movement with Tween
func move_tween(target_position):
    $Tween.interpolate_property(
        self,
        "position",
        position,
        target_position,
        0.1,
        Tween.TRANS_SINE,
        Tween.EASE_IN
    )
    $Tween.start()

Project Structure

godot-learning/
├── README.md                              # This file
├── LICENSE                                # MIT License
│
├── 6 - learning about godot script/       # Basic GDScript
│   ├── project.godot                     # Godot project file
│   ├── Player.gd                         # Player script
│   ├── mvtManager.gd                     # Movement manager
│   ├── Directions.gd                     # Direction constants
│   ├── Main.gd                           # Main scene
│   ├── Node2D.tscn                       # Main scene file
│   ├── icon.png                          # Default icon
│   └── default_env.tres                  # Default environment
│
└── 7 - player mouvement & collisions/    # Movement & Collisions
    ├── project.godot                     # Godot project file
    ├── scripts/
    │   ├── Player.gd                     # Player with raycast
    │   ├── Root.gd                       # Root scene
    │   ├── goal.gd                       # Goal handling
    │   └── target.gd                     # Target interactions
    ├── assets/                           # Game assets
    │   ├── tilemap_packed.png
    │   └── *.png                         # Tile sprites
    ├── Root.tscn                         # Root scene file
    └── level.tscn                        # Level scene file

Learning Progress

Completed Topics

  • Basic GDScript syntax
  • Node types and hierarchy
  • _process() and _init() methods
  • Preloading resources
  • Sprite management
  • Input handling
  • KinematicBody2D movement
  • RayCast2D collision detection
  • Tween animations
  • Collision groups

In Progress

  • AnimationPlayer
  • TileMap systems
  • Scene management
  • Signal connections

Planned

  • Physics bodies
  • Particle systems
  • Audio integration
  • UI systems
  • Exporting projects

Learning Resources

Official Documentation

Community Resources

Video Tutorials

Examples

Basic Player Movement (Project 6)

extends Area2D

var speed = 55
var direction = Vector2.ZERO

func _process(delta):
    if Input.is_action_pressed("ui_right"):
        direction = Vector2.RIGHT
    elif Input.is_action_pressed("ui_left"):
        direction = Vector2.LEFT
    
    position += direction * speed * delta

Raycast Movement (Project 7)

extends KinematicBody2D

const PIXEL_SIZE = 16
onready var ray = $RayCast2D

func move(direction):
    var vector_pos = direction * PIXEL_SIZE
    
    ray.cast_to = vector_pos
    ray.force_raycast_update()
    
    if not ray.is_colliding():
        $Tween.interpolate_property(
            self, "position",
            position, position + vector_pos,
            0.1, Tween.TRANS_SINE, Tween.EASE_IN
        )
        $Tween.start()

Contributing

Contributions are welcome! Feel free to:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Ibrahim Ibrahim - GitHub


⭐ If you find this helpful, please give it a star!

About

while learning godot engine , all of tries are here

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages