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
bitbrain / godot4_tilemap_tricks.gd
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 = TileSetAtlasSource.new()
source.texture = texture
source.texture_region_size = Vector2i(tile_size, tile_size)
source.create_tile(Vector2i(0, 0))
return tileset.add_source(source)
@bitbrain
bitbrain / fmod-gdextension-errors
Last active August 11, 2022 02:59
A few linker errors when trying to compile fmod gdextension
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
link /nologo /WX /dll /out:bin\libGodotFmod.windows.release.64.dll /implib:bin\libGodotFmod.windows.release.64.lib /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 libgodot-cpp.windows.release.64.lib fmod_vc.lib fmodstudio_vc.lib src\godot_fmod.obj src\register_types.obj src\callback\event_callbacks.obj src\callback\file_callbacks.obj
libgodot-cpp.windows.release.64.lib(Variant.obj) : error LNK2005: "public: __cdecl godot::Variant::Variant(int)" (??0Variant@godot@@QEAA@H@Z) already defined in godot_fmod.obj
libgodot-cpp.windows.release.64.lib(Variant.obj) : error LNK2005: "public: __cdecl godot::Variant::Variant(unsigned int)" (??0Variant@godot@@QEAA@I@Z) already defined in godot_fmod.obj
libgodot-cpp.windows.release.64.lib(Variant.obj) : error LNK2005: "pu
@bitbrain
bitbrain / DayNightCycle.gd
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
bitbrain / config
Created April 23, 2019 16:51
A sample .git/config file
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
ignorecase = true
[remote "origin"]
url = git@github.com:bitbrain/itch-i18n.git
fetch = +refs/heads/*:refs/remotes/origin/*
[remote "fork"]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
[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 [http://nexus.k40s.net ]: com.sun.jersey.api.client.ClientHandlerException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: 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 'game.zip'
  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: itch.io API error: invalid key

What shall I do?

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) {
tmp.set(camera.up);
tmp.crs(camera.direction);
tmp.nor();
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 = tmp.dot(new Vector3(lenX, lenY, lenZ));
return MathUtils.clamp(clampX / MAX_PAN_DISTANCE, -1f, 1f);
/* Rotating cube with color interpolation */
#include <stdlib.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif