diff --git a/Rakefile b/Rakefile index 88384b5..0951a89 100644 --- a/Rakefile +++ b/Rakefile @@ -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 diff --git a/app/game.rb b/app/game.rb index f4146b5..76ad8a4 100644 --- a/app/game.rb +++ b/app/game.rb @@ -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 diff --git a/resources/background_ipad.png b/resources/background_ipad.png new file mode 100644 index 0000000..40310ef Binary files /dev/null and b/resources/background_ipad.png differ