Skip to content

Instantly share code, notes, and snippets.

@CowThing
CowThing / pixel_perfect.gd
Last active April 6, 2024 17:09
Pixel perfect scaling script for Godot 3.1
extends Node
"""
An autoload singleton for pixel perfect rendering of the game.
Set this script as an autoload.
`base_size` - Is the target size of the viewport. The viewport will scale up to fit the largest
possible integer multiple of this size within the window.
`expand` - If true the viewport will expand to the edges of the window after scaling up.
@ficoos
ficoos / combo.py
Last active August 23, 2021 01:54
Simple combo handling code
# simple combo handling code
import collections
# priority is just a number used to decide
# what move was made when more than 1
# move is validated by the same input.
PriorityLow = 99
PriorityHigh = 1
@Calinou
Calinou / CHANGELOG.md
Last active May 25, 2023 19:07
Godot 4.0 preliminary changelog (does not list changes that were also backported to Godot 3.x)

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog.

[4.0] - TBD

Added

@EIREXE
EIREXE / Godot Minimap.md
Last active April 1, 2022 09:35
Automatic minimap generation in godot

Building an automated map/minimap system in Godot

Why?

Our game, ERO-ONE needed a minimap system, it being an open world game made this a necessity, otherwise the player wouldn't really know where he's going.

Of course making a proper minimap is hard, we told ourselves that our game didn't really need it because it's not as big as the open world powerhouse that is Grand Theft Auto, but the real reasons are...

extends Sprite
var grid_size = 32
var speed = 64 # speed in pixels per second
var direction = Vector2(1, 0) # move in positive x direction, adapt this in your code for other directions
var is_moving = false
var moved_dist # keep track of how much we already moved
func _fixed_process(delta):
if Input.is_action_pressed("myInputAction") and !is_moving: