![]() Since your game is going to use the accelerometer, you need to make sure that tilting the device doesn’t flip the game into landscape mode. You’ll be replacing what’s in the GameScene.swift file in just a moment, but first you have one last thing to setup. Let scene = GameScene(size: )īuild and run to make sure everything is working so far.ĭon’t worry about the “Hello, World” text label clipping. Then replace viewDidLoad with the following: Now open GameViewController.swift and delete the unarchiveFromFile SKNode extension at the top of the file, as you won’t be needing this extraneous code. When the warning alert shows, choose Move to Trash. You won’t be using this, so select it and press the delete key. Locate the GameScene.sks file in the Project Navigator. Fire up Xcode, select File\New\Project, choose the iOS\Application\SpriteKit Game template and click Next.Įnter UberJump for the Product Name, set the Language to Swift, and iPhone for Devices and then click Next.Ĭhoose somewhere to save the project and click Create.īefore getting down to business, you’ll do some preliminary setup. To begin, you need a brand new Sprite Kit Xcode project. The result will be a complex, hybrid physics manipulation, as you both apply forces to the player node and also directly change its velocity. The accelerometer will handle the player’s left and right movement (x-axis). Collecting stars along the way will propel the player further on their journey upward, taking care of the up and down (y-axis) portion of the player’s movement (miss too many stars and you fall down though!). Uber Jump will take the same model, initially thrusting your player character upward and continuously applying gravity to pull them down. Collecting coins boosts the player upward while platforms provide temporary respite along the way. The game hurls the player character up the screen and from that point the player must fight against gravity to get as high as they can. ![]() As everyone knows, “uber” is better than “mega,” so let’s call your game “Uber Jump.” ]Īt its heart, a game like Mega Jump is a physics game. Yours will obviously be a truly amazing game and so it needs a truly amazing title. You are going to create a game similar to Mega Jump. That means you’ll need a paid developer account and a device to test on to get the most out of this tutorial. Note: The game you’ll build will eventually use the accelerometer to control horizontal movement. If you are new to Sprite Kit, it would be best to work your way through Ray’s Sprite Kit Tutorial for Beginners before starting this tutorial series.īut if you’re comfortable with the basics of Sprite Kit, then jump right in! As you build your game, you’ll learn how to use a number of Sprite Kit’s capabilities, including the physics engine, collision detection, accelerometer control and scene transitions. If you’ve somehow missed trying Mega Jump from the App Store, it’s quite a popular vertical jumping game with really nice graphics and addictive gameplay. In this two-part tutorial series, you will use Sprite Kit and Swift to create a game in the style of Mega Jump. Original post by tutorial team member Toby Stephens. Update April 17, 2015: This tutorial was updated for Xcode 6.3 / Swift 1.2 by Michael Briscoe. In part one of this two-part tutorial series, you’ll start creating a game like Mega Jump, and implement the overall scene, physics, and sound effects using Swift and Sprite Kit!
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |