Commits

Anonymous committed 6ddde1b

Har fået en masse til at virke

Comments (0)

Files changed (16)

acceler/acceler.xcodeproj/tau.mode1v3

 							<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
 							<array>
 								<array>
-									<integer>7</integer>
+									<integer>3</integer>
 									<integer>1</integer>
 									<integer>0</integer>
 								</array>
 								<key>PBXProjectModuleGUID</key>
 								<string>1CE0B20306471E060097A5F4</string>
 								<key>PBXProjectModuleLabel</key>
-								<string>accelerViewController.m</string>
+								<string>Calc.m</string>
 								<key>PBXSplitModuleInNavigatorKey</key>
 								<dict>
 									<key>Split0</key>
 										<key>PBXProjectModuleGUID</key>
 										<string>1CE0B20406471E060097A5F4</string>
 										<key>PBXProjectModuleLabel</key>
-										<string>accelerViewController.m</string>
+										<string>Calc.m</string>
 										<key>_historyCapacity</key>
 										<integer>0</integer>
 										<key>bookmark</key>
-										<string>43589A1511F887AE00F1E55B</string>
+										<string>43D78FF8120326FF007C91FB</string>
 										<key>history</key>
 										<array>
 											<string>438B640D116A4AEE0062418C</string>
-											<string>438B660D116A856E0062418C</string>
-											<string>438B660E116A856E0062418C</string>
-											<string>437E98491175FB5900866F8D</string>
-											<string>437E984A1175FB5900866F8D</string>
-											<string>437E9AFE117CC2A000866F8D</string>
-											<string>43589A1411F887AE00F1E55B</string>
+											<string>43D78FE6120326FF007C91FB</string>
+											<string>43D78FE7120326FF007C91FB</string>
+											<string>43D78FE8120326FF007C91FB</string>
+											<string>43D78FE9120326FF007C91FB</string>
+											<string>43D78FEA120326FF007C91FB</string>
+											<string>43D78FEB120326FF007C91FB</string>
 										</array>
 										<key>prevStack</key>
 										<array>
 											<string>438B63FD116A49B30062418C</string>
 											<string>438B642A116A4F2D0062418C</string>
 											<string>438B642B116A4F2D0062418C</string>
+											<string>43D78FEC120326FF007C91FB</string>
+											<string>43D78FED120326FF007C91FB</string>
+											<string>43D78FEE120326FF007C91FB</string>
+											<string>43D78FEF120326FF007C91FB</string>
+											<string>43D78FF0120326FF007C91FB</string>
+											<string>43D78FF1120326FF007C91FB</string>
+											<string>43D78FF2120326FF007C91FB</string>
+											<string>43D78FF3120326FF007C91FB</string>
+											<string>43D78FF4120326FF007C91FB</string>
+											<string>43D78FF5120326FF007C91FB</string>
+											<string>43D78FF6120326FF007C91FB</string>
+											<string>43D78FF7120326FF007C91FB</string>
 										</array>
 									</dict>
 									<key>SplitCount</key>
 			</array>
 			<key>TableOfContents</key>
 			<array>
-				<string>43589A1611F887AE00F1E55B</string>
+				<string>43D78FF9120326FF007C91FB</string>
 				<string>1CE0B1FE06471DED0097A5F4</string>
-				<string>43589A1711F887AE00F1E55B</string>
+				<string>43D78FFA120326FF007C91FB</string>
 				<string>1CE0B20306471E060097A5F4</string>
 				<string>1CE0B20506471E060097A5F4</string>
 			</array>

acceler/acceler.xcodeproj/tau.pbxuser

 		uiCtxt = {
 			sepNavIntBoundsRect = "{{0, 0}, {779, 1246}}";
 			sepNavSelRange = "{1719, 87}";
-			sepNavVisRange = "{1371, 810}";
+			sepNavVisRange = "{0, 737}";
 			sepNavWindowFrame = "{{15, 315}, {750, 558}}";
 		};
 	};
 					PBXFileDataSource_Target_ColumnID,
 				);
 			};
