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
// | |
// main.m | |
// dupe-detector | |
// | |
// Created by Jonathan Fischer on 1/1/14. | |
// Copyright (c) 2014 Jonathan Fischer. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <CommonCrypto/CommonDigest.h> |
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
;; iphone-template.lisp | |
;; Quicky code to generate an iPhone template for sketching out ideas. | |
;; | |
;; To use it, make sure you have cl-pdf available, e.g. (ql:quickload "cl-pdf"), | |
;; then just run (iphone-template:write-template "/path/to/output.pdf") | |
(require 'cl-pdf) | |
(defpackage :iphone-template | |
(:use :cl) |
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
CL-USER> (test-steinhart-hart) | |
Steinhart-hart coefficients for the ACI/10K-CP curve are: | |
A: 0.0011212672 | |
B: 2.3534849E-4 | |
C: 8.3802405E-8 | |
Resistance: 336450.0 Expected: -40.0 Calculated: -39.999985 | |
Resistance: 242660.0 Expected: -35.0 Calculated: -35.009888 | |
Resistance: 176960.0 Expected: -30.0 Calculated: -30.018707 | |
Resistance: 130410.0 Expected: -25.0 Calculated: -25.02591 |
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
/* My character class handles switching animation frames based on time, whether it's | |
walking, and what direction it's facing. When the time comes to render, it returns | |
an SPImage set up like this. | |
*/ | |
@interface Character : NSObject | |
{ | |
SPImage *_image; // Generic image sprite | |
NSMutableArray *_frames; // array of texture frames | |
int _facing; // North, south, east or west |
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
/* This method gets called with the absolute root object for the whole scene. I then | |
add a few container objects to it. | |
_freeSceneRoot is a bog standard sprite that I just add child sprites to; I just move | |
it around in relation to where the current viewpoint is. Anything that's placed in the | |
game world is added to this (including the _sortedContainer below) | |
_sortedContainer is a customized sprite that sorts its children by their y-coordinate, | |
so things draw in the right order. (Things lower on the screen draw over things higher on | |
the screen) |
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
(defvar *grass-base-color* (list 64 137 44)) | |
(defvar *grass-medium-color* (mapcar (lambda (x) (round (* x 0.9))) *grass-base-color*)) | |
(defvar *grass-dark-color* (mapcar (lambda (x) (round (* x 0.8))) *grass-base-color*)) | |
(defun generate-grass-texture2 (file width height) | |
(let* ((png (make-instance 'zpng:png | |
:color-type :truecolor-alpha | |
:width width | |
:height height)) | |
(image (zpng:data-array png))) |
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
// | |
// TextureAtlas.h | |
// | |
// Created by Jonathan Fischer on 8/10/12. | |
// Copyright (c) 2012 Jonathan Fischer. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@interface AtlasFrame : NSObject |
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
(pdf:with-document () | |
(pdf:with-page (:bounds pdf:*letter-portrait-page-bounds*) | |
(let ((width (elt pdf:*letter-portrait-page-bounds* 2)) | |
(height (elt pdf:*letter-portrait-page-bounds* 3)) | |
(helvetica (make-instance 'pdf:font))) | |
(loop for y from 20 to height by 20 do | |
(pdf:move-to 0 y) | |
(pdf:line-to width y)) | |
(loop for x from 20 to width by 20 do |
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
_stationaryMaria = [[Maria alloc] init]; | |
_stationaryMaria.x = 7.0f * 24.0f; | |
_stationaryMaria.y = 5.0f * 24.0f; |
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
// | |
// CollisionMap.h | |
// MazeGame | |
// | |
// Created by Jonathan Fischer on 2/25/12. | |
// | |
#import <Foundation/Foundation.h> | |
#include "MapCommon.h" | |
@class Path; |