0:00:03.606,0:00:05.573 In this beginner assignment we're going to make a 0:00:05.573,0:00:08.064 very simple but playable 2D game 0:00:08.064,0:00:10.064 to use many of the basic concepts 0:00:10.064,0:00:12.064 from the beginner tutorial modules. 0:00:12.369,0:00:14.369 We'll be making a 2D UFO game 0:00:14.369,0:00:16.940 where we'll be collecting gold nuggets. 0:00:18.077,0:00:20.629 We'll see how to create new game objects, 0:00:20.629,0:00:22.893 add components to these game objects, 0:00:22.893,0:00:25.664 set the values on their properties, 0:00:25.664,0:00:27.955 and position these game objects in the scene 0:00:27.955,0:00:29.955 to create a game. 0:00:30.718,0:00:32.718 In our game the player will control 0:00:32.718,0:00:34.718 a UFO flying around the game board in a 0:00:34.718,0:00:36.606 top-down 2D view. 0:00:36.606,0:00:39.423 We'll move the UFO using physics and forces. 0:00:39.423,0:00:41.423 We'll look at the input from the player 0:00:41.423,0:00:43.423 through the keyboard and we'll use those inputs 0:00:43.423,0:00:44.976 to apply forces to the UFO, 0:00:44.976,0:00:46.976 making it move in our scene. 0:00:47.628,0:00:49.628 We'll see how to detect contact between 0:00:49.628,0:00:52.293 the UFO and the pickup game objects 0:00:52.293,0:00:54.600 and use these events to collect 0:00:54.600,0:00:56.323 the pickup game objects. 0:00:56.919,0:00:58.919 When we've done we'll have made a simple 0:00:58.919,0:01:00.919 UFO game where the player controls the 0:01:00.919,0:01:03.390 UFO with the keyboard, picks up and counts 0:01:03.390,0:01:05.390 special collectable objects, 0:01:05.390,0:01:07.390 displays the current count, 0:01:07.390,0:01:09.725 and ends the game when all of the 0:01:09.725,0:01:11.725 game objects have been picked up. 0:01:13.043,0:01:15.043 To complete this project we'll use custom 0:01:15.043,0:01:17.043 created 2D art assets 0:01:17.043,0:01:19.043 which can be downloaded from the 0:01:19.043,0:01:21.043 Unity Asset Store. 0:01:21.043,0:01:23.854 Let's begin by creating a new project. 0:01:24.866,0:01:26.866 First open the Unity editor 0:01:26.866,0:01:28.866 if you haven't done that already. 0:01:28.866,0:01:30.866 You can create a new project by 0:01:30.866,0:01:33.847 choosing File - New Project. 0:01:36.357,0:01:38.357 This will bring us to the home screen. 0:01:39.369,0:01:41.369 On the home screen you can create a 0:01:41.369,0:01:43.369 new project either by hitting the 0:01:43.369,0:01:45.369 blue Create New Project button 0:01:45.369,0:01:47.369 in the centre of the window, 0:01:47.369,0:01:49.369 or by clicking the New button 0:01:49.369,0:01:51.369 at the top of the window. 0:01:53.103,0:01:55.103 The first thing that we need to do is 0:01:55.103,0:01:56.367 to give our project a name, 0:01:56.367,0:01:58.896 I'm going to call the project UFO Game. 0:02:01.753,0:02:03.753 The next thing we need to do is set the 0:02:03.753,0:02:05.753 destination, or path, to our new project. 0:02:06.530,0:02:08.839 I'm going to put this new project on my desktop. 0:02:16.922,0:02:18.922 You'll see we have a choice 0:02:18.922,0:02:20.922 to set the project preferences 0:02:20.922,0:02:24.004 to either 3D or 2D mode. 0:02:24.004,0:02:25.797 Since we're working in 2D 0:02:25.797,0:02:27.797 I'm going to click 2D. 0:02:30.058,0:02:32.352 This will set the preferences for the Unity editor 0:02:32.352,0:02:35.488 to useful defaults for creating 2D game.s 0:02:36.724,0:02:39.614 For more information on working in 2D, 0:02:39.614,0:02:41.614 please see the information linked below. 0:02:43.958,0:02:47.067 Now click the Create Project button 0:02:47.067,0:02:49.067 to create our new project. 0:02:49.816,0:02:51.816 Unity will create a new empty scene 0:02:51.816,0:02:53.816 for us to work in. 0:02:54.371,0:02:56.371 The first thing we'll need to do is to download 0:02:56.371,0:02:58.371 and import our art assets 0:02:58.371,0:03:00.566 from the Unity Asset Store. 0:03:01.009,0:03:03.009 To access the Asset Store choose 0:03:03.009,0:03:05.732 Window - Asset Store. 0:03:05.732,0:03:07.732 Or use the keyboard shortcut 0:03:07.732,0:03:09.732 command + 9 on mac, 0:03:09.732,0:03:12.388 or control + 9 on windows. 0:03:13.373,0:03:15.373 The Asset Store is a service that 0:03:15.373,0:03:17.373 Unity Technologies provides 0:03:17.373,0:03:19.373 where creators can both buy and sell 0:03:19.373,0:03:21.373 assets to make games. 0:03:21.373,0:03:25.643 These include art, music, scripts, effects, 0:03:25.643,0:03:28.748 all the way up to complete games and projects. 0:03:30.316,0:03:32.316 Unity also publishes content 0:03:32.316,0:03:34.316 to the Asset Store, including teaching 0:03:34.316,0:03:36.316 projects like this one to help 0:03:36.316,0:03:38.316 you learn how to make games. 0:03:39.328,0:03:41.328 By default the Asset Store is 0:03:41.328,0:03:43.328 opened as a docked tab. 0:03:44.077,0:03:46.077 Let's undock the tab so that we can 0:03:46.077,0:03:48.077 expand the window. 0:03:58.326,0:04:00.326 In the upper-right corner of 0:04:00.326,0:04:02.326 the expanded Asset Store window 0:04:02.326,0:04:05.264 we'll see a listing of asset categories. 0:04:05.916,0:04:07.916 At the bottom we should find 0:04:07.916,0:04:09.916 Unity Essentials. 0:04:09.916,0:04:11.916 Expand this category and we'll find 0:04:11.916,0:04:15.387 a subcategory called Sample Projects. 0:04:16.538,0:04:18.538 Within Sample Projects we'll find 0:04:18.538,0:04:21.558 an item called 2D UFO tutorial. 0:04:22.473,0:04:25.007 Click on the item title to open it. 0:04:26.158,0:04:28.158 Once the page loads we'll see a 0:04:28.158,0:04:31.364 download button in the upper-left corner. 0:04:31.364,0:04:33.364 Click on the Download button to begin 0:04:33.364,0:04:35.364 downloading the assets. 0:04:35.752,0:04:37.752 The Download button will be replaced 0:04:37.752,0:04:39.752 by the percentage of the download completed 0:04:39.752,0:04:41.752 once we click on it. 0:04:42.307,0:04:44.307 Once the download is complete we'll see 0:04:44.307,0:04:47.574 a dialogue labelled Importing Complete Project. 0:04:48.434,0:04:50.434 This warns us that importing a 0:04:50.434,0:04:52.855 complete project will overwrite 0:04:52.855,0:04:54.855 our current project settings. 0:04:55.382,0:04:57.382 In this case, because we've just created a 0:04:57.382,0:04:59.382 new project this is fine. 0:05:00.242,0:05:02.960 Click the Import button to continue. 0:05:03.820,0:05:05.820 Next we'll be given a choice 0:05:05.820,0:05:07.820 of which assets we would like to 0:05:07.820,0:05:09.820 import in to our project. 0:05:09.820,0:05:12.827 The default is All, which is what we want, 0:05:12.827,0:05:14.827 so go ahead and click Import. 0:05:16.325,0:05:18.325 Close the Asset Store window. 0:05:19.310,0:05:22.059 We now have our new project with our assets imported. 0:05:22.059,0:05:24.339 And the default new empty scene open. 0:05:25.432,0:05:27.432 Before creating anything in the new scene 0:05:27.432,0:05:29.432 we need to save our scene. 0:05:29.432,0:05:31.432 We can save our scene by choosing 0:05:31.432,0:05:33.432 File - Save Scene, 0:05:33.432,0:05:36.715 or by using the keyboard shortcut 0:05:36.715,0:05:38.492 command + S on mac, 0:05:38.492,0:05:40.492 or control + S on windows. 0:05:42.850,0:05:44.850 I'm going to save this scene 0:05:44.850,0:05:46.850 in the Assets directory in the 0:05:46.850,0:05:48.850 folder called Scenes. 0:05:53.329,0:05:55.329 I'm going to call the scene Main. 0:06:00.003,0:06:02.003 We can now see in our Scenes folder 0:06:02.003,0:06:04.003 the scene called Main. 0:06:05.445,0:06:07.445 It's worth noting that the 0:06:07.445,0:06:11.271 Completed, Prefabs, Scenes, Scripts 0:06:11.271,0:06:13.271 and Sprites folders 0:06:13.271,0:06:17.395 were all created when we imported our asset package. 0:06:19.586,0:06:21.586 The Completed folder contains 0:06:21.586,0:06:24.857 a completed version of the project, 0:06:24.857,0:06:27.447 which you can refer to if you get stuck. 0:06:29.575,0:06:31.575 Great, that's the end of our first lesson. 0:06:32.282,0:06:35.648 In our next lesson we're going to lay out our play field.