Skip to content

Instantly share code, notes, and snippets.

View Muhammad-Usman-Amin's full-sized avatar
🏠
Working from home

UsmanERA Muhammad-Usman-Amin

🏠
Working from home
View GitHub Profile
@ylegall
ylegall / attractors.py
Created February 19, 2021 00:24
code for animating strange attractors in blender
import bpy
import bmesh
import random
from mathutils import Vector, noise, Matrix
from math import sin, cos, tau, pi, radians
from utils.interpolation import *
from easing_functions import *
frame_start = 1
total_frames = 120
@ditzel
ditzel / MeshDestroy.cs
Created August 19, 2019 19:02
MeshDestroy => Put it on a game object with a mesh filter and renderer. Make sure to have read/write enabled on fbx import
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeshDestroy : MonoBehaviour
{
private bool edgeSet = false;
private Vector3 edgeVertex = Vector3.zero;
private Vector2 edgeUV = Vector2.zero;
@ditzel
ditzel / CameraEffects.cs
Last active October 1, 2023 08:12
Camera Shake Effect. Just put in on the camera and call Shake()
using UnityEngine;
namespace DitzeGames.Effects
{
/// <summary>
/// Camera Effects
/// </summary>
public class CameraEffects : MonoBehaviour
{

Generating Procedural Game Worlds with Wave Function Collapse

Wave Function Collapse (WFC) by @exutumno is a new algorithm that can generate procedural patterns from a sample image. It's especially exciting for game designers, letting us draw our ideas instead of hand coding them. We'll take a look at the kinds of output WFC can produce and the meaning of the algorithm's parameters. Then we'll walk through setting up WFC in javascript and the Unity game engine.

sprites

The traditional approach to this sort of output is to hand code algorithms that generate features, and combine them to alter your game map. For example you could sprinkle some trees at random coordinates, draw roads with a brownian motion, and add rooms with a Binary Space Partition. This is powerful but time consuming, and your original vision can someti