This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void * i; | |
void func(void * a) | |
{ | |
if i + 10 * 16 { | |
a = i; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |