2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2025-03-09 10:18:15 -04:00
2024-04-01 14:49:28 -04:00
2021-10-11 07:24:58 -04:00
2021-10-11 08:42:32 -04:00
2021-10-11 09:07:47 -04:00
2021-10-11 10:01:17 -04:00
2021-10-11 10:58:26 -04:00
2021-10-11 17:14:44 -04:00
2021-10-14 20:55:14 -04:00
2021-10-16 10:30:53 -04:00
2021-10-16 10:31:15 -04:00
2021-10-17 08:21:58 -04:00
2021-10-23 09:50:41 -04:00
2021-10-24 08:39:50 -04:00
2024-08-17 14:25:25 -04:00

Godot Experiments

Some experiments using the Godot game engine.

Note: In 2023-06 I upgraded these to Godot 4; if you want to look at the Godot 3 versions, grab the godot-3 tag.

These are ports of my PyGame experiments (which started as ports of my Löve experiments for now), we'll see where this goes.

Experiment 16 and 17 were joystick demos of Experiment 14; if I remember correctly, joysticks already worked with Experiment 14 et al. so I removed them as they didn't add anything.

Bribe me

Want to bribe me to work on more experiments, faster? Want to suggest an experiment?

ko-fi

Always willing to entertain suggestions, but if you're asking me to do some work, you have the option of fuelling it with coffee. ;-)

Credits

These use the Godot Engine.

License

Stuff I wrote is released under the MIT license, and any resources are covered by their respective licenses (please see individual experiment write up for details). I'm only using open source and freely usable third-party bits, but they might not be using MIT's license.

Experiment 01 - Scrolling Texture

Old games used a technique to animate textures where they shifted the sprite one row or column per frame. An easy/cheesy way to do this is to just produce a set of sprites that are shifted already and treat them as individual frames.

I want to see if there's a way to do it without duplicating and modifying the sprite. I'm thinking that ancient platforms (think Commodore C=64 or Apple ][) wouldn't have the memory to waste for this sort of thing.

The goal is to do this with one draw call, by adjusting the texture.

Experiment 1 - Scrolling Texture

This is actually more complex in Godot than in PyGame or Löve2D; we have to write a shader! Thank you Internet for answering this question.

Experiment 01 - Scrolling Texture (Almost No Code)

This variant of Experiment 1 accomplishes the same thing with two major differences:

  • almost no code (literally one line to set the animation when the scrolling sprite is ready)
  • scrolling the texture using the texture Region rather than a shader; when I first did Experiment 1 I didn't know about Region

Graphics

  • character_robot_jump.png - From Kenney.nl's freely usable Toon Characters 1 collection.

Experiment 2 - Monospaced Text

This is an attempt to create a simple text/console type of window. Print text to it, render it, and scroll up when you reach the bottom. Think of the text area in the bottom-right of the Ultima V, for example.

We'll make an area that can display five lines of 20 characters each. It automatically wraps lines that are too long, and there's a rectangle around the text area so you can be sure it's not over-drawing.

Experiment 2 - Monospaced Text

Graphics

Experiment 3 - Variable Width Text

This is the same as Experiment 2, but with a variable-width font. This is trivial in Godot.

Experiment 3 - Variable Text

Graphics

Experiment 4 - Text Entry

This is an attempt to turn Experiment 2 into a simple text entry box. Whatever you type will be printed in the text area.

We'll make an area that can display five lines of 20 characters each. There's a rectangle around the text area so you can be sure it's not over-drawing.

Experiment 4 - Text Entry

This is trivial with Godot, just use a TextEntry object.

Graphics

Experiment 5 - Image Fade

In this experiment, we'll fade an image from black to fully-drawn.

Experiment 5 - Image Fade

Graphics

  • character_robot_jump.png - From Kenney.nl's freely usable Toon Characters 1 collection.

Experiment 6 - UI Dialog

In this experiment, we'll draw a dialog box with some text in it and a character portrait.

Experiment 6 - UI Dialog

