Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basically earth #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
26 changes: 13 additions & 13 deletions GameScreen.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,30 @@ - (void)viewDidLoad
[self.view addSubview:top];
[self.view addSubview:bottom];

myTimer = [NSTimer scheduledTimerWithTimeInterval:.3 target: self
myTimer = [NSTimer scheduledTimerWithTimeInterval:.01 target: self
selector: @selector(dropTheBird:) userInfo: nil repeats: YES];
[myTimer fire];
// Do any additional setup after loading the view from its nib.
}

-(void)dropTheBird:(id)sender{
[flipperBird setFrame:CGRectMake(flipperBird.frame.origin.x, flipperBird.frame.origin.y+30, flipperBird.frame.size.width, flipperBird.frame.size.height)];
[top setFrame:CGRectMake(top.frame.origin.x - 10, top.frame.origin.y, top.frame.size.width, top.frame.size.height)];
[bottom setFrame:CGRectMake(bottom.frame.origin.x - 10, bottom.frame.origin.y, bottom.frame.size.width, bottom.frame.size.height)];
if (flipperBird.frame.origin.y > 526) {
[flipperBird setFrame:CGRectMake(flipperBird.frame.origin.x, flipperBird.frame.origin.y+1, flipperBird.frame.size.width, flipperBird.frame.size.height)];
[top setFrame:CGRectMake(top.frame.origin.x - 2, top.frame.origin.y, top.frame.size.width, top.frame.size.height)];
[bottom setFrame:CGRectMake(bottom.frame.origin.x - 2, bottom.frame.origin.y, bottom.frame.size.width, bottom.frame.size.height)];
if (flipperBird.frame.origin.y > 503) {
UIAlertView *GameOVer = [[UIAlertView alloc]initWithTitle:@"oh no!" message:@"you lost" delegate:self cancelButtonTitle:@"retry" otherButtonTitles:nil, nil];
[GameOVer show];

[myTimer invalidate];
}
if (flipperBird.frame.origin.x >= bottom.frame.origin.x && flipperBird.frame.origin.x <=bottom.frame.origin.x+40) {
if (flipperBird.frame.origin.y <= top.frame.size.height || flipperBird.frame.origin.y >= bottom.frame.origin.y) {
UIAlertView *GameOVer = [[UIAlertView alloc]initWithTitle:@"oh no!" message:[NSString stringWithFormat:@"you lost. Your score was %@",score.text] delegate:self cancelButtonTitle:@"okay" otherButtonTitles:nil, nil];
[GameOVer show];
[myTimer invalidate];
}
if (flipperBird.frame.origin.y <= top.frame.size.height || flipperBird.frame.origin.y >= bottom.frame.origin.y) {
UIAlertView *GameOVer = [[UIAlertView alloc]initWithTitle:@"oh no!" message:[NSString stringWithFormat:@"you lost. Your score was %@",score.text] delegate:self cancelButtonTitle:@"okay" otherButtonTitles:nil, nil];
[GameOVer show];
[myTimer invalidate];
}
}
if (bottom.frame.origin.x < -39) {
if (bottom.frame.origin.x < -120) {
[self addtoScore];

[top setFrame:CGRectMake(320, top.frame.origin.y, top.frame.size.width, top.frame.size.height)];
Expand Down Expand Up @@ -107,10 +107,10 @@ -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
}

-(void)makeFallwithView:(UIImageView*)bird{
[bird setFrame:CGRectMake(bird.frame.origin.x, bird.frame.origin.y-30, bird.frame.size.width, bird.frame.size.height)];
[bird setFrame:CGRectMake(bird.frame.origin.x, bird.frame.origin.y-55, bird.frame.size.width, bird.frame.size.height)];

if (bird.frame.origin.y < 0) {
UIAlertView *GameOVer = [[UIAlertView alloc]initWithTitle:@"oh no!" message:[NSString stringWithFormat:@"you lost. Your score was %@",score.text] delegate:self cancelButtonTitle:@"okay" otherButtonTitles:nil, nil];
UIAlertView *GameOVer = [[UIAlertView alloc]initWithTitle:@"oh no!" message:[NSString stringWithFormat:@"you lost. Your score was %@",score.text] delegate:self cancelButtonTitle:@"okay" otherButtonTitles:nil, nil];
[GameOVer show];
[myTimer invalidate];

Expand Down
6 changes: 3 additions & 3 deletions GameScreen.xib
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5037.3" systemVersion="13A3017" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="GameScreen">
Expand All @@ -27,4 +27,4 @@
<resources>
<image name="Screen Shot 2014-02-09 at 10.35.04 PM.png" width="609" height="35"/>
</resources>
</document>
</document>
24 changes: 24 additions & 0 deletions flutterBird.xcodeproj/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# OS X
.DS_Store

# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
profile
*.moved-aside
DerivedData
*.hmap
*.ipa

# CocoaPods
Pods

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>044DA933-1E39-4DC3-8A52-86AE108EB4C6</string>
<key>IDESourceControlProjectName</key>
<string>flutterBird</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>E65F11B9-CB43-4EB1-82B6-EED10E4428E8</key>
<string>https://github.com/rsmoz/flappybirdclone.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>flutterBird.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>E65F11B9-CB43-4EB1-82B6-EED10E4428E8</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/rsmoz/flappybirdclone.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>E65F11B9-CB43-4EB1-82B6-EED10E4428E8</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>E65F11B9-CB43-4EB1-82B6-EED10E4428E8</string>
<key>IDESourceControlWCCName</key>
<string>flappybirdclone</string>
</dict>
</array>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0500"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E1734DB18A8A14000D8C31A"
BuildableName = "flutterBird.app"
BlueprintName = "flutterBird"
ReferencedContainer = "container:flutterBird.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E1734FC18A8A14000D8C31A"
BuildableName = "flutterBirdTests.xctest"
BlueprintName = "flutterBirdTests"
ReferencedContainer = "container:flutterBird.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E1734DB18A8A14000D8C31A"
BuildableName = "flutterBird.app"
BlueprintName = "flutterBird"
ReferencedContainer = "container:flutterBird.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E1734DB18A8A14000D8C31A"
BuildableName = "flutterBird.app"
BlueprintName = "flutterBird"
ReferencedContainer = "container:flutterBird.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "5E1734DB18A8A14000D8C31A"
BuildableName = "flutterBird.app"
BlueprintName = "flutterBird"
ReferencedContainer = "container:flutterBird.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>flutterBird.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>5E1734DB18A8A14000D8C31A</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>5E1734FC18A8A14000D8C31A</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>