Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Player vs Player tvOS Games
Highest Rated
Rating: 4.9 out of 5(10 ratings)
104 students

Player vs Player tvOS Games

Learn to program one or two player games with external game controllers on the new Apple TV
Created byJustin Dike
Last updated 1/2017
English
English [Auto],

What you'll learn

  • Program a One or Two Player Game with Swift and Sprite Kit
  • Work with External Game Controllers and the new Apple TV (or iOS apps)
  • Learn the fundamentals of creating a tvOS app

Course content

3 sections28 lectures5h 26m total length
  • Introduction3:02

    Explore how external game controllers and the micro gamepad enhance two-player tvOS battles on Apple TV, including disconnect handling and setting up a two-player game in code.

  • Connecting an Extended GamePad Controller19:23

    Discover how to connect an extended gamepad controller in a two-player tvOS game, set up controller observers, assign player indices, and handle gamepad inputs.

  • Connecting Standard and Micro Gamepad (the remote) Controllers19:57

    Learn to connect standard and micro gamepads to a tvOS two-player game, test d-pad and thumbstick input, and map buttons for jump, fire, pause, and menu.

  • Project files for Swift 3 / Swift 2.20:03
  • Moving Player 1 with the Extended or Micro Gamepad16:07

    Move a tank in a tvOS game using the extended controller or micro gamepad, with the left thumb stick for movement and the right for turret rotation.

  • Rotating with the Extended and MicroGamePad15:26

    Learn to rotate the turret using the right thumb stick on extended and micro gamepads, implementing rotation in update with a rotation out, speed adjustments, and compatibility for standard controllers.

  • Wrapping up One-Player Controls with Firing7:48

    In this lecture, you implement one-player firing by creating bullet sprites with physics bodies, calculating launch positions, applying force vectors, and adding a firing cooldown for two-player readiness.

  • Project Files 20:13

Requirements

  • Some basic knowledge of Xcode and Swift / Sprite Kit is preferred

Description

***SOURCE PROJECT FILES UPDATED FOR SWIFT 3 (see change notes below)

In the first section of videos, you'll learn how to find connected controllers, define which buttons do what, set player indexes (i.e. Player 1, Player 2, etc) and work with a basic character.

In section 2, you'll learn the Swift  / Sprite Kit code to work with multiple Extended / Standard Gamepad controllers (as well as the Micro Gamepad controller), to go head to head versus players in the same room. After we look at the finer points of connecting and disconnecting controllers and getting each in the right player slot, we'll discuss how to control who is who in any type game, and even go into a one-player mode where the CPU takes control of the second player. This way your two-player game can also be enjoyed by single players. We'll also discuss adding a Pause menu to your game, where players can go back to a Main menu or keep on playing.

Now that we've covered all our bases in terms of controlling each player and dealing with controllers disconnecting and reconnecting, section 3 allows us to have some fun. This session we'll loosen things up a bit and just talk game play. Topics include collision detection, decrementing health, losing lives / restarting rounds, and other topics worthy of a good two-player game!

***CHANGE NOTES FROM SWIFT 2 to 3

We've included updated source files for Swift 3. If you choose to follow along, line-by-line with the video code, you should have no problems, as Xcode 8 will auto-suggest the correct code for Swift 3.


Who this course is for:

  • Intermediate Swift and Sprite Kit students
  • Anyone who wants to start making money in the new Apple TV store!