Graphics

  • HONK.png - The Goose from House House's amazing Untitled Goose Game, used without permission. I'm not affiliated with House House in any way, other than as a happy customer. You should buy Untitled Goose Game, it's amazingly fun. I have it on my Switch!
  • rpg_gui_v1 - RPG GUI construction kit v1.0 by Lamoot on OpenGameArt.org. I had to create a 9-patch image of the parts I wanted to use because I couldn't figure out how to use arbitrary texture hunks for it in Godot.

Font:

Experiment 7 - Animated Icon

In this experiment, we'll draw an animated icon.

Experiment 7 - Animated Icon

This is trivial in Godot thanks to the AnimiatedSprite object.

Graphics

  • character_robot_sheet.png - From Kenney.nl's freely usable Toon Characters 1 collection.

Experiment 8 - Styled Text

This is an attempt to create a simple text window that supports some text styling (multiple fonts and colours). Print text to it, render it, and scroll up when you reach the bottom.

Experiment 8 - Styled Text

Graphics

Experiment 9 - UI Button

In this experiment, we'll draw a button with some text in it. It'll respond to the mouse hovering over it, and clicks.

Experiment 9 - UI Button

Graphics

Font:

Experiment 10 - UI Spinbox

In this experiment, we'll draw a spinbox with some text in it. It'll respond to the mouse hovering over it, and clicks, switching between a set of values.

Experiment 10 - UI Spinbox

Graphics

Font:

Experiment 11 - Tilemap

In this experiment, we'll draw a viewport onto a tilemap that was created in Tiled. Use the arrow keys or WASD to move the viewport around the map.

Experiment 11 - Tilemap

Graphics

"[LPC] Terrains" by bluecarrot16, Lanea Zimmerman (Sharm), Daniel Eddeland (Daneeklu), Richard Kettering (Jetrel), Zachariah Husiar (Zabin), Hyptosis, Casper Nilsson, Buko Studios, Nushio, ZaPaper, billknye, William Thompson, caeles, Redshrike, Bertram, and Rayane Félix (RayaneFLX). See CREDITS-terrain.txt. You MUST credit all authors with the information in this file, and you must link back to this page on OpenGameArt.

Experiment 12 - Minimap Tilemap

In this experiment, we'll draw a viewport onto a tilemap that was created in Tiled. Use the arrow keys or WASD to move the viewport around the map. This version adds a minimap that follows the viewport.

Experiment 12 - Tilemap

Graphics

"[LPC] Terrains" by bluecarrot16, Lanea Zimmerman (Sharm), Daniel Eddeland (Daneeklu), Richard Kettering (Jetrel), Zachariah Husiar (Zabin), Hyptosis, Casper Nilsson, Buko Studios, Nushio, ZaPaper, billknye, William Thompson, caeles, Redshrike, Bertram, and Rayane Félix (RayaneFLX). See CREDITS-terrain.txt. You MUST credit all authors with the information in this file, and you must link back to this page on OpenGameArt.

Experiment 13 - Rect Fades

In this experiment, we'll try to fade in/out on an image by drawing over it with masking rectangles.

Experiment 13 - Rect Fades

Graphics

  • fox n girl shadows.png by zonked on OpenGameArt; resized and cropped to fit the window I'm using.

Experiment 14 - Animated Sprite

Note: Input doesn't seem to work, will need to fix. 🤷

In this experiment, we'll animate one of the Liberated Pixel Cup sprites (OpenGameArt's mascot, Sara). Use WASD or arrow keys to walk around.

Experiment 14 - Animated Sprite

Graphics

  • grass.png - A grass tile, by Invincible.
  • LiberationMono-Bold.ttf - An open source font from the liberationfonts repo; this is licensed under the SIL Open Font License.
  • LPC_Sara - Stephen "Redshrike" Challener as graphic artist and William.Thompsonj as contributor. Mandi Paugh is the original artist of Sara and creator of the OGA mascot.

LPC sprite sheet documentation:

  • Each row is a complete animation cycle.
  • Rows are mostly in groups of four based on facing: away, left, forward, right.
  • Animation rows are: Spellcast, Thrust, Walk, Slash, Shoot, Hurt (only one facing for Hurt).
  • Are 64x64 on the sprite sheet.

Experiment 15 - Text Dropshadows