-			PBXPerProjectTemplateStateSaveDate = 301500330;
-			PBXWorkspaceStateSaveDate = 301500330;
+			PBXPerProjectTemplateStateSaveDate = 302196453;
+			PBXWorkspaceStateSaveDate = 302196453;
 		};
 		perUserProjectItems = {
-			43589A1411F887AE00F1E55B /* PBXTextBookmark */ = 43589A1411F887AE00F1E55B /* PBXTextBookmark */;
-			43589A1511F887AE00F1E55B /* PBXTextBookmark */ = 43589A1511F887AE00F1E55B /* PBXTextBookmark */;
-			437E98491175FB5900866F8D /* PBXTextBookmark */ = 437E98491175FB5900866F8D /* PBXTextBookmark */;
-			437E984A1175FB5900866F8D /* PBXTextBookmark */ = 437E984A1175FB5900866F8D /* PBXTextBookmark */;
-			437E9AFE117CC2A000866F8D /* PBXTextBookmark */ = 437E9AFE117CC2A000866F8D /* PBXTextBookmark */;
 			438B63F1116A49B30062418C /* PBXTextBookmark */ = 438B63F1116A49B30062418C /* PBXTextBookmark */;
 			438B63F2116A49B30062418C /* PBXTextBookmark */ = 438B63F2116A49B30062418C /* PBXTextBookmark */;
 			438B63F3116A49B30062418C /* PBXTextBookmark */ = 438B63F3116A49B30062418C /* PBXTextBookmark */;
 			438B640D116A4AEE0062418C /* PBXTextBookmark */ = 438B640D116A4AEE0062418C /* PBXTextBookmark */;
 			438B642A116A4F2D0062418C /* PBXTextBookmark */ = 438B642A116A4F2D0062418C /* PBXTextBookmark */;
 			438B642B116A4F2D0062418C /* PBXTextBookmark */ = 438B642B116A4F2D0062418C /* PBXTextBookmark */;
-			438B660D116A856E0062418C /* PBXTextBookmark */ = 438B660D116A856E0062418C /* PBXTextBookmark */;
-			438B660E116A856E0062418C /* PBXTextBookmark */ = 438B660E116A856E0062418C /* PBXTextBookmark */;
+			43D78FE6120326FF007C91FB /* PBXTextBookmark */ = 43D78FE6120326FF007C91FB /* PBXTextBookmark */;
+			43D78FE7120326FF007C91FB /* PBXTextBookmark */ = 43D78FE7120326FF007C91FB /* PBXTextBookmark */;
+			43D78FE8120326FF007C91FB /* PBXTextBookmark */ = 43D78FE8120326FF007C91FB /* PBXTextBookmark */;
+			43D78FE9120326FF007C91FB /* PBXTextBookmark */ = 43D78FE9120326FF007C91FB /* PBXTextBookmark */;
+			43D78FEA120326FF007C91FB /* PBXTextBookmark */ = 43D78FEA120326FF007C91FB /* PBXTextBookmark */;
+			43D78FEB120326FF007C91FB /* PBXTextBookmark */ = 43D78FEB120326FF007C91FB /* PBXTextBookmark */;
+			43D78FEC120326FF007C91FB /* PBXTextBookmark */ = 43D78FEC120326FF007C91FB /* PBXTextBookmark */;
+			43D78FED120326FF007C91FB /* PBXTextBookmark */ = 43D78FED120326FF007C91FB /* PBXTextBookmark */;
+			43D78FEE120326FF007C91FB /* PBXTextBookmark */ = 43D78FEE120326FF007C91FB /* PBXTextBookmark */;
+			43D78FEF120326FF007C91FB /* PBXTextBookmark */ = 43D78FEF120326FF007C91FB /* PBXTextBookmark */;
+			43D78FF0120326FF007C91FB /* PBXTextBookmark */ = 43D78FF0120326FF007C91FB /* PBXTextBookmark */;
+			43D78FF1120326FF007C91FB /* PBXTextBookmark */ = 43D78FF1120326FF007C91FB /* PBXTextBookmark */;
+			43D78FF2120326FF007C91FB /* PBXTextBookmark */ = 43D78FF2120326FF007C91FB /* PBXTextBookmark */;
+			43D78FF3120326FF007C91FB /* PBXTextBookmark */ = 43D78FF3120326FF007C91FB /* PBXTextBookmark */;
+			43D78FF4120326FF007C91FB /* PBXTextBookmark */ = 43D78FF4120326FF007C91FB /* PBXTextBookmark */;
+			43D78FF5120326FF007C91FB /* PBXTextBookmark */ = 43D78FF5120326FF007C91FB /* PBXTextBookmark */;
+			43D78FF6120326FF007C91FB /* PBXTextBookmark */ = 43D78FF6120326FF007C91FB /* PBXTextBookmark */;
+			43D78FF7120326FF007C91FB /* PBXTextBookmark */ = 43D78FF7120326FF007C91FB /* PBXTextBookmark */;
+			43D78FF8120326FF007C91FB /* PBXTextBookmark */ = 43D78FF8120326FF007C91FB /* PBXTextBookmark */;
 		};
 		sourceControlManager = 438B63C3116A44D70062418C /* Source Control */;
 		userBuildSettings = {
 		};
 	};
