This file contains hidden or 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_relative "island_tiles" | |
require "chingu" | |
include Chingu | |
# An area impassable to ships | |
# Other things can be built onto it | |
class Island < GameObjectMap | |
def initialize(options = {}) | |
super(options) |
This file contains hidden or 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
class Bullet < Chingu::GameObject | |
traits :velocity, :bounding_circle | |
trait :animation, :delay => 200, :size => [16,16], :width => 16 | |
def initialize(options = {}) | |
super(options.merge(:image => Image["cannon-ball.png"])) | |
end | |
def update | |
@image = self.animation.next if self.animation |
This file contains hidden or 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 uk.calumgilchrist.ai.pathfinder; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.Iterator; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.PriorityQueue; | |
import org.json.simple.JSONArray; |
This file contains hidden or 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 uk.calumgilchrist.ai.pathfinder; | |
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.Collections; | |
import java.util.Iterator; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.PriorityQueue; | |
import java.util.Random; |
This file contains hidden or 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
[ | |
{ | |
"city1": "Aberdeen", | |
"city2": "Ayr", | |
"weight": 179 | |
}, | |
{ | |
"city1": "Aberdeen", | |
"city2": "Edinburgh", | |
"weight": 129 |
This file contains hidden or 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
import java.io.*; | |
import java.util.Map; | |
import static java.nio.file.Files.newBufferedReader; | |
import static java.nio.file.Paths.get; | |
import static java.nio.charset.Charset.defaultCharset; | |
import org.json.simple.JSONArray; | |
import org.json.simple.JSONObject; | |
import org.json.simple.parser.JSONParser; |
This file contains hidden or 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
#!/usr/bin/env rake | |
# Basic rake file | |
task :default => [:compile] | |
libraries = "-lGL -lGLU -lglut -lm" | |
appName = "initials" | |
includes = "3DCurve.cpp 3DCube.cpp drawHelpers.cpp letters.c display.c mouse.c keyboardHandler.c legs.cpp LegDefinition.cpp scene.c camera.c spider.c thorax.cpp head.cpp abdomen.cpp" | |
desc "Compile sources" |
This file contains hidden or 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
\begin{eqnarray*} | |
&& (\lambda xyz.xyz)(\lambda x.xx)(\lambda x.x)x \\ | |
& \to_\beta & (\lambda yz.xyz)[x := \lambda x.xx](\lambda x.x)x \\ | |
& \equiv & (\lambda yz.(\lambda x.xx)yz)(\lambda x.x)x \\ | |
& \to_\beta & (\lambda yz.(xx)[ x := y]z)(\lambda x.x)x \\ | |
& \equiv & (\lambda yz.yyz)(\lambda x.x)x \\ | |
& \to_\beta & (\lambda z.yy)[ y := \lambda x.x ]x \\ | |
& \equiv & (\lambda z.(\lambda x.x)(\lambda x.x)z)x \\ | |
& \to_\beta & (\lambda z.x[x := \lambda x.x]z)x \\ | |
& \equiv & (\lambda z.(\lambda x.x)z)x \\ |
This file contains hidden or 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
/* | |
* Title: Lightboxer | |
* | |
* AUTHOR: | |
* Calum Gilchrist - http://CalumGilchrist.com | |
* | |
* Description: Creates a simple, light Lightbox for viewing and looking through images, built for Gallerium Image Viewer. | |
* | |
* TODO: | |
* - Make the actual lightboix easier to read, in the code |
This file contains hidden or 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
public Vector3f findStartPoint(Vector3f position, float objHeight) { | |
Vector3f newPos = position.clone(); | |
int center = Math.round(heightMap.getSize() / 2); | |
Vector3f trans = new Vector3f(center, 0, center); | |
position.addLocal(trans); | |
float yHeight = heightMap.getInterpolatedHeight(position.x, position.z) + objHeight; | |