Godot
Setting up Godot
- Download Godot Standard version from here: https://godotengine.org/download/windows
- Unpack it and run the exe file
- Create a new project by pressing New Project, for a 2D game OpenGL ES 2.0 is suitable (it will run on more platforms).
Godot Introduction
This is a class diagram of Godot's base classes:
Practice 1
This practice is based on a Platform game tutorial series from HeartBeat:
Part1: https://youtu.be/wETY5_9kFtA
- Create a new 2D project
- Add basic node World
- Save the scene
- Add a player
- Add a KinematicBody2D, rename it Player and attach script Player.gd
- Add Sprite to KinematicBody2D, with Godot icon
- Add variable motion Vector2
- Add func _physics_process(delta)
- Change motion.x to 0, 100 or -100 based on which button player presses
- Add move_and_slide(motion) to move it
- Add GRAVITY constant and make player fall
- Add a StaticBody2D named Wall
- Add sprite to the wall (you can use Godot icon and tint it black)
- Add CollisionShape2D with box shape to both player and wall
- Save Wall as a scene and duplicate it multiple times
- Make the player jump when up button is pressed
- Add check is_on_floor() check to determine that player is on floor
- Check if the up button is pressed and change the motion.y when it is
- Add UP constant Vector and add it to the move_and_slide
- Update the motion by the return value from move_and_slide
- Add export variables for gravity, speed and jump_height, configure them in inspector
Practice 2
Part2: https://youtu.be/BfQGXtlmE7k
- Download sprites from https://www.dropbox.com/s/dq0q4udpujh1fzp/Sprites.zip?dl=0
- Import sprites as 2D pixel texture.
- Create a tileset.
- Create a new tileset scene (Regular node)
- Add sprite to the tileset and rename it to tile0.
- Turn on sprite region and select a tile.
- Add StaticBody2D and CollisionShape2D to the sprite and configure them.
- Duplicate sprite object to each different tiles.
- Save the scene as tileset: Scene -> Convert To -> Tileset
- Add Tilemap to the scene with the previously created Tileset
- Set the correct cell size.
- Change the view size (640, 480) Project -> Settings -> General -> Display -> Window (640, 480)
- Draw a simple map
- Set the view test size to (1280, 720)
- Set Mode to 2D and aspect to expand
- Animate the character
- Change Sprite node to AnimatedSprite
- Create new SpriteFrames
- Create Idle animation with Idle sprite (1 frame)
- Create Run animation (5 frames)
- Create Jump animation with only the first frame (1 frame)
- Resize the collision to fit the sprite
- Flip the sprite when the player changes the direction
- Switch between run and idle animations in code
- Play the Jump animation when player is not on the floor
Part3: https://youtu.be/ZsP7JDrRTJY
- Add acceleration to the the player with a max speed
- Make player to slow down when stopped (friction is higher on ground)
- Change the collision shape to a capsule
Part4: https://youtu.be/KzLfi0r4Muw
- Create a portal between scene
- Add Area2D with a collision shape and icon.
- Add a script to it
- Loop over overlapping bodies, and if the body.name == "Player" change the scene.
- Make the scene configurable by adding: export(String, FILE, "*.tscn") var world_scene
Practice 3
Part6: https://youtu.be/K-eM2ZLI1q8
- Add a following camera node to the character
- Add a parallax layer node to the character
- Download sky texture from here: https://www.dropbox.com/s/esskpfovx1lkk7v/Dirt%20Autotile%20and%20Sky.zip
- Use pixel snap: Settings -> General -> Rendering -> Quality -> Use Pixel Snap
Part7: https://youtu.be/sBuJRHvk5sY
- Add a basic UI and menu
- Add VBoxContainer
- Add Game Title
- Add Start and Exit buttons
- Configure Start and Exit buttons through events
- Add a theme
- Use scrollbar.png from here: https://opengameart.org/content/match-3-gui
- Configure buttons and background for the panel
Submission
Submit a compiled version of your game (Windows 64 build). Zip your build folder into a single package and make sure that all the additional files (that were created when building the game) are also included in this package. Don't submit your source code.
Deadline: 24.11 (before lab)
2. Godot projectSellele ülesandele ei saa enam lahendusi esitada.