-	43589A1411F887AE00F1E55B /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = 28D7ACF70DDB3853001CB0EB /* accelerViewController.m */;
-		name = "accelerViewController.m: 73";
-		rLen = 87;
-		rLoc = 1719;
-		rType = 0;
-		vrLen = 793;
-		vrLoc = 618;
-	};
-	43589A1511F887AE00F1E55B /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = 28D7ACF70DDB3853001CB0EB /* accelerViewController.m */;
-		name = "accelerViewController.m: 73";
-		rLen = 87;
-		rLoc = 1719;
-		rType = 0;
-		vrLen = 810;
-		vrLoc = 1371;
-	};
-	437E98491175FB5900866F8D /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = 1D3623250D0F684500981E51 /* accelerAppDelegate.m */;
-		name = "accelerAppDelegate.m: 1";
-		rLen = 0;
-		rLoc = 0;
-		rType = 0;
-		vrLen = 624;
-		vrLoc = 0;
-	};
-	437E984A1175FB5900866F8D /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = 1D3623240D0F684500981E51 /* accelerAppDelegate.h */;
-		name = "accelerAppDelegate.h: 1";
-		rLen = 0;
-		rLoc = 0;
-		rType = 0;
-		vrLen = 490;
-		vrLoc = 0;
-	};
-	437E9AFE117CC2A000866F8D /* PBXTextBookmark */ = {
-		isa = PBXTextBookmark;
-		fRef = 28D7ACF60DDB3853001CB0EB /* accelerViewController.h */;
-		name = "accelerViewController.h: 12";
-		rLen = 25;
-		rLoc = 254;
-		rType = 0;
-		vrLen = 665;
-		vrLoc = 0;
-	};
 	438B63BA116A44B60062418C /* acceler */ = {
 		isa = PBXExecutable;
 		activeArgIndices = (
 		vrLen = 263;
 		vrLoc = 0;
 	};
-	438B660D116A856E0062418C /* PBXTextBookmark */ = {
+	43D78FE6120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 28D7ACF70DDB3853001CB0EB /* accelerViewController.m */;
+		name = "accelerViewController.m: 73";
+		rLen = 87;
+		rLoc = 1719;
+		rType = 0;
+		vrLen = 737;
+		vrLoc = 0;
+	};
+	43D78FE7120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 28D7ACF60DDB3853001CB0EB /* accelerViewController.h */;
+		name = "accelerViewController.h: 12";
+		rLen = 25;
+		rLoc = 254;
+		rType = 0;
+		vrLen = 665;
+		vrLoc = 0;
+	};
+	43D78FE8120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 1D3623250D0F684500981E51 /* accelerAppDelegate.m */;
+		name = "accelerAppDelegate.m: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 624;
+		vrLoc = 0;
+	};
+	43D78FE9120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 1D3623240D0F684500981E51 /* accelerAppDelegate.h */;
+		name = "accelerAppDelegate.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 490;
+		vrLoc = 0;
+	};
+	43D78FEA120326FF007C91FB /* PBXTextBookmark */ = {
 		isa = PBXTextBookmark;
 		fRef = 438B6419116A4B890062418C /* Calc.h */;
 		name = "Calc.h: 20";
 		vrLen = 373;
 		vrLoc = 0;
 	};
-	438B660E116A856E0062418C /* PBXTextBookmark */ = {
+	43D78FEB120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 438B641A116A4B890062418C /* Calc.m */;
+		name = "Calc.m: 16";
+		rLen = 0;
+		rLoc = 252;
+		rType = 0;
+		vrLen = 326;
+		vrLoc = 0;
+	};
+	43D78FEC120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 28D7ACF70DDB3853001CB0EB /* accelerViewController.m */;
+		name = "accelerViewController.m: 73";
+		rLen = 87;
+		rLoc = 1719;
+		rType = 0;
+		vrLen = 809;
+		vrLoc = 1371;
+	};
+	43D78FED120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 438B6419116A4B890062418C /* Calc.h */;
+		name = "Calc.h: 20";
+		rLen = 0;
+		rLoc = 353;
+		rType = 0;
+		vrLen = 373;
+		vrLoc = 0;
+	};
+	43D78FEE120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 1D3623240D0F684500981E51 /* accelerAppDelegate.h */;
+		name = "accelerAppDelegate.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 490;
+		vrLoc = 0;
+	};
+	43D78FEF120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 1D3623250D0F684500981E51 /* accelerAppDelegate.m */;
+		name = "accelerAppDelegate.m: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 624;
+		vrLoc = 0;
+	};
+	43D78FF0120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 28D7ACF70DDB3853001CB0EB /* accelerViewController.m */;
+		name = "accelerViewController.m: 73";
+		rLen = 87;
+		rLoc = 1719;
+		rType = 0;
+		vrLen = 737;
+		vrLoc = 0;
+	};
+	43D78FF1120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 28D7ACF60DDB3853001CB0EB /* accelerViewController.h */;
+		name = "accelerViewController.h: 12";
+		rLen = 25;
+		rLoc = 254;
+		rType = 0;
+		vrLen = 665;
+		vrLoc = 0;
+	};
+	43D78FF2120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 1D3623240D0F684500981E51 /* accelerAppDelegate.h */;
+		name = "accelerAppDelegate.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 490;
+		vrLoc = 0;
+	};
+	43D78FF3120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 1D3623250D0F684500981E51 /* accelerAppDelegate.m */;
+		name = "accelerAppDelegate.m: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 624;
+		vrLoc = 0;
+	};
+	43D78FF4120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 1D3623240D0F684500981E51 /* accelerAppDelegate.h */;
+		name = "accelerAppDelegate.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 490;
+		vrLoc = 0;
+	};
+	43D78FF5120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 1D3623250D0F684500981E51 /* accelerAppDelegate.m */;
+		name = "accelerAppDelegate.m: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 624;
+		vrLoc = 0;
+	};
+	43D78FF6120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 1D3623240D0F684500981E51 /* accelerAppDelegate.h */;
+		name = "accelerAppDelegate.h: 1";
+		rLen = 0;
+		rLoc = 0;
+		rType = 0;
+		vrLen = 490;
+		vrLoc = 0;
+	};
+	43D78FF7120326FF007C91FB /* PBXTextBookmark */ = {
+		isa = PBXTextBookmark;
+		fRef = 438B6419116A4B890062418C /* Calc.h */;
+		name = "Calc.h: 20";
+		rLen = 0;
+		rLoc = 353;
+		rType = 0;
+		vrLen = 373;
+		vrLoc = 0;
+	};
+	43D78FF8120326FF007C91FB /* PBXTextBookmark */ = {
 		isa = PBXTextBookmark;
 		fRef = 438B641A116A4B890062418C /* Calc.m */;
 		name = "Calc.m: 16";

solarwolf/Classes/Classes-1.moved-aside/solarwolfViewController.h

+//
+//  solarwolfViewController.h
+//  solarwolf
+//
+//  Created by Tau Bernstorff Lehmann on 21/07/10.
+//  Copyright __MyCompanyName__ 2010. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface solarwolfViewController : UIViewController {
+	UIView* myView;
+	UIView* ship;
+	NSMutableArray *fatArray; 
+	int horzStep;
+	int vertStep;
+	UIView *shipView;
+}
+-(void)moveShip:(CGPoint) move;
+-(void)colorbox;
+-(void)destroyBox;
+-(void)evilShips;
+-(void)outOfBounds;
+@end
+

