Skip to content

Instantly share code, notes, and snippets.

View paytonrules's full-sized avatar

Eric Smith paytonrules

View GitHub Profile
require 'nokogiri'
system 'unzip Alliance.docx'
doc = Nokogiri::XML(open('word/document.xml'))
# Using Label Tag
doc.xpath("//w:fldSimple[contains(@w:instr, 'label_tag')]").each do |link|
command = link.attributes["instr"].value.match(/\#\{(.*)\}/)[1]
replacement_string = eval(command)
element.replace(Nokogiri::XML::Text.new(replacement_string, doc))
// Init the window
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// cocos2d will inherit these values
[window setUserInteractionEnabled:YES];
[window setMultipleTouchEnabled:YES];
// must be called before any othe call to the director
// WARNING: FastDirector doesn't interact well with UIKit controls
// [Director useFastDirector];
-(void) initializeDirectorWithScene:(Scene *) scene
{
// before creating any layer, set the landscape mode
// Initialize Director
[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];
[[Director sharedDirector] setAnimationInterval:1.0/60];
[[Director sharedDirector] setDisplayFPS:YES];
// create an openGL view inside a window
[[Director sharedDirector] attachInView:window];
-(void) initializeDirector
{
// before creating any layer, set the landscape mode
// Initialize Director
[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];
[[Director sharedDirector] setAnimationInterval:1.0/60];
[[Director sharedDirector] setDisplayFPS:YES];
// create an openGL view inside a window
-(void) testRunsWithGameScene
{
MockProducer *producer = [[[MockProducer alloc] init] autorelease];
MadBomberAppDelegate *delegate = [[[MadBomberAppDelegate alloc] init] autorelease];
delegate.producer = producer;
[delegate applicationDidFinishLaunching: nil];
STAssertEquals([producer.initialScene class], [[GameScene scene] class], nil);
STAssertEqualObjects(producer.initialWindow, delegate.window, nil);
-(void) initializeDirector
{
[producer initializeDirectorWithWindow:window scene:[GameScene scene]];
// before creating any layer, set the landscape mode
// Initialize Director
[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];
[[Director sharedDirector] setAnimationInterval:1.0/60];
[[Director sharedDirector] setDisplayFPS:YES];
# In App Delegate
-(void) initializeDirector
{
[self.producer initializeDirectorWithWindow:window scene:[GameScene scene]];
}
# In my Producer Object
-(void) initializeDirectorWithWindow:(UIWindow *) window scene:(Scene *) scene
{
[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];
-(void) initializeDirector
{
[[Director sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];
[[Director sharedDirector] setAnimationInterval:1.0/60];
[[Director sharedDirector] setDisplayFPS:YES];
// create an openGL view inside a window
[[Director sharedDirector] attachInView:window];
[[Director sharedDirector] runWithScene: [GameScene scene]];
657 void callback() {
658 // Lift = R(0, 1, 0) |K| (sin theta)
659 // Drag = -K (sin theta)
660 // Where theta is the angle between w (planes direction) and K
661 // This should be direction of - not velocity -
662 // You've got velocity * R (the rotation) u = R(velocity)
663 // K ends up as the actual direction of motion
664 // plane->K + plane->R * Vector(0, 0, +1) Add a constant
665 if (engineSpeed != 0) {
666 // Apply Thrust
So I upgraded XCode
Which caused my build to fail
Which required upgrading Xamarin
Which caused my program to build, but crash
Which requires manually building monomac