Skip to content

Instantly share code, notes, and snippets.

View homelinen's full-sized avatar

Calum Gilchrist homelinen

View GitHub Profile
package Oxyfps;
import com.jme3.input.InputManager;
import com.jme3.input.KeyInput;
import com.jme3.input.MouseInput;
import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.KeyTrigger;
import com.jme3.input.controls.MouseButtonTrigger;
public class InputController implements ActionListener {
/**
* Monitors projectiles and whether they should be
* destroyed or not
* @author homelinen
*
*/
public class ProjectileGarbageCollector implements PhysicsCollisionListener{
String worldName;
@homelinen
homelinen / movieTransform1.xsd
Created March 29, 2012 21:10
Over the Top XPath Transform
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="actorKey" match="person" use="@aID"/>
<xsl:template match="/">
<html>
<head>
<title>Movies</title>
</head>
<body>
<h1>Profit of Films Starring Jessica Alba</h1>
@homelinen
homelinen / testing.md
Created March 28, 2012 20:00
Test file for some coursework

#Testing

5 inputs

  1. 3 4 5 - Expect: Right angled, scalene
  2. 1 12 11 - Expect Scalene, obtuse
  3. 4 7 100 - Expect: Not a Trianlge
  4. 1 1 2 - Expect Isosceles, right angled
  5. 6 6 6 - Expect Equilateral, acute
@homelinen
homelinen / movies.xsd
Created March 22, 2012 20:37
My Horrible XML Schema File
<?xml version="1.0" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- Structure -->
<xs:element name="movieReviews">
<xs:complexType>
<xs:sequence>
<!--Movies-->
<xs:element name="movies">
@homelinen
homelinen / queryResults.txt
Created February 28, 2012 13:44
List of Queries and results for database coursework.
1. View the payments for a specific year and month
select * from pay where (extract(month from dateOfPayment) = "02" and extract(year from dateOfPayment) = "2012");
+-----------+------------+---------------+-------------+-----------------+-------+-----------+
| paymentID | employeeID | dateOfPayment | hoursWorked | commissionSales | bonus | contactID |
+-----------+------------+---------------+-------------+-----------------+-------+-----------+
| 2 | 1 | 2012-02-01 | 0 | 0 | 1000 | NULL |
| 4 | 2 | 2012-02-01 | 40 | 0 | 50 | NULL |
| 8 | 3 | 2012-02-02 | 20 | 1 | 0 | NULL |
@homelinen
homelinen / comedySetup.sql
Created February 25, 2012 14:53
SQL File to setup the comedyclub database. Some insert statements need fixed, and relations.
--
-- Database: `comedyclub`
--
-- --------------------------------------------------------
--
-- Table structure for table `agent`
--
@homelinen
homelinen / explore.c
Created February 18, 2012 15:31
Simple Command Line Game
/**
* File: Explore
*
* Description:
* Simple command line navigation system.
*
* Author: Calum Gilchrist
*
**/
@homelinen
homelinen / findChasePath.java
Created January 26, 2012 21:12
Method For finding the chase path for an enemy in a maze game
/**
* Use A* algorithm to find the best path to the playerPos
* in the maze: theMaze.
* @param playerPos
* @param theMaze
*/
public void findChasePath(Point playerPos, Maze theMaze) {
Point current;
int cost=0;
@homelinen
homelinen / KeyboardInput.java
Created September 25, 2011 16:30
My absolutely horrible keyBoard inut method.
/**
* Check the keyboard input and set the player to move
*/
public void keyboardInput() {
int playerx = thePlayer.getxPos() /theDisplay.getCellWidth();
int playery = thePlayer.getyPos() / theDisplay.getCellHeight();
if (theInputManager.isAnyKeyPressed()) {