solarwolf/Classes/Classes-2.moved-aside/ship.h

+//
+//  ship.h
+//  solarwolf
+//
+//  Created by Tau Bernstorff Lehmann on 30/07/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface ship : NSObject {
+
+}
+
+@end

solarwolf/Classes/Classes-2.moved-aside/ship.m

+//
+//  ship.m
+//  solarwolf
+//
+//  Created by Tau Bernstorff Lehmann on 30/07/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "ship.h"
+
+
+@implementation ship
+
+@end

solarwolf/Classes/GameMechanics.h

+//
+//  GameMechanics.h
+//  solarwolf
+//
+//  Created by Tau Bernstorff Lehmann on 11/08/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface GameMechanics : NSObject {
+
+}
+
+@end

solarwolf/Classes/GameMechanics.m

+//
+//  GameMechanics.m
+//  solarwolf
+//
+//  Created by Tau Bernstorff Lehmann on 11/08/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "GameMechanics.h"
+
+
+@implementation GameMechanics
+
+@end

solarwolf/Classes/Platforms.h

+//
+//  Platforms.h
+//  solarwolf
+//
+//  Created by Tau Bernstorff Lehmann on 11/08/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "Spirint.h"
+
+@interface Platforms : Spirint {
+	NSString * sidePosition;
+}
+
+-(id)initWithPos:(CGPoint)value:(NSString *) dir:(NSString *) sidePos;
+
+-(NSString *)sidePosition;
+-(void)setSidePosition:(NSString *)sidePosition;
+
+-(Spirint *)launchFireball;
+
+-(CGRect)convertPosToSquare;
+
+
+-(UIView *)drawSpirint;
+
+-(void)oppositeDirection;
+
+-(void)check;
+		
+@end

solarwolf/Classes/Platforms.m