This experiment draws text with different dropshadows, so we can see how to make our white text more readable on a light coloured background.

Experiment 15 - Text Dropshadows

Graphics

Experiment 16 - Joystick

I'm skipping implementing this one because Godot handles joysticks transparently through the input mapping support. Both Löve2D and PyGame provide extremely low-level access to the gamepad data and it's up to you to map the raw numbers into something useful.

Experiment 17 - Sprite Joystick

Similarly, I'm skipping Experiment 17, because it's just Experiment 14 with joystick support for movement. Through the magic of Godot's input mapping, Experiment 14 already supports gamepad control.

Experiment 18 - Tilemap Layers

In this experiment, we'll draw a viewport onto a tilemap that was created in Tiled. Use the arrow keys or WASD to move the viewport around the map. This expands on Experiment 11 by working with a map that has several layers.

Note: This is trivial, Tiled's export to Godot 4 supports layers directly.

Experiment 18 - Tilemap Layers

Graphics

"[LPC] Terrains" by bluecarrot16, Lanea Zimmerman (Sharm), Daniel Eddeland (Daneeklu), Richard Kettering (Jetrel), Zachariah Husiar (Zabin), Hyptosis, Casper Nilsson, Buko Studios, Nushio, ZaPaper, billknye, William Thompson, caeles, Redshrike, Bertram, and Rayane Félix (RayaneFLX). See CREDITS-terrain.txt. You MUST credit all authors with the information in this file, and you must link back to this page on OpenGameArt.

Experiment 19 - Simple Lights

Note: Input doesn't seem to work? 🤷

In this experiment, we'll take experiment 14 - Animated Sprite and add some simple lighting.

This uses Godot's 2D lighting rather than the blocky shadows of the original demo.

Experiment 19 - Simple Lights

Graphics

  • grass.png - A grass tile, by Invincible.
  • LiberationMono-Bold.ttf - An open source font from the liberationfonts repo; this is licensed under the SIL Open Font License.
  • light.png is from Godot's 2D Lights and Shadows demo.
  • LPC_Sara - Stephen "Redshrike" Challener as graphic artist and William.Thompsonj as contributor. Mandi Paugh is the original artist of Sara and creator of the OGA mascot.

Experiment 20 - LPC Sprite

Note: You can switch animations, but can't move or change facing... I'll have to fix that.

In this experiment, we'll take the LPC Sara animation from experiment 14 and let you cycle through the different animations in the spritesheet. Use WASD or arrow keys to walk around and Space to cycle to the next animation.

Experiment 20 - Animated Sprite

Graphics

  • grass.png - A grass tile, by Invincible.
  • LiberationMono-Bold.ttf - An open source font from the liberationfonts repo; this is licensed under the SIL Open Font License.
  • LPC_Sara - Stephen "Redshrike" Challener as graphic artist and William.Thompsonj as contributor. Mandi Paugh is the original artist of Sara and creator of the OGA mascot.

LPC sprite sheet documentation:

  • Each row is a complete animation cycle.
  • Rows are mostly in groups of four based on facing: away, left, forward, right.
  • Animation rows are: Spellcast, Thrust, Walk, Slash, Shoot, Hurt (only one facing for Hurt).
  • Are 64x64 on the sprite sheet.

Experiment 21 - Blocked Sprite

Note: Another one that doesn't quite work; movement doesn't move.

In this experiment, we'll take experiment 14 - Animated Sprite and add some blocks that restrict movement. I was trying to do this as part of a new lighting Experiment, but it wasn't working, so I decided to simplify a little.

Experiment 21 - Sprite Joystick

Graphics

  • col.png - A column, by mold, resized and cropped to 32x32.
  • grass.png - A grass tile, by Invincible.
  • LiberationMono-Bold.ttf - An open source font from the liberationfonts repo; this is licensed under the SIL Open Font License.
  • LPC_Sara - Stephen "Redshrike" Challener as graphic artist and William.Thompsonj as contributor. Mandi Paugh is the original artist of Sara and creator of the OGA mascot.
Description
Some experiments using the Godot game engine.
Readme 7.2 MiB
Languages
GDScript 100%