Skip to content

Instantly share code, notes, and snippets.

@lolriven
lolriven / ripple.shader
Created December 12, 2023 01:09 — forked from gkaizer1/ripple.shader
Unity example of ripple effect
Shader "Unlit/ripple_shader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_amount ("_amount", Range(0.01, 1.0)) = 0.5
_spread ("_spread", Range(0.01, 1.0)) = 0.5
_width ("_width", Range(0.01, 1.0)) = 0.5
_alpha ("_alpha", Range(0.01, 1.0)) = 0.5
@lolriven
lolriven / celeste.lua
Created December 3, 2023 05:04 — forked from sherjilozair/celeste.lua
Source code for pico-8 version of Celeste
-- ~celeste~
-- matt thorson + noel berry
-- globals --
-------------
room = { x=0, y=0 }
objects = {}
types = {}
freeze=0
Readme: In the following pseudo code, [] indicates a subroutine.
Sometimes I choose to write the subroutine inline under the [] in order to maintain context.
One important fact about the way rollbacks are handled here is that we are storing state for every frame.
In any real implementation you only need to store one game state at a time. Storing a game
state for every frame allows us to only rollback to the first frame where the predicted inputs don't match the true ones.
==Constants==
MAX_ROLLBACK_FRAMES := Any Positive Integer # Specifies the maximum number of frames that can be resimulated
FRAME_ADVANTAGE_LIMIT := Any Positive Integer # Specifies the number of frames the local client can progress ahead of the remote client before time synchronizing.
@lolriven
lolriven / BBox.cpp
Created April 8, 2023 18:04 — forked from dubik/BBox.cpp
// Vectormath https://github.com/erwincoumans/sce_vectormath
class Ray
{
public:
Ray();
public:
Vectormath::Aos::Vector3 m_pos;
Vectormath::Aos::Vector3 m_dir;
Vectormath::Aos::Vector3 m_invDir; // 1.0f / m_dir per elem
float m_min;
@lolriven
lolriven / RayCollisions.c
Created March 31, 2022 17:01 — forked from Pikachuxxxx/RayCollisions.c
A Function to Detect Collisions Between a Ray and a Rectangle and Dynamic Rectangle and a Rectangle in Raylib Environment
#include <stdio.h>
#include <raylib.h>
/*
* define this macro RAY_COLLISION_CALCULATION_DEBUG_STATS
* if you want to enable the ray collision calculations printed as debug data
*/
// helper functions
void SwapFloatValue(float *a, float *b){
@lolriven
lolriven / uninstall_vmware.sh
Created January 24, 2022 14:49 — forked from boneskull/uninstall_vmware.sh
completely uninstall vmware on mac
#!/usr/bin/env bash
# Usage: bash uninstall_vmware.bash
remove() {
entry="$1"
echo -ne "Removing \e[1;34m$entry\e[0m... "
sudo rm -rf "$entry" &> /tmp/uninstall-vmware.log
if [[ ! -e "$entry" ]]; then
echo -e "\e[1;32mOK\e[0m"