+//
+//  Platforms.m
+//  solarwolf
+//
+//  Created by Tau Bernstorff Lehmann on 11/08/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "Platforms.h"
+
+
+@implementation Platforms
+
+-(id)initWithPos:(CGPoint)value:(NSString *) dir:(NSString *) sidePos{
+	if(self = [super init]){
+		position=value;
+		direction=dir;
+		sidePosition=sidePos;
+		CGRect frame=[self convertPosToSquare];
+		
+		spirintView=[[UIView alloc]initWithFrame:frame];
+		spirintView.backgroundColor=[UIColor blackColor];
+	}
+	return self;
+}
+
+-(NSString*) sidePosition{
+	return sidePosition;
+}
+-(void)setSidePosition:(NSString*)sidePos{
+	sidePosition=sidePos;
+}
+
+	
+-(Spirint*)launchFireball{
+	NSString* sidePos=[self sidePosition];
+	CGPoint platformPos =[self position];
+	Spirint* fireball = [[Spirint alloc]init];
+	CGPoint fireballPos=CGPointMake(platformPos.x,platformPos.y);
+	[fireball setPosition:fireballPos];
+	if([sidePos isEqualToString: @"Top"]){
+		
+		[fireball setDirection:@"Down"];
+		
+	}
+	
+	else if([sidePos isEqualToString:@"Bottom"]){
+		[fireball setDirection:@"Up"];
+	}
+	
+	else if([sidePos isEqualToString:@"Right"]){
+		[fireball setDirection:@"Left"];
+	}
+	else if([sidePos isEqualToString:@"Left"]){
+		[fireball setDirection:@"Right"];
+	}
+	return fireball;
+}
+	
+-(CGRect)convertPosToSquare{
+	
+	NSString* sidePos=[self sidePosition];
+	CGPoint temp =[self position];
+	
+	if([sidePos isEqualToString: @"Top"]){
+		CGRect square=CGRectMake(25*temp.x+10, 25*temp.y,25, 5);
+		return square;
+	}
+	
+	else if([sidePos isEqualToString:@"Bottom"]){
+		CGRect square=CGRectMake(25*temp.x+10, 25*temp.y+30,25, 5);
+		return square;
+	}
+	
+	else if([sidePos isEqualToString:@"Right"]){
+		CGRect square=CGRectMake(25*temp.x+5, 25*temp.y+5,10, 25);
+		return square;
+	}
+	
+	
+	else if([sidePos isEqualToString:@"Left"]){
+		 CGRect square=CGRectMake(25*temp.x, 25*temp.y+5,10, 25);
+		return square;
+	}
+	
+}
+
+-(void)oppositeDirection{
+	if([[self direction] isEqualToString:@"Left"]){
+		[self setDirection:@"Right"];
+	}
+	else if([[self direction] isEqualToString:@"Right"]){
+		[self setDirection:@"Left"];
+	}
+	else if([[self direction] isEqualToString:@"Up"]){
+		[self setDirection:@"Down"];
+	}
+	else if([[self direction] isEqualToString:@"Down"]){
+			[self setDirection:@"Up"];
+	}
+}
+
+-(void)check{
+	
+	if([self objectWillLeave]){
+		[self oppositeDirection];
+	}
+}
+
+-(void)move{
+	[self check];
+	CGPoint temp=[self position];
+	CGPoint oldPos=[self position];
+	if([[self direction] isEqual:@"Up"]){
+		temp.y--;
+	}
+	else if([[self direction] isEqual:@"Down"]){
+		temp.y++;
+	}
+	else if([[self direction] isEqual:@"Right"]){
+		temp.x++;
+	}
+	else if([[self direction] isEqual:@"Left"]){
+		temp.x--;
+		
+	}
+	[self setPosition:temp];
+	if([self objectWillLeave]){
+		[self oppositeDirection];
+		[self setPosition:oldPos];
+	}
+	[self drawSpirint];
+}
+
+
+	
+
+@end

solarwolf/Classes/Ship.h

+//
+//  Ship.h
+//  solarwolf
+//
+//  Created by Tau Bernstorff Lehmann on 10/08/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "Spirint.h"
+
+
+@interface Ship : Spirint {
+
+}
+
+-(void) moveShip:(CGPoint) move;
+
+@end

solarwolf/Classes/Ship.m

+//
+//  Ship.m
+//  solarwolf
+//
+//  Created by Tau Bernstorff Lehmann on 10/08/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "Ship.h"
+
+
+@implementation Ship
+
+-(void)moveShip:(CGPoint)move{
+	
+	CGRect shipframe=[self convertPosToSquare];
+	CGPoint click;
+	click.x=(shipframe.origin.x+12.5)-move.x;
+	click.y=(shipframe.origin.y+12.5)-move.y;
+	
+	
+	if(fabs(click.x)>fabs(click.y)){
+		if(shipframe.origin.x>move.x){
+			[self setDirection:@"Left"];
+		}
+		else{
+			[self setDirection:@"Right"];
+		}
+	}
+	else{
+		
+		if(shipframe.origin.y>move.y){
+			[self setDirection:@"Up"];
+		}
+		else{
+			[self setDirection:@"Down"];
+			
+			
+		}
+		
+		
+	}
+	[self move];
+	
+}
+
+-(void)move{
+	CGPoint temp=[self position];
+	CGPoint oldPos=[self position];
+	if([[self direction] isEqual:@"Up"]){
+		temp.y--;
+	}
+	else if([[self direction] isEqual:@"Down"]){
+		temp.y++;
+	}
+	else if([[self direction] isEqual:@"Right"]){
+		temp.x++;
+	}
+	else if([[self direction] isEqual:@"Left"]){
+		temp.x--;
+		
+	}
+	[self setPosition:temp];
+	if([self objectWillLeave])
+	{
+		[self setPosition:oldPos];
+	}
+	
+	[self drawSpirint];
+	
+}
+
+@end

solarwolf/Classes/Spirint.h

+//
+//  Spirint.h
+//  solarwolf
+//
+//  Created by Tau Bernstorff Lehmann on 10/08/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface Spirint : NSObject {
+	CGPoint  position;
+	NSString* direction;
+	UIView * spirintView;
+}
+-(id) initWithPos:(CGPoint)value:(NSString*) dir;
+
+-(id) initWithPos:(CGPoint)value;
+-(id) init;
+
+-(CGPoint)position;
+-(void)setPosition:(CGPoint)value;
+
+-(NSString *)direction;
+-(void)setDirection:(NSString *)value;
+
+-(void)move;
+
+-(CGRect)convertPosToSquare;
+
+-(UIView *)drawSpirint;
+
+-(BOOL)objectWillLeave;
+@end

