Skip to content

Commit

Permalink
Calculate sword x every time
Browse files Browse the repository at this point in the history
  • Loading branch information
EtherTyper committed Jun 16, 2016
1 parent 8072666 commit 2999d6f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 71 deletions.
40 changes: 0 additions & 40 deletions DeathDodgerTests/DeathDodgerTests.m

This file was deleted.

24 changes: 0 additions & 24 deletions DeathDodgerTests/Info.plist

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ViewController.m"
timestampString = "487728051.594636"
timestampString = "487728936.946215"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "84"
endingLineNumber = "84"
startingLineNumber = "90"
endingLineNumber = "90"
landmarkName = "-leftButton:"
landmarkType = "7">
</BreakpointContent>
Expand Down
14 changes: 10 additions & 4 deletions ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,20 @@ - (void)didReceiveMemoryWarning {
- (void)reDraw{
finnCharc.center = CGPointMake(finnCoordX, finnCoordY);

if (aSword1.center.y<=[[UIScreen mainScreen] bounds].size.height+[aSword1 frame].size.height/2)
if (aSword1.center.y<=[[UIScreen mainScreen] bounds].size.height+[aSword1 frame].size.height/2) {
sword1yCoords = sword1yCoords + 20;
else
} else {
sword1yCoords = -[aSword1 frame].size.height/2 - 200;
if (aSword2.center.y<=[[UIScreen mainScreen] bounds].size.height+[aSword2 frame].size.height/2)
sword1xCoords = [aSword1 frame].size.width/2 + rand() % (int)([[UIScreen mainScreen] bounds].size.width-[aSword1 frame].size.width/2);
}

if (aSword2.center.y<=[[UIScreen mainScreen] bounds].size.height+[aSword2 frame].size.height/2) {
sword2yCoords = sword2yCoords + 20;
else
} else {
sword2yCoords = -[aSword2 frame].size.height/2 - 200;
sword2xCoords = [aSword2 frame].size.width/2 + rand() % (int)([[UIScreen mainScreen] bounds].size.width-[aSword2 frame].size.width/2);
}

aSword1.center = CGPointMake(sword1xCoords, sword1yCoords);
aSword2.center = CGPointMake(sword2xCoords, sword2yCoords);
}
Expand Down

0 comments on commit 2999d6f

Please sign in to comment.