Skip to content

Instantly share code, notes, and snippets.

# nch -- nim-based crappy hellhole
import sdl2, sdl2/gfx, sdl2.image, sdl2.ttf, basic2d, random, math
type
Input {.pure.} = enum none, quit, action
InputState {.pure.} = enum up, pressed, down, released
Game = ref object
input: array[Input, bool]
inputLast: array[Input, bool]
-- 11matches
module App exposing (..)
import Html exposing (..)
import Html.Attributes exposing (class, disabled)
import Html.Events exposing (onClick, onMouseDown, onMouseUp)
import Time exposing (Time, second)
module App exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick)
import Time exposing (Time, second)
-- MODEL
@rezich
rezich / citylib.cpp
Created March 3, 2017 20:30
Game Maker DLL example with state preserved between calls
#include <stdlib.h>
#define GMEXPORT extern "C" __declspec(dllexport)
struct City {
int population;
};
City *city;
GMEXPORT double city_init() {
@rezich
rezich / main.rs
Created January 5, 2017 20:46
learning Rust by making a game
/*
I'm learning Rust by making a game.
This game would be very simple to make, unsafely, in C/C++,
and I'm hoping that by making it in Rust, I'll learn the core concepts
of ownership and such.
But right now, I'm stuck.
Here's what I'm *trying* to do, in C++:

Keybase proof

I hereby claim:

  • I am adamrezich on github.
  • I am adamrezich (https://keybase.io/adamrezich) on keybase.
  • I have a public key whose fingerprint is 6FB9 D650 3CF3 8475 6730 3059 935F 087E 785F A003

To claim this, I am signing this object:

@rezich
rezich / nbajam.json
Created August 22, 2015 20:38
NBA Jam (arcade, v4.0) player stats in JSON form
[
{
"team": "Boston Celtics",
"name": "Xavier McDaniel",
"speed": 5,
"threePoint": 5,
"dunk": 5,
"pass": 1,
"power": 8,
"steal": 3,