solarwolf/Classes/Spirint.m

+//
+//  Spirint.m
+//  solarwolf
+//
+//  Created by Tau Bernstorff Lehmann on 10/08/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "Spirint.h"
+
+
+@implementation Spirint
+
+-(id)initWithPos:(CGPoint) value:(NSString*)dir{
+	if(self=[super init])
+	{
+		direction=dir;
+		position=value;
+		CGRect frame=[self convertPosToSquare];
+
+		spirintView=[[UIView alloc]initWithFrame:frame];
+		spirintView.backgroundColor=[UIColor blackColor];
+
+	}
+	return self;
+	[spirintView release];
+}
+
+-(id)initWithPos:(CGPoint) value{
+	return [self initWithPos:value:@"No Dir"];
+}
+
+-(id)init{
+	CGPoint value=CGPointMake(0,0);
+	return [self initWithPos: value : @"No Dir"];
+}
+
+-(CGPoint)position{
+	return position;
+}
+
+-(UIView *)view{
+	return spirintView;
+}
+
+-(void)setPosition:(CGPoint)value{
+	position=value;
+}
+
+-(void)setDirection:(NSString *)value{
+	direction=value;
+}
+
+-(NSString*) direction{
+	return direction;
+}
+
+-(void)move{
+	CGPoint temp=[self position];
+	if([[self direction] isEqual:@"Up"]){
+		temp.y--;
+	}
+	else if([[self direction] isEqual:@"Down"]){
+		temp.y++;
+	}
+	else if([[self direction] isEqual:@"Right"]){
+		temp.x++;
+	}
+	else if([[self direction] isEqual:@"Left"]){
+		temp.x--;
+		
+	}
+	[self setPosition:temp];
+	[self drawSpirint];
+
+}
+
+-(CGRect)convertPosToSquare{
+	CGPoint temp=[self position];
+	CGRect square=CGRectMake(25*temp.x+10, 25*temp.y+5,25, 25);
+	return square;
+}
+
+-(UIView *)drawSpirint{
+	
+	CGRect frame=[self convertPosToSquare];
+	spirintView.frame=frame;
+	return spirintView;
+		
+	
+}
+
+-(BOOL)objectWillLeave{
+	CGPoint temp=[self position];
+	if(temp.x<0||temp.x>11||temp.y<0||temp.y>17){
+		return YES;
+	}
+	else {
+		return NO;
+	}
+}
+
+	
+@end

solarwolf/Classes/solarwolfViewController.h

 //
 
 #import <UIKit/UIKit.h>
+#import "Spirint.h"
+#import "Ship.h"
+#import "Platforms.h"
 
 @interface solarwolfViewController : UIViewController {
 	UIView* myView;
 	UIView* ship;
+	Ship* myShip;
 	NSMutableArray *fatArray; 
-	int horzStep;
-	int vertStep;
+	NSMutableArray *fireballArray;
 	UIView *shipView;
+	Platforms* platformLeft;
+	Platforms* platformRight;
+	Platforms* platformTop;
+	Platforms* platformBottom;
+	UIView * platformLeftView;
+	UIView * platformBottomView;
 }
--(void)moveShip:(CGPoint) move;
 -(void)colorbox;
 -(void)destroyBox;
 -(void)gameWon;
-@end
-
+-(void)setUpLevel;
+@end

solarwolf/Classes/solarwolfViewController.m

 	[[self view] addSubview:myView];
 	shipView=[[UIView alloc] initWithFrame:[[self view] bounds]];
 	[myView addSubview:shipView];
