Skip to content

Commit

Permalink
Made it iPad-compatible, blurry background and all
Browse files Browse the repository at this point in the history
  • Loading branch information
jamonholmgren committed Dec 28, 2012
1 parent f6b7870 commit 5cfe450
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Rakefile
Expand Up @@ -9,11 +9,15 @@ Bundler.require

Motion::Project::App.setup do |app|
app.name = 'demo-sparrow'

app.device_family = [ :iphone, :ipad ]

app.frameworks += %w(AudioToolbox CFNetwork SystemConfiguration MobileCoreServices Security QuartzCore StoreKit)

app.info_plist['UIStatusBarHidden'] = true

app.provisioning_profile = "../_ios-profiles/Jamon Dev.mobileprovision"

app.pods do
pod "Sparrow-Framework"
end
Expand Down
10 changes: 8 additions & 2 deletions app/game.rb
Expand Up @@ -16,12 +16,18 @@ class Game < SPSprite
SP_EVENT_TYPE_TOUCH = "touch"
SP_EVENT_TYPE_ENTER_FRAME = "enterFrame"
attr_accessor :background, :basket, :eggs


def ipad?
UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad
end

def init
super.tap do
# load the background image first, add it to the display tree
# and keep it for later use
@background = SPImage.alloc.initWithContentsOfFile('background.png').tap { |bg| self.addChild(bg) }
bg_filename = "background.png"
bg_filename = "background_ipad.png" if ipad?
@background = SPImage.alloc.initWithContentsOfFile(bg_filename).tap { |bg| self.addChild(bg) }

# loads the basket, positions in the middle of the ground,
# adds a touch listener and adds it as a child
Expand Down
Binary file added resources/background_ipad.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5cfe450

Please sign in to comment.