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
// require() some stuff from npm (like you were using browserify) | |
// and then hit Run Code to run it on the right | |
var Crafty = require('craftyjs'); | |
Crafty.init(600, 300); | |
Crafty.background('rgb(127,127,127)'); | |
//Paddles | |
paddlea = Crafty.e("Paddle, 2D, WebGL, Color, Multiway") | |
.attr({ x: 20, y: 100, w: 10, h: 100 }) |
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
package main | |
// Build cross-compiles packages on set of | |
// OS and architecture pairs. | |
import ( | |
"bytes" | |
"flag" | |
"fmt" | |
"os" |
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
All public gists https://gist.github.com/200sc | |
Copyright 2017, Patrick Stephen | |
MIT License, http://www.opensource.org/licenses/mit-license.php |
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
package main | |
import ( | |
"bitbucket.org/oakmoundstudio/plasticpiston/plastic" | |
"bitbucket.org/oakmoundstudio/plasticpiston/plastic/collision" | |
"bitbucket.org/oakmoundstudio/plasticpiston/plastic/entities" | |
"bitbucket.org/oakmoundstudio/plasticpiston/plastic/event" | |
"bitbucket.org/oakmoundstudio/plasticpiston/plastic/render" | |
"image/color" | |
"math/rand" |
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
package main | |
import ( | |
"image/color" | |
"time" | |
"github.com/200sc/go-dist/floatrange" | |
"bitbucket.org/oakmoundstudio/oak" | |
"bitbucket.org/oakmoundstudio/oak/collision" |
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
package main | |
// This is a gist copy of https://github.com/200sc/collision-demo/blob/master/core.go | |
import ( | |
"image/color" | |
"bitbucket.org/oakmoundstudio/oak" | |
"bitbucket.org/oakmoundstudio/oak/collision" | |
"bitbucket.org/oakmoundstudio/oak/entities" |
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
func GetHoles(sh Shape, w, h int) [][]intgeom.Point { | |
flooding := make(map[intgeom.Point]bool) | |
for x := 0; x < w; x++ { | |
for y := 0; y < h; y++ { | |
if !sh.At(x, y) { | |
flooding[intgeom.Point{x,y}] = true | |
} | |
} |
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
package render | |
func Recolor(cMap[color.Color]color.Color) Modification { | |
return func(rgba image.Image) *image.RGBA { | |
bds := rgba.Bounds() | |
newRgba := image.NewRGBA(bds) | |
for x := 0; x < bds.Max.X; x++ { | |
for y :=0; y < bds.Max.Y; y++ { |
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
package main | |
import ( | |
"encoding/csv" | |
"fmt" | |
"os" | |
"strconv" | |
) | |
type Record struct { |
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
package main | |
import ( | |
"encoding/csv" | |
"flag" | |
"fmt" | |
"io" | |
"os" | |
"path/filepath" | |
"strings" |
OlderNewer