Skip to content

Instantly share code, notes, and snippets.

View bitbrain's full-sized avatar
Forging an RPG

miguel bitbrain

Forging an RPG
View GitHub Profile
bitbrain /
Last active November 14, 2022 17:27
Godot 4 Tilemap tricks
## Registers a tile with the tilemap that can then be placed
## via tile_map.set_cell(layer_index, map_coord, tile_id, Vector2i(0, 0))
func register_tile_and_get_id(tile_map:TileMap, texture:Texture2D, tile_size:int) -> int:
var tileset = tile_map.tile_set
var source =
source.texture = texture
source.texture_region_size = Vector2i(tile_size, tile_size)
source.create_tile(Vector2i(0, 0))
return tileset.add_source(source)
bitbrain / fmod-gdextension-errors
Last active August 11, 2022 02:59
A few linker errors when trying to compile fmod gdextension
View fmod-gdextension-errors
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
link /nologo /WX /dll /out:bin\ /implib:bin\ /LIBPATH:C:\Users\Miguel\git\fmod-project\godot-cpp\bin /LIBPATH:C:\Users\Miguel\git\fmod-project\libs\fmod\windows\core\lib\x64 /LIBPATH:C:\Users\Miguel\git\fmod-project\libs\fmod\windows\studio\lib\x64 fmod_vc.lib fmodstudio_vc.lib src\godot_fmod.obj src\register_types.obj src\callback\event_callbacks.obj src\callback\file_callbacks.obj : error LNK2005: "public: __cdecl godot::Variant::Variant(int)" (??0Variant@godot@@QEAA@H@Z) already defined in godot_fmod.obj : error LNK2005: "public: __cdecl godot::Variant::Variant(unsigned int)" (??0Variant@godot@@QEAA@I@Z) already defined in godot_fmod.obj : error LNK2005: "pu
bitbrain /
Last active October 17, 2023 17:12
A gd script implementing a day night cycle using maths only.
extends CanvasModulate
const NIGHT_COLOR = Color("#091d3a")
const DAY_COLOR = Color("#ffffff")
const EVENING_COLOR = Color("#ff3300")
const TIME_SCALE = 0.1
var time = 0
bitbrain / config
Created April 23, 2019 16:51
A sample .git/config file
View config
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
url =
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "fork"]
View dafuq.xml
View gist:7046666424ef03645a03b136e28505ee
[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.3:deploy (injected-nexus-deploy) on project braingdx: Execution injected-nexus-deploy of goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.3:deploy failed: Nexus connection problem to URL [ ]: com.sun.jersey.api.client.ClientHandlerException: PKIX path validation failed: timestamp check failed: NotAfter: Tue May 16 10:22:00 UTC 2017 -> [Help 1]

Hi Amos, I'm currently implementing auto-deployment for a game. For this I wrote a deployment script which does the following:

  1. Build the game
  2. Zip it as ''
  3. Download butler executable
  4. Read itch API token from Environment and save it into temporary butler_creds file (set in Travis CI or locally)
  5. Login into butler via butler login -i "butler_creds"
  6. Itch IO claims: API error: invalid key

What shall I do?

View PointerLockControls.js
THREE.PointerLockControls = function ( camera ) {
var scope = this;
camera.rotation.set( 0, 0, 0 );
var pitchObject = new THREE.Object3D();
pitchObject.add( camera );
var yawObject = new THREE.Object3D();
private float calculatePanning(Vector3 position) {
if (camera != null) {
final float lenX = camera.position.x - position.x;
final float lenY = camera.position.y - position.y;
final float lenZ = camera.position.z - position.z;
final float clampX = Vector3(lenX, lenY, lenZ));
return MathUtils.clamp(clampX / MAX_PAN_DISTANCE, -1f, 1f);
View assessment3.2.cpp
/* Rotating cube with color interpolation */
#include <stdlib.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#include <GL/glut.h>