-	vertStep=0;
-	horzStep=0;
+	[self setUpLevel];	
+	
+	fireballArray=[[NSMutableArray alloc]init];
+	
+	myShip =[[Ship alloc]initWithPos:CGPointMake (3,5)];
+	UIColor *color = [[UIColor alloc] initWithRed:0.0 green:0.0 blue:0.0 alpha:0.0];
+	
+	[shipView setBackgroundColor: color];
+	
+	platformLeft=[[Platforms alloc]initWithPos:CGPointMake(0,0):@"Down":@"Left"];
+	platformBottom=[[Platforms alloc]initWithPos:CGPointMake(0,17):@"Right":@"Bottom"];
+
+	platformLeftView=[platformLeft drawSpirint];
+	[myView addSubview:platformLeftView];
+	
+	
+	
+	platformBottomView=[platformBottom drawSpirint];
+	[myView addSubview:platformBottomView];
+	
+	
+	[myView addSubview:[myShip drawSpirint]];
+	[NSTimer scheduledTimerWithTimeInterval: 0.5
+									 target: self
+								   selector: @selector(gameLoop)
+								   userInfo: nil
+									repeats: YES];
+	[ship release];
+	[color release];
+	[shipView release];
+
+    [super viewDidLoad];
+}
+
+-(void)gameLoop{
+	
+	[platformLeft move];
+	[platformBottom move];
+	Spirint* fireball=[platformLeft launchFireball];
+	UIView* fireballView = [fireball drawSpirint];
+	[myView addSubview:fireballView];
+	NSEnumerator* e=[fireballArray objectEnumerator];
+	id object;
+	while(object=[e nextObject]){
+		if(![object objectWillLeave]){
+		[object move];
+		}
+		else{
+			[[object view] removeFromSuperview];
+		}
+	}
+	[fireballArray addObject:fireball];
+	
+}
+
+-(void)setUpLevel{
 	fatArray=[[NSMutableArray alloc] init];
-	NSMutableArray *test=[[NSMutableArray alloc] init];
-	for(int i=0; i<=17; i++){
-		[test insertObject:[NSNumber numberWithInt:2] atIndex:i];
-	}
 	for(int i=0; i<=11; i++){
+		NSMutableArray *test=[[NSMutableArray alloc] init];
+		for(int i=0; i<=17; i++){
+			[test insertObject:[NSNumber numberWithInt:1] atIndex:i];
+		}
 		[fatArray insertObject:test atIndex:i];
 	}
 	for(int i=0; i<=11; i++){
 		NSMutableArray *rows=[fatArray objectAtIndex:i];
 		for(int j=0; j<=17; j++){
-			CGRect frame=CGRectMake(25*i,5+25*j, 25, 25);
+			CGRect frame=CGRectMake(10+25*i,5+25*j, 25, 25);
 			UIView *box=[[UIView alloc]initWithFrame:frame];
 			int test=[[[rows objectAtIndex:j] retain] intValue];
-				if(test==1){				
+			if(test==1){				
 				box.backgroundColor=[UIColor greenColor];				
 			}
 			else if (test==2){
 		}
 		[rows release];
 	}	
+}	
 	
-	UIColor *color = [[UIColor alloc] initWithRed:0.0 green:0.0 blue:0.0 alpha:0.0];
-
-	[shipView setBackgroundColor: color];
 	
-	CGRect frame=CGRectMake(0,5, 25, 25);
-	ship=[[UIView alloc]initWithFrame:frame];
-	ship.backgroundColor=[UIColor blackColor];
-	[myView addSubview:ship];
-	[ship release];
-	[color release];
-	[shipView release];
-    [super viewDidLoad];
-}
 
 -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *) event{
 	UITouch *touch=[[event allTouches] anyObject];
 	CGPoint move= [touch locationInView:myView];
-	[self moveShip:move];
+	
+	
+	
+
+	[myShip moveShip:move];
+	
+	
+	[self destroyBox];
+	
 	
 	}
+
+	
 -(void)colorbox{
-	NSMutableArray *rows=[fatArray objectAtIndex:horzStep];
-		CGRect frame=CGRectMake(25*horzStep,5+25*vertStep, 25, 25);
-		int test=[[rows objectAtIndex:vertStep] intValue];
+	CGPoint temp=[myShip position];
+	int tempx=temp.x;
+	int tempy=temp.y;
+	NSMutableArray *row=[fatArray objectAtIndex:tempx];
+		CGRect frame=[myShip convertPosToSquare];
+		int test=[[row objectAtIndex:tempy] intValue];
 		UIView *box=[[UIView alloc]initWithFrame:frame];
 		if(test==1){			
 			box.backgroundColor=[UIColor greenColor];			
 	
 	}
 -(void)destroyBox{
-	NSMutableArray *row=[fatArray objectAtIndex:horzStep];
-	int k= [[row objectAtIndex:vertStep]intValue];
+	CGPoint temp=[myShip position];
+	int tempx=temp.x;
+	int tempy=temp.y;
+	NSMutableArray *row=[fatArray objectAtIndex:tempx];
+	int k= [[row objectAtIndex:tempy]intValue];
 	int a=k-1;
-	[row replaceObjectAtIndex:vertStep	withObject:[NSNumber numberWithInt:a]];
-	[fatArray replaceObjectAtIndex:horzStep withObject:row];
-	[self colorbox];
-	[self gameWon];
+	[row replaceObjectAtIndex:tempy	withObject:[NSNumber numberWithInt:a]];
+	[fatArray replaceObjectAtIndex:tempx withObject:row];	
+	[self colorbox];	
+	[self gameWon];	
 	}
 -(void)gameWon{
 	int l=0;
 	{
 	}
 	else{
+		
 		UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"U Won" message:@"U won the game" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
 		[alert show];
 		[alert release];
 	}
 	
 }
--(void)moveShip:(CGPoint)move{
-	CGRect shipframe=ship.frame;
-	CGPoint click;
-	click.x=(shipframe.origin.x+12.5)-move.x;
-	click.y=(shipframe.origin.y+12.5)-move.y;
-	if(fabs(click.x)>fabs(click.y)){
-		if(shipframe.origin.x>move.x){
-		shipframe.origin.x-=25;
-			horzStep--;
-		}
-		else{
-			shipframe.origin.x+=25;
-			horzStep++;
-		}
-	}
-	else{
-		
-		if(shipframe.origin.y>move.y){
-		shipframe.origin.y-=25;
-			vertStep--;
-		}
-		else{
-		shipframe.origin.y+=25;
-			vertStep++;
-		}
-	}
-	
-	ship.frame=shipframe;
-	[self destroyBox];
-}
+
 
 
 
 
 
 - (void)dealloc {
+	[myShip release];
     [super dealloc];
 }
 

solarwolf/solarwolf.xcodeproj/project.pbxproj

 		2899E5220DE3E06400AC0155 /* solarwolfViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2899E5210DE3E06400AC0155 /* solarwolfViewController.xib */; };
 		28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; };
 		28D7ACF80DDB3853001CB0EB /* solarwolfViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* solarwolfViewController.m */; };
