Skip to content

Instantly share code, notes, and snippets.

using Godot;
using Leopotam.EcsLite;
public class Game : Godot.YSort
{
public EcsWorld world;
public EcsSystems systems;
public override void _Ready()
{
@rossimo
rossimo / animate.tsx
Last active October 29, 2017 10:05
Design for React Games
import * as Rx from 'rxjs/Rx';
import * as tween from 'tween-functions'
import * as update from 'immutability-helper'
import { call, take, Func1, CallEffectFn } from 'redux-saga/effects'
import { eventChannel, END } from 'redux-saga'
import * as _ from 'lodash'
export let tick = new Rx.Subject();
export let draw = new Rx.Subject<State>();
import * as api from '../api'
api.events.once('ready', async () => {
await api.loadResource('wizard', 'wizard.png');
api.setGraph({
nodes: [
{ name: 'city', x: 2, y: 2 },
{ name: 'gate', x: 4, y: 2 },
{ name: 'tower', x: 7, y: 2 },
[2017-05-09 @ 18:37:25.915] [itch] itch 23.4.1 on electron 1.6.2
[2017-05-09 @ 18:37:26.323] [xdg-mime] non-linux platform, skipping xdg-mime
[2017-05-09 @ 18:37:26.323] [preboot] Set up certificate error handler
[2017-05-09 @ 18:37:26.340] [preboot] No proxy detected
[2017-05-09 @ 18:37:26.361] [reactors/setup] setup starting
[2017-05-09 @ 18:37:26.362] [ibrew] Augmenting $PATH: /Users/ross.squires/Library/Application Support/itch/bin/unarchiver
[2017-05-09 @ 18:37:26.389] [locales] Waiting a bit before downloading en locale...
[2017-05-09 @ 18:37:26.403] [preferences] while importing preferences: Error: ENOENT: no such file or directory, open '/Users/ross.squires/Library/Application Support/itch/preferences.json'
[2017-05-09 @ 18:37:26.403] [preferences] imported preferences:
[2017-05-09 @ 18:37:26.406] [reactors/open-at-login] Updating login item settings, open: false, hidden: false
@rossimo
rossimo / loop.kt
Created November 20, 2016 15:04
Event Loop
package demo
var console = System.out
data class State(val map: Array<Array<Int>>, val entities: List<Entity>)
fun State.update(enitity: Entity, transform: (Entity) -> Unit): State {
this.entities
.find { it == enitity }
?.apply { transform(this) }
@rossimo
rossimo / loopback.d.ts
Created October 24, 2016 17:16
Loopback Typescript Definition
/** Declaration file generated by dts-gen */
declare module "loopback" {
export = Loopback;
}
declare function Loopback(options: any, ...args: any[]): any;
declare namespace Loopback {
class ACL {
constructor(data: any, options: any, ...args: any[]);