diff --git a/Death_Dodger/Base.lproj/Main.storyboard b/Death_Dodger/Base.lproj/Main.storyboard index 282f435..27812a3 100644 --- a/Death_Dodger/Base.lproj/Main.storyboard +++ b/Death_Dodger/Base.lproj/Main.storyboard @@ -22,7 +22,7 @@ - + @@ -31,11 +31,11 @@ - + - + @@ -51,6 +51,7 @@ + diff --git a/Death_Dodger/ViewController.h b/Death_Dodger/ViewController.h index 772f19b..4050bc3 100644 --- a/Death_Dodger/ViewController.h +++ b/Death_Dodger/ViewController.h @@ -10,17 +10,17 @@ @interface ViewController : UIViewController { IBOutlet UILabel *directionStatus; + IBOutlet UILabel *xCoordStatus; IBOutlet UIImageView *finnCharc; CGFloat finnCoordX; CGFloat finnCoordY; + char Direct; + bool debug; + } -- (IBAction)rightButton; -- (IBAction)leftButton; -- (void)reDraw; - -@end - - +- (IBAction)leftButton:(id)sender; +- (IBAction)rightButton:(id)sender; +@end diff --git a/Death_Dodger/ViewController.m b/Death_Dodger/ViewController.m index 844de1b..ed9bdd3 100644 --- a/Death_Dodger/ViewController.m +++ b/Death_Dodger/ViewController.m @@ -5,6 +5,12 @@ // Created by Joseph Jin on 5/22/16. // Copyright (c) 2016 Animator Joe. All rights reserved. // +// +// ================================================================================ +// +// Update Notice: Enabling the directionStatus text may cause glitches in the game. +// +// ================================================================================ #import "ViewController.h" @@ -18,13 +24,18 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //This part is what happens to Finn as soon as the app is loaded. - - /* - spriteFinn. - */ + //spriteFinn. + + // Set to True to Debug + // | + // \|/ + debug = false; + + directionStatus.hidden = true; finnCoordX = finnCharc.center.x; finnCoordY = finnCharc.center.y; + } - (void)didReceiveMemoryWarning { @@ -32,22 +43,38 @@ - (void)didReceiveMemoryWarning { // Dispose of any resources that can be recreated. } -- (IBAction)rightButton { +- (IBAction)leftButton:(id)sender { - directionStatus.text = @"right"; - finnCoordX+=6; + if (debug){ + + directionStatus.text = @"left"; + + } + + finnCharc.center = CGPointMake(finnCoordX, finnCoordY); + finnCoordX -= 10; [self reDraw]; + } -- (IBAction)leftButton { +- (IBAction)rightButton:(id)sender { - directionStatus.text = @"left"; - finnCoordX-=6; + if (debug){ + + directionStatus.text = @"right"; + + } + + finnCharc.center = CGPointMake(finnCoordX, finnCoordY); + finnCoordX += 10; [self reDraw]; + } -- (void)reDraw { - finnCharc.center=CGPointMake(finnCoordX,finnCoordY); +- (void)reDraw{ + + finnCharc.center = CGPointMake(finnCoordX, finnCoordY); + } @end