+		43F69BC41211A17300D4BD2B /* Spirint.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F69BC31211A17300D4BD2B /* Spirint.m */; };
+		43F69C951212000200D4BD2B /* Ship.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F69C941212000200D4BD2B /* Ship.m */; };
+		43F69DBB1212C68A00D4BD2B /* Platforms.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F69DBA1212C68A00D4BD2B /* Platforms.m */; };
+		43F69DC31212CD1900D4BD2B /* GameMechanics.m in Sources */ = {isa = PBXBuildFile; fileRef = 43F69DC21212CD1900D4BD2B /* GameMechanics.m */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
 		288765A40DF7441C002DB57D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
 		2899E5210DE3E06400AC0155 /* solarwolfViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = solarwolfViewController.xib; sourceTree = "<group>"; };
 		28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
-		28D7ACF60DDB3853001CB0EB /* solarwolfViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = solarwolfViewController.h; sourceTree = "<group>"; };
 		28D7ACF70DDB3853001CB0EB /* solarwolfViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = solarwolfViewController.m; sourceTree = "<group>"; };
 		29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
 		32CA4F630368D1EE00C91783 /* solarwolf_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = solarwolf_Prefix.pch; sourceTree = "<group>"; };
+		43D78FD112032692007C91FB /* solarwolfViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = solarwolfViewController.h; sourceTree = "<group>"; };
+		43F69BC21211A17300D4BD2B /* Spirint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Spirint.h; sourceTree = "<group>"; };
+		43F69BC31211A17300D4BD2B /* Spirint.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Spirint.m; sourceTree = "<group>"; };
+		43F69C931212000200D4BD2B /* Ship.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Ship.h; sourceTree = "<group>"; };
+		43F69C941212000200D4BD2B /* Ship.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Ship.m; sourceTree = "<group>"; };
+		43F69DB91212C68A00D4BD2B /* Platforms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Platforms.h; sourceTree = "<group>"; };
+		43F69DBA1212C68A00D4BD2B /* Platforms.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Platforms.m; sourceTree = "<group>"; };
+		43F69DC11212CD1900D4BD2B /* GameMechanics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GameMechanics.h; sourceTree = "<group>"; };
+		43F69DC21212CD1900D4BD2B /* GameMechanics.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GameMechanics.m; sourceTree = "<group>"; };
 		8D1107310486CEB800E47090 /* solarwolf-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "solarwolf-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 		080E96DDFE201D6D7F000001 /* Classes */ = {
 			isa = PBXGroup;
 			children = (
+				43F69DC11212CD1900D4BD2B /* GameMechanics.h */,
+				43F69DC21212CD1900D4BD2B /* GameMechanics.m */,
+				43F69DB91212C68A00D4BD2B /* Platforms.h */,
+				43F69DBA1212C68A00D4BD2B /* Platforms.m */,
 				1D3623240D0F684500981E51 /* solarwolfAppDelegate.h */,
 				1D3623250D0F684500981E51 /* solarwolfAppDelegate.m */,
-				28D7ACF60DDB3853001CB0EB /* solarwolfViewController.h */,
+				43D78FD112032692007C91FB /* solarwolfViewController.h */,
 				28D7ACF70DDB3853001CB0EB /* solarwolfViewController.m */,
+				43F69C931212000200D4BD2B /* Ship.h */,
+				43F69C941212000200D4BD2B /* Ship.m */,
+				43F69BC21211A17300D4BD2B /* Spirint.h */,
+				43F69BC31211A17300D4BD2B /* Spirint.m */,
 			);
 			path = Classes;
 			sourceTree = "<group>";
 				1D60589B0D05DD56006BFB54 /* main.m in Sources */,
 				1D3623260D0F684500981E51 /* solarwolfAppDelegate.m in Sources */,
 				28D7ACF80DDB3853001CB0EB /* solarwolfViewController.m in Sources */,
+				43F69BC41211A17300D4BD2B /* Spirint.m in Sources */,
+				43F69C951212000200D4BD2B /* Ship.m in Sources */,
+				43F69DBB1212C68A00D4BD2B /* Platforms.m in Sources */,
+				43F69DC31212CD1900D4BD2B /* GameMechanics.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};