Return to Video

Beginner 2D UFO Game 1 of 9: Introduction - Unity Official Tutorials

  • 0:04 - 0:06
    In this beginner assignment we're going to make a
  • 0:06 - 0:08
    very simple but playable 2D game
  • 0:08 - 0:10
    to use many of the basic concepts
  • 0:10 - 0:12
    from the beginner tutorial modules.
  • 0:12 - 0:14
    We'll be making a 2D UFO game
  • 0:14 - 0:17
    where we'll be collecting gold nuggets.
  • 0:18 - 0:21
    We'll see how to create new game objects,
  • 0:21 - 0:23
    add components to these game objects,
  • 0:23 - 0:26
    set the values on their properties,
  • 0:26 - 0:28
    and position these game objects in the scene
  • 0:28 - 0:30
    to create a game.
  • 0:31 - 0:33
    In our game the player will control
  • 0:33 - 0:35
    a UFO flying around the game board in a
  • 0:35 - 0:37
    top-down 2D view.
  • 0:37 - 0:39
    We'll move the UFO using physics and forces.
  • 0:39 - 0:41
    We'll look at the input from the player
  • 0:41 - 0:43
    through the keyboard and we'll use those inputs
  • 0:43 - 0:45
    to apply forces to the UFO,
  • 0:45 - 0:47
    making it move in our scene.
  • 0:48 - 0:50
    We'll see how to detect contact between
  • 0:50 - 0:52
    the UFO and the pickup game objects
  • 0:52 - 0:55
    and use these events to collect
  • 0:55 - 0:56
    the pickup game objects.
  • 0:57 - 0:59
    When we've done we'll have made a simple
  • 0:59 - 1:01
    UFO game where the player controls the
  • 1:01 - 1:03
    UFO with the keyboard, picks up and counts
  • 1:03 - 1:05
    special collectable objects,
  • 1:05 - 1:07
    displays the current count,
  • 1:07 - 1:10
    and ends the game when all of the
  • 1:10 - 1:12
    game objects have been picked up.
  • 1:13 - 1:15
    To complete this project we'll use custom
  • 1:15 - 1:17
    created 2D art assets
  • 1:17 - 1:19
    which can be downloaded from the
  • 1:19 - 1:21
    Unity Asset Store.
  • 1:21 - 1:24
    Let's begin by creating a new project.
  • 1:25 - 1:27
    First open the Unity editor
  • 1:27 - 1:29
    if you haven't done that already.
  • 1:29 - 1:31
    You can create a new project by
  • 1:31 - 1:34
    choosing File - New Project.
  • 1:36 - 1:38
    This will bring us to the home screen.
  • 1:39 - 1:41
    On the home screen you can create a
  • 1:41 - 1:43
    new project either by hitting the
  • 1:43 - 1:45
    blue Create New Project button
  • 1:45 - 1:47
    in the centre of the window,
  • 1:47 - 1:49
    or by clicking the New button
  • 1:49 - 1:51
    at the top of the window.
  • 1:53 - 1:55
    The first thing that we need to do is
  • 1:55 - 1:56
    to give our project a name,
  • 1:56 - 1:59
    I'm going to call the project UFO Game.
  • 2:02 - 2:04
    The next thing we need to do is set the
  • 2:04 - 2:06
    destination, or path, to our new project.
  • 2:07 - 2:09
    I'm going to put this new project on my desktop.
  • 2:17 - 2:19
    You'll see we have a choice
  • 2:19 - 2:21
    to set the project preferences
  • 2:21 - 2:24
    to either 3D or 2D mode.
  • 2:24 - 2:26
    Since we're working in 2D
  • 2:26 - 2:28
    I'm going to click 2D.
  • 2:30 - 2:32
    This will set the preferences for the Unity editor
  • 2:32 - 2:35
    to useful defaults for creating 2D game.s
  • 2:37 - 2:40
    For more information on working in 2D,
  • 2:40 - 2:42
    please see the information linked below.
  • 2:44 - 2:47
    Now click the Create Project button
  • 2:47 - 2:49
    to create our new project.
  • 2:50 - 2:52
    Unity will create a new empty scene
  • 2:52 - 2:54
    for us to work in.
  • 2:54 - 2:56
    The first thing we'll need to do is to download
  • 2:56 - 2:58
    and import our art assets
  • 2:58 - 3:01
    from the Unity Asset Store.
  • 3:01 - 3:03
    To access the Asset Store choose
  • 3:03 - 3:06
    Window - Asset Store.
  • 3:06 - 3:08
    Or use the keyboard shortcut
  • 3:08 - 3:10
    command + 9 on mac,
  • 3:10 - 3:12
    or control + 9 on windows.
  • 3:13 - 3:15
    The Asset Store is a service that
  • 3:15 - 3:17
    Unity Technologies provides
  • 3:17 - 3:19
    where creators can both buy and sell
  • 3:19 - 3:21
    assets to make games.
  • 3:21 - 3:26
    These include art, music, scripts, effects,
  • 3:26 - 3:29
    all the way up to complete games and projects.
  • 3:30 - 3:32
    Unity also publishes content
  • 3:32 - 3:34
    to the Asset Store, including teaching
  • 3:34 - 3:36
    projects like this one to help
  • 3:36 - 3:38
    you learn how to make games.
  • 3:39 - 3:41
    By default the Asset Store is
  • 3:41 - 3:43
    opened as a docked tab.
  • 3:44 - 3:46
    Let's undock the tab so that we can
  • 3:46 - 3:48
    expand the window.
  • 3:58 - 4:00
    In the upper-right corner of
  • 4:00 - 4:02
    the expanded Asset Store window
  • 4:02 - 4:05
    we'll see a listing of asset categories.
  • 4:06 - 4:08
    At the bottom we should find
  • 4:08 - 4:10
    Unity Essentials.
  • 4:10 - 4:12
    Expand this category and we'll find
  • 4:12 - 4:15
    a subcategory called Sample Projects.
  • 4:17 - 4:19
    Within Sample Projects we'll find
  • 4:19 - 4:22
    an item called 2D UFO tutorial.
  • 4:22 - 4:25
    Click on the item title to open it.
  • 4:26 - 4:28
    Once the page loads we'll see a
  • 4:28 - 4:31
    download button in the upper-left corner.
  • 4:31 - 4:33
    Click on the Download button to begin
  • 4:33 - 4:35
    downloading the assets.
  • 4:36 - 4:38
    The Download button will be replaced
  • 4:38 - 4:40
    by the percentage of the download completed
  • 4:40 - 4:42
    once we click on it.
  • 4:42 - 4:44
    Once the download is complete we'll see
  • 4:44 - 4:48
    a dialogue labelled Importing Complete Project.
  • 4:48 - 4:50
    This warns us that importing a
  • 4:50 - 4:53
    complete project will overwrite
  • 4:53 - 4:55
    our current project settings.
  • 4:55 - 4:57
    In this case, because we've just created a
  • 4:57 - 4:59
    new project this is fine.
  • 5:00 - 5:03
    Click the Import button to continue.
  • 5:04 - 5:06
    Next we'll be given a choice
  • 5:06 - 5:08
    of which assets we would like to
  • 5:08 - 5:10
    import in to our project.
  • 5:10 - 5:13
    The default is All, which is what we want,
  • 5:13 - 5:15
    so go ahead and click Import.
  • 5:16 - 5:18
    Close the Asset Store window.
  • 5:19 - 5:22
    We now have our new project with our assets imported.
  • 5:22 - 5:24
    And the default new empty scene open.
  • 5:25 - 5:27
    Before creating anything in the new scene
  • 5:27 - 5:29
    we need to save our scene.
  • 5:29 - 5:31
    We can save our scene by choosing
  • 5:31 - 5:33
    File - Save Scene,
  • 5:33 - 5:37
    or by using the keyboard shortcut
  • 5:37 - 5:38
    command + S on mac,
  • 5:38 - 5:40
    or control + S on windows.
  • 5:43 - 5:45
    I'm going to save this scene
  • 5:45 - 5:47
    in the Assets directory in the
  • 5:47 - 5:49
    folder called Scenes.
  • 5:53 - 5:55
    I'm going to call the scene Main.
  • 6:00 - 6:02
    We can now see in our Scenes folder
  • 6:02 - 6:04
    the scene called Main.
  • 6:05 - 6:07
    It's worth noting that the
  • 6:07 - 6:11
    Completed, Prefabs, Scenes, Scripts
  • 6:11 - 6:13
    and Sprites folders
  • 6:13 - 6:17
    were all created when we imported our asset package.
  • 6:20 - 6:22
    The Completed folder contains
  • 6:22 - 6:25
    a completed version of the project,
  • 6:25 - 6:27
    which you can refer to if you get stuck.
  • 6:30 - 6:32
    Great, that's the end of our first lesson.
  • 6:32 - 6:36
    In our next lesson we're going to lay out our play field.
Title:
Beginner 2D UFO Game 1 of 9: Introduction - Unity Official Tutorials
Description:

more » « less
Video Language:
English
Duration:
06:44

English subtitles

Revisions