Skip to content

Instantly share code, notes, and snippets.

View Riordan-DC's full-sized avatar
💀
ive turned myself into a skull oh no

Riordan-DC

💀
ive turned myself into a skull oh no
View GitHub Profile
@Riordan-DC
Riordan-DC / rips.py
Last active May 27, 2023 08:37
Resizing Images Python Script
from PIL import Image, ImageOps
import argparse
import os
"""
Resizing Images Python Script
Author: Riordan Callil 2023 (riordancallil@outlook.com)
Main uses:
- resizing a bunch of images for game development. Source images can be very large, i.e. 4K
@Riordan-DC
Riordan-DC / fpv.shader
Last active January 25, 2024 02:01
First Person View Model Shader (Godot Shader Language)
shader_type spatial;
render_mode depth_draw_opaque,cull_back;
uniform float fov : hint_range(20, 120) = 40;
const float M_PI = 3.14159265359;
void vertex() {
// recreate the camera projection matrix with our custom fov value
float scale = 1.0 / tan(fov * 0.5 * M_PI / 180.0);
PROJECTION_MATRIX[0][0] = scale / (VIEWPORT_SIZE.x / VIEWPORT_SIZE.y);
@Riordan-DC
Riordan-DC / 2d_platformer_actor.gd
Created September 20, 2023 03:31
Precision Platformer Controller for Godot 3.x (coyote time + prejump)
class_name Actor
extends KinematicBody2D
# Input
var pressing_jump = false
var pressing_attack = false
var input_direction = Vector2.ZERO
# Movement constants
export var jump_height = 100