Skip to content

Instantly share code, notes, and snippets.

@andrew-git
andrew-git / gist:5c53656e1c1ef035797dafada2422ac6
Created June 14, 2024 10:09 — forked from adamnemecek/gist:ae2755c5c4eaabd0d864e6c62dbe5088
Overview of Entity Component System (ECS) variations with pseudo-code

For background and further references see: Entity Component Systems on Wikipedia

ECS by Scott Bilas (GDC 2002)

Entity->Components->Update
  • entity = class: no logic + no data OR at most small set of frequently used data (ie position)
  • component = class: logic + data
foreach entity in allEntities do
    foreach component in entity.components do
@andrew-git
andrew-git / SteamBuild.cs
Created March 11, 2023 10:02 — forked from Marc-Ducret/SteamBuild.cs
Automate build and deploy to Steam
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using DiceKingdoms.Meta;
using UnityEngine;
using Unity.Build;
using UnityEditor;
@andrew-git
andrew-git / CPPRandomSeed.hx
Last active March 9, 2021 16:26 — forked from player-03/CPPRandomSeed.hx
Seed the random number generator in C++.
@:cppInclude('time.h')
class CPPRandomSeed {
public static function seed() {
#if cpp
untyped __cpp__('srand48(time(NULL))');
#end
}
}
@andrew-git
andrew-git / gist:44f831631783defe9ebf
Created October 30, 2015 11:27 — forked from neuronix/gist:473a38d9fa14690b863f
Creating iOS certificates (.p12) for Adobe AIR on Windows with OpenSSL
:: Creating iOS certificates on windows for Adobe AIR
:: Install OpenSSL: https://www.openssl.org/source/
:: 1. Use cmd to get to openssl bin folder
:: 2. run openssl
:: 3. in openssl console: genrsa -out ios_distribution.key 2048
:: 4. in openssl console: req -new -key ios_distribution.key -out CertificateSigningRequest_distribution.certSigningRequest -subj "/emailAddress=<your@email.com>, CN=<YourCompany>, C=<CountryCode:FR>"
:: 5. repeat 4. with "_development" instead of "_distribution"
:: 6. Use both CSR requests on itunes portal to generate the certificate files (.cer)
:: 7. Use this .bat to generate the .p12 files
:: Bonus. Same process to generate push certificates
class Main extends Sprite
{
private var doneFrame:Bool;
public function new()
{
super();
doneFrame = false;
graphics.beginFill(0xff5555);
package {
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import starling.core.RenderSupport;
import starling.core.Starling;
import starling.display.DisplayObject;
import flash.Lib;
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.BitmapData;
import openfl.Assets;
import openfl.display.Tilesheet;
import flash.display.Graphics;
import flash.events.Event;
class Particle