All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
/** | |
* ObjectPool is a type building macro to create array-of-structure or structure-of-array pools. | |
* With the intention being to improve access performance, both in CPU cache coherence and by avoiding the GC | |
* | |
* This implementation is a minimal working proof of concept | |
* | |
* Improvements you may want to make | |
* - Support deallocation of instances and space reclaiming | |
* - Replace haxe.io.Bytes because field access has overhead | |
* |
(() => { | |
let errorDisplayEl = document.createElement('div'); | |
errorDisplayEl.classList.add('error-display'); | |
errorDisplayEl.style.display = 'none'; | |
errorDisplayEl.style.position = 'absolute'; | |
errorDisplayEl.style.zIndex = '2000'; | |
errorDisplayEl.style.backgroundColor = 'rgba(146, 0, 0, 0.6)'; | |
errorDisplayEl.style.padding = '20px'; | |
errorDisplayEl.style.fontFamily = 'monospace, sans-serif'; | |
errorDisplayEl.style.color = '#fff5f5'; |
package macros; | |
#if macro | |
import haxe.DynamicAccess; | |
import Types.DepotFile; | |
import sys.io.File; | |
import sys.FileSystem; | |
import haxe.macro.Expr.Field; | |
import haxe.Json; | |
import haxe.macro.Context; |
#if macro | |
import haxe.macro.Context; | |
import haxe.macro.PositionTools; | |
import haxe.macro.Expr; | |
import haxe.macro.ComplexTypeTools; | |
#end | |
/** | |
Pass in a boolean expression, if test fails (expression evaluates to false) the expression itself will be printed with the line number and failure reason |
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
# Copyright © 2017 Hugo Locurcio and contributors - MIT license | |
# See LICENSE.md included in the source distribution for more information. | |
extends Camera | |
const MOVE_SPEED = 0.5 | |
const MOUSE_SENSITIVITY = 0.002 | |
onready var speed = 1 | |
onready var velocity = Vector3() | |
onready var initial_rotation = PI/2 |
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.
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
import haxe.macro.Context; | |
import haxe.macro.Expr; | |
import haxe.macro.TypeTools; | |
#if !macro | |
@:genericBuild(PartialMacro.build()) | |
#end | |
class Partial<T> {} | |
class PartialMacro { |
class KeyValueIterator<K,V> { | |
var map:Map<K,V>; | |
var keys:Iterator<K>; | |
static public inline function pairs<K,V>(map:Map<K,V>) return new KeyValueIterator(map); | |
public inline function new(map:Map<K,V>) { | |
this.map = map; | |
this.keys = map.keys(); | |
} |
-- pico-8 starter code | |
-- by @hypirlink | |
-- _init() is called when | |
-- you 'run' the program | |
function _init() | |
-- states: menu, game, end | |
state = "menu" | |
end |