Skip to content

Instantly share code, notes, and snippets.

View Gallefray's full-sized avatar

Finn O'leary Gallefray

  • Wales, Great Britain
View GitHub Profile
## First class polymorphic modules concept
# export module
let pub Renderer = module
let pub render Graphics Scene s =
let camera = Scene.get_cam s in
let objects = Camera.get_vis_objects camera in
for obj in objects
Grahpics.draw_object obj
IDEA
2D Top-down simcity-stronghold crusader-like sandbox game
You have to build and maintain a town beneath the surface.
Materials:
- Wood (building, fuel)
- Stone (building)
- Gold (currency)
local flux = require "flux"
function love.load()
text = { x = 350, y = 290, alpha = 0, str = "900 Tiny Squares" }
squares = {}
-- Title text
flux.to(text, 2, { alpha = 1 }):ease("linear")
:after(text, 2, { alpha = 0 }):ease("linear"):delay(3)
anonymous
anonymous / test.c
Created April 20, 2014 17:45
Generated
void * i;
void func(void * a)
{
if i + 10 * 16 {
a = i;
}
}
private void CheckMapCollisionUp(float _dt)
{
//Extends of the player in worl coordinates
//Stretched by velocity to prevent tunneling
float bottom = gameObject.collider.AABB.Bottom / 2 + (vel.Y < 0 ? -vel.Y * _dt : 0);
float top = gameObject.collider.AABB.Top / 2 + (vel.Y > 0 ? -vel.Y * _dt : 0);
float left = gameObject.collider.AABB.Left / 2 + (vel.X > 0 ? -vel.X * _dt : 0);
float right = gameObject.collider.AABB.Right / 2 + (vel.X < 0 ? -vel.X * _dt : 0);
//Tiles around the player vertically, with some leeway
@antonijn
antonijn / draft_1.cpp
Last active December 27, 2015 04:09
antonijn open-source license
// Copyright (c) <year> <name>
// The antonijn open-source license, draft 1, long form.
//
// The permission for the following is hereby granted, free of charge:
// 1. To use the software as you wish
// 1.1. To use the software for commercial purposes
// 1.2. To dynamically or statically link the software with any other
// software
// 1.3. To dynamically invoke/load software functionality at runtime in
// any other software