Skip to content

Instantly share code, notes, and snippets.

@AndreaCatania
AndreaCatania / godot_expose_utils.h
Last active June 2, 2023 15:53
Header that defines some utility macro that allows to expose C++ class parameters to Godot editor.
/// This file is an utility to avoid write the same code over and over to expose
/// the variables in Godot.
/// To use it you can include this into your header, and use `SETGET` to define
/// the variable you want to expose:
/// ```
/// #include "scene/3d/node_3d.h"
/// #include "godot_expose_utils.h"
///
/// class TestNode : public Node {
/// GDCLASS(TestNode, Node);
@GameDragon2k
GameDragon2k / ESP32_BLE_Arcade.ino
Last active February 15, 2023 08:47
NodeMCU-32S Game Pad
/*
Video: https://www.youtube.com/watch?v=oCMOYS71NIU
Based on Neil Kolban example for IDF: https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLE%20Tests/SampleNotify.cpp
Ported to Arduino ESP32 by Evandro Copercini
Gamepad coding by Game Dragon
*/
#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
@Jellybit
Jellybit / CameraControl.cs
Last active September 4, 2023 04:23
Super Metroid style camera for Unity3D.
using UnityEngine;
using System.Collections;
// This is basically how the Super Metroid camera worked. Whichever direction you moved, the camera would
// move in the same direction a multiple of the player's speed. Once the center of the camera moved a
// certain distance from the player, the camera would lock on the player and move the same speed. Change
// movement direction, and the camera would once again move more quickly to catch up and place itself
// ahead of the player's movement.
// Super Metroid also had area limits and locked certain axes based on where you were. For instance, if