How to make a video game in unity на русском
How to make a video game in unity на русском
Creating a 2D game
Before you create a 2D game, you need to decide on a game perspective and an art style.
To create a 2D game, set up your Unity project and then familiarize yourself with the relevant concepts in the following order:
Sprites A 2D graphic objects. If you are used to working in 3D, Sprites are essentially just standard textures but there are special techniques for combining and managing sprite textures for efficiency and convenience during development. More info
See in Glossary
Fundamentals
GameObjects The fundamental object in Unity scenes, which can represent characters, props, scenery, cameras, waypoints, and more. A GameObject’s functionality is defined by the Components attached to it. More info
See in Glossary are fundamental objects in Unity that represent characters, props, scenery, and more. Every object in your game is a GameObject.
The behavior of GameObjects is defined by blocks of functionality called components. The following components are fundamental for 2D games:
Transform: the Transform component A Transform component determines the Position, Rotation, and Scale of each object in the scene. Every GameObject has a Transform. More info
See in Glossary determines the Position, Rotation, and Scale of each GameObject in the scene. Every GameObject has a Transform component.
Sprite Renderer A component that lets you display images as Sprites for use in both 2D and 3D scenes. More info
See in Glossary : the Sprite Renderer component renders the Sprite and controls how it looks in a scene.
Cameras A component which creates an image of a particular viewpoint in your scene. The output is either drawn to the screen or captured as a texture. More info
See in Glossary : devices that capture and display the world to the player. Marking a Camera as Orthographic removes all perspective from the Camera’s view. This is mostly useful for making isometric or 2D games.
Components are UI (User Interface) Allows a user to interact with your application. Unity currently supports three UI systems. More info
See in Glossary representations of C# classes; you can use scripts to change and interact with components, or create new ones. See the Scripting section for more details.
Scripting
For details on how to use scripts in Unity see Scripting Overview. Also see the Unity Learn Beginner Scripting course.
Scripts are attached to GameObjects, and any script you create inherits from the MonoBehaviour class.
Sprites
Sprites are 2D graphic objects. You use Sprites for all types of 2D games. For example, you can import an image of your main character as a Sprite.
A character Sprite
You can also use a collection of Sprites to build a character. This allows you greater control over the movement and animation of your characters.
Multiple Sprites that make up the parts of a character, displayed in the Sprite Editor
Importing and setting up Sprites
Import your Sprites with Unity’s recommended settings; see Importing and Setting Up Sprites.
Rendering Sprites
Use the Sprite Renderer component to render your Sprites. For example, you can use the Sprite Renderer to change the color and opacity of a Sprite.
Adjusting the color of a Sprite with the Sprite Renderer
See the Introduction to the Sprite Renderer Learn tutorial. Sorting SpritesBy organizing Sprites in layers, you can create an illusion of depth. You can sort Sprites according to many strategies. See Sorting Sprites for full details. For example, you might sort Sprites along the y-axis, so that Sprites that are higher up are sorted behind Sprites that are lower, to make the Sprites that are higher appear further away than the Sprites that are lower.
Sprites sorted along the y-axis
To set the overlay order of Sprites, use Sorting Layers.
To group GameObjects with Sprite Renderers, and control the order in which they render their Sprites, use Sorting Groups.
Sprite Atlas
You can use a Sprite Atlas A texture that is composed of several smaller textures. Also referred to as a texture atlas, image sprite, sprite sheet or packed texture. More info
See in Glossary to consolidate several Textures into a single combined Texture. This optimizes your game and saves memory. For example, you can add all your Sprites associated with a particular character or purpose to a Sprite Atlas.
A Sprite Atlas
Building in-game environments
Environment design refers to the process of building your game’s levels and environments. You can combine the environment design tools in this section in whichever way makes the most sense for your game; for example, you can make a top-down game using only 9-slice, or you can make a side on platformer with Tilemap and SpriteShape.
9-slicing
9-slicing is a 2D technique that allows you to reuse an image at various sizes without needing to prepare multiple assets. Unity can dynamically stretch and tile designated parts of a Sprite to allow one Sprite to serve as the border or background for UI elements of many sizes. See 9-slicing sprites.
For example, you could use 9-slicing to stretch a Sprite to shape when you build a 2D level.
A 9-sliced Sprite, split into nine sections
Tilemap
The Tilemap A GameObject that allows you to quickly create 2D levels using tiles and a grid overlay. More info
See in Glossary component is a system that stores and handles Tile assets for creating 2D levels. Use the 2D Tilemap Editor package (installed by default) to use Tilemaps.
For example, you can use Tilemaps to paint levels using Tiles and brush tools and define rules for how Tiles behave.
The Tile Palette window, used to edit Tilemaps
2D Tilemap Extras
To add some extra Tilemap assets to your Project, install the 2D Tilemap Extras package. This package contains reusable 2D and Tilemap Editor scripts that you can use for your own Projects. You can customize the behavior of the scripts to create new Brushes that suit different scenarios.
Isometric Tilemaps
For games with isometric perspective, you can create Isometric Tilemaps.
SpriteShape
In a similar way to a vector drawing tool, SpriteShape provides a more flexible way to create larger Sprites, such as organic-looking landscapes and paths. See the Sprite Shape Profile.
A path created in SpriteShape
Character animation
There are three different ways you can animate 2D characters:
2D animation type | Used for |
---|---|
Frame-by-frame | Artistic reasons, if you want your game to have a classic animation art style. Frame-by-frame animation is relatively resource-intensive, both to make and to run. |
Cutout | Smooth skeletal animation, when the characters don’t require realistic articulation. |
Skeletal | Smooth skeletal animation where Sprites bend according to the bone structure. Use this when the characters need a more organic feel. |
Frame-by-frame
Frame-by-frame animation is based on the traditional cel animation technique of drawing each moment of an animation as individual images, which are played in fast sequence, like flipping pages on a flipbook.
To do frame-by-frame animation, follow the Frame-by-frame Animation workflow.
Frame-by-frame animation in the Sprite Editor
Cutout
In cutout animation, multiple Sprites make up the body of a character, and each piece moves to give the visual effect of the whole character moving. This animation style is similar to skeletal animation (see below), except that the Sprites don’t bend.
Cutout animation in the Sprite Editor
Skeletal
With skeletal animation, you map a Sprite or a group of Sprites onto an animation skeleton. You can create and define animation bones for characters and objects, that define how they should bend and move. This approach allows the bones to bend and deform the Sprites, for a more natural movement style. To use skeletal animation, you need to use the 2D Animation package (installed by default).
For a 2D Animation workflow, including a guide to working with the Bone Editor, see the 2D Animation documentation.
A character with bones in the Bone Editor
Graphics
This section describes your graphics options when using Universal Render Pipeline A series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary (URP).
Lighting
Because you’re using URP with the 2D Renderer, you can use the Light 2D component to apply optimized 2D lighting to Sprites. For details, see Introduction to Lights 2D.
These two images show the same scene; in the image on the left, 2D Lights are disabled, and in the image on the right, 2D lights are enabled. With 2D Lights, you can use the same Sprites to create different weather conditions or moods.
To set up lighting:
Prepare your Sprites for lighting. For details, see Preparing Sprites for Lighting.
Set up normal map A type of Bump Map texture that allows you to add surface detail such as bumps, grooves, and scratches to a model which catch the light as if they are represented by real geometry.
See in Glossary and mask Textures. 2D Lights can interact with normal map and mask Textures linked to Sprites to create advanced lighting effects, such as normal mapping. See Setting up normal map and mask Textures.
Create a 2D Light GameObject; see 2D Lights Properties.
Configure the 2D Renderer Data asset; see Configuring the 2D Renderer Asset.
(Optional) if you want to apply 2D Light effects to a pixel The smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
See in Glossary art game, see 2D Pixel Perfect.
Shadows
To define the shape and properties that a Light uses to determine the shadows it casts, use the Shadow Caster 2D component. Increase the Light’s Shadow Intensity above zero.
A shadow intensity of 0.5 in the Shadow Caster 2D component
Enhanced look and feel
Particle systems and post-processing A process that improves product visuals by applying filters and effects before the image appears on screen. You can use post-processing effects to simulate physical camera and film properties, for example Bloom and Depth of Field. More info post processing, postprocessing, postprocess
See in Glossary are optional tools that you can use to add polish to your game.
Particle systems
A fire effect, created with the Particle System and Shader Graph for 2D
Post-processing
You can use post-processing effects and full-screen effects to significantly improve the appearance of your game. For example, you can use these effects to simulate physical camera or film properties, or to create stylized visuals.
URP has its own post-processing implementation. See Post-processing in the Universal Render Pipeline.
The Lost Crypt demo uses the bloom and vignette post-processing effects
Physics 2D
The Physics 2D settings define limits on the accuracy of the physical simulation in your 2D game. See 2D Physics.
This video provides an overview of 2D physics features in Unity 2020.1.
The following 2D physics tools are useful for 2D games.
Rigidbody 2D
A Rigidbody A component that allows a GameObject to be affected by simulated gravity and other forces. More info
See in Glossary 2D component places a GameObject under the control of the physics engine. See Rigidbody 2D.
The Rigidbody 2D component
Collider 2D
The Collider 2D types that you can use with Rigidbody 2D are:
The Circle Collider 2D component
Triggers
When you set a Collider 2D as a Trigger (by enabling its Is Trigger property), it no longer behaves as a physical object, and it can intersect with other Colliders without causing a collision. Instead, when a Collider enters its space, Unity calls the OnTriggerEnter function on the Trigger GameObject’s scripts.
The Circle Collider 2D component with Is Trigger selected
2D Joints
Joints attach GameObjects together. You can only attach 2D joints A physics component allowing a dynamic connection between Rigidbody components, usually allowing some degree of movement such as a hinge. More info
See in Glossary to GameObjects that have a Rigidbody 2D component attached, or to a fixed position in world space. See 2D Joints.
2D Effectors
Use Effector 2D components A functional part of a GameObject. A GameObject can contain any number of components. Unity has many built-in components, and you can create your own by writing scripts that inherit from MonoBehaviour. More info
See in Glossary with Collider 2D components to direct the forces of physics in your scene when GameObject Colliders come into contact with each other. See 2D Effectors.
Audio
You can add background music and sound effects to your game in Unity; see Audio Overview. Use third-party software to create your audio and import it into Unity with the recommended settings.
User interface
If you want to add a menu or help to your game, you need to set up a user interface. To set up a user interface, use Unity UI.
Profiling, optimizing and testing a build
Profiling
Profiling allows you to see how resource-intensive the different parts of your game are. You should always profile your game on its target release platform; see Profiling your application.
Optimizing
After profiling, you can use the results to make performance improvements and optimizations. See Understanding optimization in Unity.
Testing
Test your game and your code with the Unity Test Framework; see Unity Test Framework.
The Test Runner window
Publishing
When you’ve finished your game, you’re ready to publish it. See Publishing Builds.
The Build Settings window
How to make a video game without any coding experience
Even if you don’t have a knack for programming, you can still achieve a lot in Unity with tools from the Asset Store and artist and designer-friendly features natively integrated in the editor.
It’s true that most of the interactive content you create in Unity relies on text-based programming. Unity supports the C# programming language, and there are two main areas that need to be understood: logic and syntax. You can think about the logic as ‘what’s supposed to happen’ and syntax as the language in which we communicate that.
However, if you have little or no experience with Unity or coding, and simply want to begin to understand some basic workflows and concepts, then we suggest that you download the free version of the Unity editor via the “First-time Users” option on our Getting Started page. During the download process you will be able to select a ready-made Microgame that will automatically open in the editor when you launch it.
With your Microgame open, you can immediately begin to make simple changes to it by following the interactive tutorials in the editor, that guide you step-by-step through your first creative tasks in Unity.
When you’re done with the tutorials, you can continue customizing your Microgame with our collection of Mods that enable you to build on and add to your microgame in a number of fun and simple ways.
There are also plenty of tools available in the Asset Store that help you get very far in your game creation with little or no coding. Take a look at three of the best in the following sections.
Bolt, which is free with all versions of Unity, gives you the ability to bring your visions to reality in a creative and visual way, thanks to its fully-featured visual scripting system developed by award-winning tool and game developer Lazlo Bonin. There’s no integration layer between Bolt and Unity which simplifies maintenance. Bolt will improve your ability to prototype rapidly, iterate and bring your ideas to life faster.
“I wanted to make a visual tool, a tool that’s meant to work for visual thinkers, people who enjoy good design and visual feedback, people who want to know what’s going on at a glance, know when and where there’s an error or warning.” (Lazlo Bonin, Bolt publisher)
Bolt in action
Laszlo Bonin started working on the Bolt visual scripting tool while he and his team were still working on the narrative, walk-around experience called Ephemera. They were looking for visual state machines that could help artists and animators contribute to the scene structure and gameplay, while still focusing on the core systems and coding.
With Bolt, you have immediate access to your own character classes and your own item classes, etc. You can just call functions from these inside the tool and set properties.
“I don’t have to do anything nor do my users: Bolt just automatically picks it up. It directly analyzes and reads the entire code base and gives you options.”
If you’re a designer or an artist who wants to realize your creative potential without coding, PlayMaker’s the way to go. You can quickly make gameplay prototypes and A.I behaviors, as well as animation graphs and interactive objects. This visual scripting tool was also used in games such as Hearthstone, INSIDE and Dreamfall Chapters.
«Playmaker is the smoothest and most intuitive way for non-coders to implement functionality into our games!» Andreas N Grøntved, INSIDE
PlayMaker in action
Playmaker is a visual scripting tool which replaces the text-based paradigm with a visual metaphor. The logic is expressed through graphics, wired together to create relationships, and syntax automatically expressed using pre-made Actions that can be selected from a list.
A tool like PlayMaker integrated in Unity empowers a lot of creators who are interested in game creation, the story, or relationship between characters and objects, without having to get down to the code syntax details.
If you want to see how it works, there’s a series of videos that explores how to create interactivity using visual scripting with PlayMaker.
Numerous game creators have struggled with getting right the code syntax and error compilers, but you don’t have to be stuck there. Get back to what’s important to you.
Adventure Creator is the asset you need if you’re into making 2D, 2.5D or 3D games in Unity, no coding required. Its visual scripting system and intuitive Editor enables beginners to build an entire game without writing a line of code, and helps programmers plug-and-play their own functionality.
“It’s incredible, all of the tools needed to create a professional looking point-n-click game without having to type a single line of code. Plus the creator is super helpful and has pulled me through many issues and complex ideas I’ve had with his software.” (Ash Denton, Capital)
Adventure Creator in action
Another example of a tool that makes a non-coder’s life easier in Unity is Ash Denton’s story.
He has worked on videos for Inside XBox and is one of the creators of the “Thank You for Playing” video series.
Ash found through the Unity community the Adventure Creator, an open ended and flexible tool that allowed him to get 2D characters in a 3D world. What’s great with this tool for a non-coder is that you can easily create node-based scripted events and buttons, and the scene manager organizes all the logic in a scene, including hotspots, navigation and triggers.
If you are interested in learning how coding works in Unity, we provide free resources on our Learn site, such as:
You can also subscribe to Learn Premium, which gives access to an extensive collection of scripting tutorials from our team as well as Unity-approved content featured on partner platforms like Coursera, Udemy, Pluralsight, and Pathstream.
Finally, there are many free resources available from our community of users that will teach you coding in Unity, including Brackeys, Code Monkey, and Jabrils.
The Unity Editor is a creative hub for artists, designers, developers, and other team members. It includes 2D and 3D scene design tools, storytelling and cinematics, lighting, audio system, Sprite management tools, particle effects and a powerful dopesheet animation system. Get an overview of the feature set:
There are thousands of other assets available in the Unity Asset Store to cut down your development time even more: characters, textures, environments, animation assets, 3D models and audio assets, as well as editor extensions and complete projects.
Make a video game in Unity: start here
One dream is all it takes to create a new world. Unity gives you the tools to make that dream a reality. You’ll find plenty of tips here on how to start making your first video game. Your background or skill set doesn’t matter: what counts is your drive to create!
Make a game, in a game
Start creating with ready-made Unity Microgames. Each Microgame comes with its own collection of Mods: fun and easy customizations that also introduce you to game design, logic, visuals and more.
LEGO® Microgame
Start creating games with virtual LEGOⓇ bricks in our latest Microgame!
FPS Microgame
Blast cookies, add cute-but-deadly enemy robots and decorate your dungeon. Make the FPS Microgame your own.
2D Platformer Microgame
Get confetti everywhere, trip the light fantastic and put a spring in the step of your 2D character in this cute Platformer.
3D Karting Microgame
Plunk down some gummy bears, get the sparks to fly and add some bounce to your ride in this fun Karting game.
Your first game jam with Unity
The global Unity Community provides many ways for creators to connect with each other. For newcomers, we provide game jams, challenges, and Creator Groups (one each for the Karting, 2D Platformer, and FPS Microgames) that help you feel confident about sharing your first creations. Everyone is welcome!
Made with Unity — Norman’s Island by Little Mountain Animation
Unity is the most widely-used game creation platform in the world – 50% of all mobile games are made with it, 60% of Augmented Reality & Virtual Reality content is powered by Unity, and «Unity developer» is #7 on the list of fastest-growing jobs in a recent LinkedIn U.S. Emerging Jobs report.
New creators can download Unity for free and begin with ready-made Unity Microgames and Mods. Learn with hundreds of free and affordable tutorials, courses, terms, and game kits, from both Unity and our amazing community.
Get inspired, learn & create
Create a 2D video game
Unity is the #1 platform for creating both 2D and 3D video games. If your heart yearns for 2D, then learn more about how to make them here.
Code a video game in Unity
Are you curious about how to program games? We have plenty of resources that will teach you the basics of C# coding in Unity.
Make a 3D game in Unity
Unity offers a suite of tools to help you build your first 3D game. Start here to find out more about building the next immersive world for players to explore.
Sykoo Sam: Get started making games
Sykoo Sam is an online Unity evangelist who also has his own popular game dev channel. Here are his tips for new creators.
Thomas Brush: Watch this before making your first game
Thomas Brush has been making games for over 10 years and has oodles of wisdom to share with both beginner and experienced creators.
Dani: Game developer and student
YouTuber Dani shares snippets from his everyday life as a game dev student along with tips for creating games in Unity.
Blackthornprod: “I made a game in one week with Unity”
In this video, Blackthornprod shares how he made a game in one week in Unity.
Brackeys: How to make a video game
Check out this series from uber-popular Brackeys that takes you through the basic stages of making a game.
Mix and Jam: Recreate cool stuff from real games
Mix and Jam takes elements from his favorite games and shows you how to recreate them in Unity.
Game development tools
We have a few suggestions for some basic tools to start your journey into game development.
Become a successful game developer
It takes a certain mindset, some basic skills, and a few great resources to begin building your reputation as a game developer.
Level design tips
The path to designing top-notch levels for your games involves attention to detail and familiarizing yourself with some important concepts.
Getting into the game industry
The barrier for entry into the gaming industry is not as high as you may think. Here’s how to work your way towards it.
Is Unity good for 2D games?
Let’s talk about what makes 2D game development feature-rich, intuitive, and fun in Unity.
Using Blender and Maya with Unity
Blender and Maya are two popular pieces of animation software. Here’s how to use them with Unity.
5 Unity tutorials for new game developers
Some of our best content creators show you how to start making games in Unity.
Video game terminology
We’ve created a comprehensive list of terms from game development, Unity, and the gaming world to help you become an industry pro.
5 common new game developer mistakes
Becoming a game developer is exciting and rewarding. Doing things correctly from the start will save you headaches in the long run.
10 game design tips for new developers
Tips for every new video game developer as they begin their game design work.
Five compelling video game character types
We’ll talk about what makes a video game character compelling enough to make players feel attached to them.
36 бесплатных курсов по разработке игр на Unity
Подборка онлайн-курсов по разработке 2D- и 3D-игр с нуля до уровня PRO.
1. «Intro Hyper Casual» от XYZ School
Длительность: 72 часа.
Формат обучения: записи видеоуроков и домашние задания (без проверки).
Программа обучения: курс поможет создать простую игру без навыков программирования. Материал рассчитан на новичков, которые рассматривают разработку игр в качестве возможной сферы деятельности.
Какие темы охватывает курс:
Об авторе: Игорь Зверев, ведущий геймдизайнер в студии VooDoo.
2. «Основы движка Unity» от itProger
Длительность: 9 уроков.
Формат обучения: видеоуроки и статьи.
Программа обучения: рассчитана на новичков, интересующихся сферой создания игр. Курс включает основы по работе с платформой Unity. Слушателей ждёт обзор интерфейса и основных функций движка, а к концу обучения каждый сможет самостоятельно простую 3D-игру.
Чему научитесь:
3. «Официальные уроки Unity на русском» от YouTube-канала «Игродел Мастер»
Длительность: 34 урока.
Формат обучения: видеоуроки.
Программа обучения: подборка коротких уроков с официального сайта Unity с переводом на русский язык. Курс подходит новичкам и охватывает основные возможности Unity от обзора интерфейса до создания игры.
Чему научитесь:
4. «Уроки Unity C#» от itProger
Длительность: 9 уроков.
Формат обучения: чтение статей и просмотр видео.
Программа обучения: курс посвящён изучению C# в комплекте с Unity. В процессе изучения материала будут рассмотрены основные функции движка, необходимые для создания современных игр. Программа рассчитана на пользователей, имеющих хотя бы базовые знания в области программирования. Новичкам рекомендуется для начала пройти курс по C# (ссылка есть в первом уроке). Есть подробная инструкция по установке движка.
Что изучите:
5. «Курс по C# для Unity3D» от Android Helper
Длительность: 17 уроков.
Формат обучения: видеоуроки.
Программа обучения: включает уроки по основам программирования на C# для создания игр на платформе Unity.
Что изучите:
6. «Уроки Unity3D» от SkyGamesCompany
Длительность: 67 уроков.
Формат обучения: видеоуроки.
Программа обучения: подборка уроков для пошагового самостоятельного создания игры на движке 3D. На уроках спикер использует готовые скрипты, но желательны хотя бы базовые знания в области ООП.
Какие темы охватывает курс:
7. «Создание игры на Android» от itProger
Длительность: 17 уроков.
Формат обучения: видеозаписи лекций и немного теории в виде текста.
Программа обучения: включает материалы по созданию 2D-игры для Android на движке Unity. На курсе рассматриваются основные концепции платформы, а также принципы создания игр на ней. К концу обучения каждый слушатель сможет самостоятельно создать простую игру.
Чему научитесь:
8. «Создание игр. Уроки по Unity3D» от YouTube-канала «Институт марксизма-ленинизма»
Длительность: 6 уроков.
Формат обучения: видеокурс.
Программа обучения: курс начального уровня с уроками по созданию простых игр на базе Unity3D.
Какие темы рассматриваются на уроках:
9. «Создание 2D-игры на Unity» от itProger
Длительность: 18 уроков.
Формат обучения: видеолекции.
Программа обучения: курс поможет пошагово создать простую 2D-игру в среде Unity с возможностью добавления в магазины App Store и Google Play. Материалы содержат поверхностную информацию, и программа подходит скорее новичкам, которые интересуются процессом создания игр. На уроках рассматриваются принципы настройки Unity для дальнейшего создания игры.
Чему научитесь:
10. «Unity-уроки с нуля» от TheGameDev
Длительность: 10 уроков.
Формат обучения: просмотр видео.
Программа обучения: подборка записей уроков по работе с платформой Unity. Крус подойдёт всем, кто хочет освоить создание игр с нуля. Спикер расскажет, что представляет площадка, для чего она создана и как с ней работать.
Какие темы рассматриваются:
11. «Создание игр на Unity3D» от itProger
Длительность: 9 уроков.
Формат обучения: видеоуроки и немного вступительной теории.
Программа обучения: пошаговые уроки по разработки 3D-игры на платформе Unity. Курс скорее вводный, поэтому специальная подготовка и знания не требуются. Спикер даст пошаговую инструкцию на примере игры Roll a Ball.
Чему научитесь:
12. «Уроки по Unity для начинающих с нуля» от Олега Шпагина
Длительность: 19 уроков.
Формат обучения: видеоуроки.
Программа обучения: курс даёт начальные знания в области разработки игр на платформе Unity.
Какие темы входят в программу курса:
Об авторе: Олег Шпагин, преподаватель школы программирования WISEPLAT.
13. «Уроки Unity C# для начинающих» от Олега Шпагина
Длительность: 13 уроков.
Формат обучения: видеоуроки.
Программа обучения: курс посвящён применению языка C# в рамках Unity. Программа рассчитана на новичков, но понимание базовых принципов программирования будет плюсом.
Что узнаете:
Об авторе: Олег Шпагин, преподаватель школы программирования WISEPLAT.
14. «Создание 3D-гонок на Unity 5 за 30 минут» от itProger
Длительность: 8 уроков.
Формат обучения: видеоуроки.
Программа обучения: экспресс-курс по созданию 3D-игр с использованием движка Unity 5. Мастер-класс будет полезен всем, кто интересуется разработкой игр, но не имеет специальных знаний и навыков. Подразумевается наличие установленного движка на компьютере.
Чему научитесь:
15. «Уроки разработки на Unity» от Noob GameDev
Длительность: 14 уроков.
Формат обучения: просмотр видео.
Программа обучения: содержит уроки с инструкцией по созданию игры в Unity. Спикер не рассказывает о настройках и интерфейсе платформы, а сразу начинает с практики. Перед началом обучения необходимо самостоятельно установить Unity на компьютер.
Что узнаете:
16. «Unity GameDev» от itProger
Длительность: 9 уроков.
Формат обучения: просмотр видео и чтение материала по теме.
Программа обучения: курс по разработке игр на Unity для новичков включает пошаговые уроки с инструкцией. Каждый слушатель сможет создать небольшую 2D-игру с дизайном и физикой. Подразумевается использование сторонних плагинов.
Чему научитесь:
17. «Физика в Unity» от Eccentric Games
Длительность: 12 занятий.
Формат обучения: просмотр видеоуроков.
Программа обучения: включает уроки по основам физики в Unity для начинающих и продвинутых пользователей.
Что узнаете:
18. «Программирование на C# под Unity» от YouTube-канала «Разработка игр на Unity3D»
Длительность: 16 уроков.
Формат обучения: просмотр видеозаписей.
Программа обучения: курс посвящён созданию игр на Unity с помощью языка C#. Программа рассчитана на новичков, но понимание базовых принципов программирования будет плюсом. Кроме теории есть уроки с инструкцией по созданию игры.
Что узнаете:
19. «Unity-скриптинг» от YouTube-канала «Игродел Мастер»
Длительность: 22 урока.
Формат обучения: просмотр видео.
Программа обучения: курс содержит подборку официальных уроков Unity по скриптингу. Слушатели узнают, как писать скрипты для создания и улучшения игры.
Что узнаете:
20. «Делаем игру на Unity за 6 уроков» от #tceh
Длительность: 6 уроков.
Формат обучения: видеоуроки.
Программа обучения: курс от компании Microsoft с пошаговыми уроками по созданию игры на Unity. Будет полезен тем, кто задумывается о карьере разработчика, но не уверен в своих силах и возможностях.
Что узнаете:
21. «Unity 3D Starter» от ITVDN
Длительность: 7 уроков.
Формат обучения: видеокурс.
Программа обучения: подборка уроков для тех, кто хочет попробовать создание игр на практике. Курс поможет познакомиться с платформой Unity, разобраться с базовыми функциями движка. Теория дополняется примерами создания игр. Уже после просмотра нескольких уроков каждый слушатель сможет создавать несложные проекты. Желательно знание основ языка C#.
Что узнаете:
Об авторе: Роман Самчук, специалист по созданию кроссплатформенных решений на Unity 3D.
22. «Unity 3D Essential» от ITVDN
Длительность: 7 уроков.
Формат обучения: просмотр видео.
Программа обучения: курс является продолжением знакомства с Unity3D, только в более подробном формате. Больше внимания уделено работе непосредственно с персонажем.
Какие темы рассматриваются на уроках:
Об авторе: Роман Самчук, специалист по созданию кроссплатформенных решений на Unity 3D.
23. «Unity3D Advanced» от ITVDN
Длительность: 7 уроков.
Формат обучения: просмотр видеозаписей.
Программа обучения: цель экспресс-курса — помочь пользователям создать полноценную сетевую игру. Учебный материал содержит много простых примеров, благодаря которым даже новичок поймёт суть разработки игр. Курс поможет за короткий срок разобраться в ключевых аспектах создания прототипов игр. Программа рассчитана на пользователей, знакомых с интерфейсом и функциями Unity.
Какие темы рассматриваются:
Об авторе: Роман Самчук, специалист по созданию кроссплатформенных решений на Unity3D.
24. «Unity для преподавателей: руководство для начинающих» от Unity Technologies
Длительность: 14 часов.
Формат обучения: видеоуроки, викторины и практические задания для отработки полученных знаний и навыков. Есть дополнительные материалы (учебник, статьи, руководство по интерфейсу).
Программа обучения: курс предназначен для преподавателей, которые желают преподавать Unity другим людям. Он состоит из отдельных блоков, каждый из них охватывает 5 тем. Представленный материал даёт основную теорию и практические идеи.
Чему научитесь:
25. «Сценарии для начинающих» от Unity Technologies
Длительность: 2 часа 45 минут.
Формат обучения: видеоуроки без заданий и обратной связи.
Программа обучения: мини-курс включает подборку уроков по основам программирования на C# для дальнейшей разработки игр на Unity.
Чему научитесь:
26. «How to make a Video Game» от Brackeys
Длительность: 11 уроков.
Формат обучения: видеоуроки.
Программа обучения: англоязычный мини-курс для новичков, которые хотят попробовать себя в создании видеоигр. Обучение сразу начинается с практики.
Какие знания и навыки получите:
27. «How to make a 2D-game — Unity 4.3 Course» от Brackeys
Длительность: 10 уроков.
Формат обучения: просмотр видеоуроков.
Программа обучения: курс поможет понять тонкости создания 2D-игр с помощью инструментов платформы Unity. Обучение проходит на примере аркады PONG. Спикер объясняет весь процесс от настройки сцены до кодирования элементов для управления игровым процессом.
Какие знания и навыки получите:
28. «How to make a Survival Game» от Brackeys
Длительность: 38 занятий.
Формат обучения: просмотр видеозаписей.
Программа обучения: базовый курс на английском языке по созданию игры в жанре выживание в Unity 4.
Какие темы охватывает курс:
29. «Unity2D Tutorials» от Brackeys
Длительность: 27 занятий.
Формат обучения: видеоуроки.
Программа обучения: англоязычный курс включает серию лекций по работе с платформой Unity. Он рассчитан на продвинутых пользователей — подразумевается знание интерфейса и основных функций движка.
Какие темы рассматриваются:
30. «Tutorials for Beginners» от Unity Technologies
Длительность: 23 урока.
Формат обучения: просмотр видео.
Программа обучения: материал взят с официального сайта Unity и предусмотрен для новичков.
Чему научитесь:
31. «Fungus — делаем визуальную новеллу на Unity» от OVDEN
Длительность: 7 уроков.
Формат обучения: просмотр видеоуроков.
Программа обучения: подборка коротких уроков по созданию визуальных новелл на Unity 5. Подразумевается, что слушатели имеют установленный на компьютере движок, и знакомы с его основными функциями.
Какие знания и навыки получите:
32. «Уроки Unity3D — разработка игр» от школы программирования для детей «Пиксель»
Длительность: 12 уроков.
Формат обучения: просмотр видеозаписей.
Программа обучения: представляет подборку материала из платного курса по созданию игр на Unity. Курс предусмотрен преимущественно для детей и подростков, которым интересен процесс разработки игр.
Но в целом, возрастных ограничений нет.
На уроках не рассматриваются функции и возможности платформы, спикер сразу начинает с практики. Курс скорее вводный, и его цель — познакомить слушателей с процессом создания игр.
Что узнаете:
33. «Unity User Manual» от Unity Technologies
Длительность: свободный доступ без ограничений по времени. Продолжительность обучения зависит от количества изученных модулей.
Формат обучения: теория в виде текста и немного видеоматериалов. Также есть ссылки на дополнительные материалы (видео и тексты).
Программа обучения: официальное руководство по работе с Unity для самостоятельного изучения.
Курс разделён на несколько модулей (навигация, работа со звуком, скриптинг, графика и др.). Можно изучать как все блоки, так и выбрать необходимые модули. Опытные пользователи могут использовать руководство в качестве справочного материала.
Чему научитесь:
34. «Туториалы по C# и шейдерам для Unity Engine» от CatLike Coding
Длительность: бессрочный доступ — продолжительность обучения зависит от количества выбранных пособий и скорости изучения материала.
Формат обучения: чтение учебников и самостоятельная отработка навыков на собственном компьютере.
Программа обучения: практические руководства по языку C# и программированию шейдеров для дальнейшего использования на Unity. Материалы содержат основные концепции программирования, алгоритмы и функции. Учебники будут полезны как новичкам, так и продвинутым пользователям.
Какие темы можно изучить:
35. «Create a Game» от Sebastian Lague
Длительность: 22 урока.
Формат обучения: просмотр видеоуроков.
Программа обучения: рассчитана на продвинутых пользователей, которые знакомы с Unity и имеют хотя бы небольшой опыт программирования на языке C#. Курс посвящён созданию стрелялки на Unity 5.
Какие знания и навыки получите:
36. «GameDev с Unity3D» от Loftblog
Длительность: 10 уроков, общая продолжительность 1 час 45 минут.
Формат обучения: просмотр видеоуроков.
Программа обучения: курс рассчитан на широкую аудиторию. Программа будет интересна всем, кто хочет разобраться с движком Unity3D и самостоятельно делать игры.
Что узнаете:
Основатель и главный редактор проекта. Специалист в области интернет-маркетинга (SEO-продвижения и копирайтинга, в частности). Работаю онлайн с 2018 года.
Make a 2D Video Game With Unity
Introduction: Make a 2D Video Game With Unity
In this Instructable, I will show you to make a really simple 2D Video game. It is an infinite runner style game, like «Fly with Me’ or «DoodleJump».
I have provided a zip of the exe of the game I will be showing you how to make. Download it and give it a try.
I have to say that Unity is an incredible tool. There is a wealth of information available in learning section of the Unity site, I highly recommend giving it a look through once you have seen how simple it is to start making 2D games.
Everything I am showing you here, I learned from the Unity site, they have some great tutorials and video training sessions.
I am new to Unity as you may or may not be, so this is just to share my love of the environment and my learning experience thus far.
I will provide the sprite assets for each step so that you can follow along, and make the game yourself. I recommend not using my code as is, but rather following along and writing your own version of the same scripts.
I have little to no experience programming in C, and yet was scripting in C# pretty quickly. it reminds me an awful lot of Arduino and Processing, which I am familiar with.
So even if you have no familiarity with programming, I believe you could do this too. At least follow along with my adventure to see how easy it was.
Attachments
Step 1: Download the Free Unity Software
Bascillay Unity is kind enough to let those of us who wish we could get into game dev, take a stab at learning it for free, so long as we don’t make any money with products we make using their software. Awesome. Thank you so much Unity, for the encouragement and freedom to try it out, and for the incredible software.
If you are planning on following along, you will need to go to the Unity Homepage and download the free version of the software.
You will also need to create a Unity Login, just follow the steps after installing.
Step 2: Open Up Unity
If it your first time opening Unity, you will be presented with a dialog box to create a new project. Browse to a suitable location, and give your project a name, something like «Iblejump».
It is very important to check the 2D selection at the bottom of the form where it says «Setup Defaults For».
You will not need to import any of the packages for the game we will be making. I would advise not bothering with them unless you need them for your game. No sense in including extra bulk to our build files.
When you have made the proper selections, go ahead and hit ‘create’.
Now the Unity Editor will open our new empty project and present us with a nice welcome popup. Let’s close that for now and explore the interface a little bit.
The work area is divided into four different sections, which you can organize to suit your workflow.
The hierarchy window on the left side shows you all the objects that are currently in your scene. The scene window is where we will build and place our game objects.
Down below we have another work area where you can dock an undock different tabs. Most of the tabs can be docked into an area that you find convenient. This is how I have my area set up, you might do things a bit differently. The main thing to be aware of is that you can access all of these windows from the window pull down menu, and add or subtract them as need be. you needn’t worry if your window doesn’t look identical. I will show you each of the areas we will use in more detail as we go.
For now just click on your «Main Camera» so you can see what happens over to the right in the Inspector and scene windows.
Notice how you now have a preview of your empty scene in the bottom corner of the scene window, and all of the components and property values for the camera are exposed.
Step 3: Create Your First Game Object
First you’ll need the Sprites folder that I have included as a zipped file. Extract the folder to somewhere you can find it.
In Unity, down in the project work area, under the project tab, with Assets selected, drag the unzipped folder into the gray area on the right. All of the sprites that you will need to duplicate my project are in this folder.
Navigate to the new Sprites folder and find a sprite named «navbar». Drag that up into the Scene window. Drop it somewhere near the bottom of your scene, as I have done in the image.
If you click Main Camera in your hierarchy window after placing it, you can already see how it will look in your game.
We will need to add some components, let’s start with a box colllider, to make our box solid.
With your new object selected, in the Inspector, click on «Add Component» and then add a Box Collider 2D, found under Physics2D
Go Ahead and add a second 2D Box Collider to your object, this one we will use to block the player from accidentally falling off the side of the navbar right at the begining of the game.
Set up your box colliders to match the sizes in the image, also set the x and y size of the transform parameter to 1.5. Watch the changes take place in the scene window.
Attachments
Step 4: Add a Player
Now that we have a platform for our player to stand on, we will need a player.
Click on GameObject in the top menu bar, select create empty.
Select your new empty game object in the Hierarchy window, and over in the Inspector, change it’s name to Player.
Next add a Sprite Renderer Component, found under Rendering.
In the project assets/sprites folder, find the Idle_Sprite, click the little triangle beside it and then drag one of the images into the Sprite value of the sprite renderer component.
We’ll need a few more components for our Player. First add a Rigidbody2D from the Physics2D choices.
If you press the play button now, our Player will fall through the navbar. Go on try it out.
We will fix that by adding a few colliders. Somewhat counter intuitively, we will add a circle collider to our feet and body, and a box collider to our head.
Now, if we press play, our little robot will roll over onto his back as any circle bottomed robot would. Fix that by checking the Fixed Angle check box, and then when you press play, your robot should fall to the navbar and rest there nicely.
Then I fiddled with the positioning of the navbar and robot until I was happy.
Now is a good time to save your scene, give it a name that feels good to you and save it.
Step 5: Add Some Life to Robot
Okay, now that we have the player object in place, we can start to add some animation and functionality to it.
With the Player Object selected, add a Animator Component. Add Component—>Miscellaneous—>Animator.
Uncheck «Apply Root Motion», and check the «Animate Physics» box.
Now open your Animator window. You can do this via the Window pull down if it is not already open in the project work area. I like to dock mine at the bottom.
With Player still selected in Hierarchy, Open the Animation window. It can also be found in the Window pull down. I like to dock mine in the same area as my scene and game windows.
In the Animation window, click the tiny little triangles beside «sample» to create a new clip.
Down below, open your asset/sprites folder and open up the idle sprite again. Shift select the entire series of images and drag them up to the animation window.
Because the animator (me) was cheap on frames, reset the sample size to 10.
Now look at your Animator, you should automatically have two states added, an any state, and a new default state, Idle. The orange colour tells us that it is the default animation state.
If you have followed these steps correctly, you should have an animated Robot now when you press play.
Create another animation and call it drive. Use the Drive sprite sheet. Again, lower the frame rate. I am putting it at 20 for now. You can tweek it later to your liking.
In the Animator window, you will see that a second state has automatically been created. Great! Let’s a add a float parameter named «Speed» to our Animator before we create the transitions.
Now right click on the Idle state, and select «make Transition». Then drag to the drive state. This should make a little arrow bar. select the triangle in the center of the transition bar. Change the transition condition in the inspector to be when Speed is greater than 0.01. Now create a transition from drive back to idle with the condition that Speed is less than 0.01.
Next we’ll need to build a controller script for Robot.
Step 6: The Robot Controller Script
Now that we have a Player with some animation states, we need a script to control the character. We’ll add a simple C# script to our project to control our Player.
In the Project window, create a new folder and call it Scripts. Open that folder and create a new C# script, call it RobotController.
Double Click the script to launch MonoDevelop. It can take a moment to open up, be patient.
Enter the following code to begin
Save the script and return to the Unity window. Drag the new RobotController script from the project work are onto the Player object in the Hierarchy window. Press the play button to run the game and you should be able to control the robot with the left and right arrow keys. If you open the Animator window below the game, you should see the animation changing states from drive to idle depending on whether or not Robot is moving.
Just a few steps to implement in order to get our Player jumping.
We will need an animation state for Jumping and falling, and also some more code to control things.
Let`s start by adding two more parameters to our Player Animator. Add a float called `vSpeed«and a Bool called `Ground`. We will use vSpeed to hold our vertical speed, and Ground will be in place to help us detect when our character is on the ground, allowing for a more realistic jump. (Jumping through air without touching the ground is more like flying).
Now let’s update our scrip to use our new parameters and put the code in place to make Robot jump when space bar is pressed.
Update your RobotController script to be as follows.
Return again to the Robot Controller Script in the Inspector, and make sure to set What Is Ground to everything except player. Select everything, then open the dialog again, and deselect Player.(Thanks c0)
In the next step we will create an Animator blend tree to handle jumping and falling.
Step 8: Make a Blend Tree Animation
Let’s make a blend tree to hold our different falling/jumping states. We could do separate animations for both, but this is more efficient and requires less bulk for our little game. Plus it is cool. (Did I mention that Unity hosts some great learning material?)
For each clip, drag one frame from jumpsheet, in order. i.e jumpsheet first image to jump1, and so on.
Open the Animator window again, right click, create. new from bland tree. Name it JumpFall.
Double click on the new JumpFall state, opening the blend tree in the inspector.
Click the little plus sign and Add Motion field, do this five times.
Now return to the Animator window, you will see the blend tree opened, click Base Layer in the upper left corner to go back to our base states.
You should delete all the auto generated jump states, Jump1 through Jump5 now as well. (Thanks c0)
Set the transition from Any State to JumpFall to be for when Ground is false, and the transition from JumpFall to idle to when ground is true.
All done, run the game again and you should be able to make Robot jump and animate with the space bar. The animation is a little jerky for lack of frames, you can play with the motion field to change it a little if you like.
Step 9: Destroyers
In the coming steps, we will be creating objects that spawn more objects and without some clean up going on, our game will quickly become bogged down. With that in mind, we will take care of clean up by placing some objects off screen to destroy objects as they leave the play area.
Our game will be a side scroller, so we will place one beneath the scene to catch falling objects (like the Player) and one offscreen to the left to clean up anything that has already scrolled by.
Give the quad object a cool name, like Destroyer Remove the Mesh Collider component and add a box collider 2D, but this time check the box marked «Is Trigger».
Also add a rigidbody 2D to it, but set the gravity scale in the Inspector window to zero.
In the Project work area, open your Scripts folder, and add a new C# script, name it Destroyer. Double click it and open Monodevelop.
Enter the following code into the new script and save it.
If you run your game now, and walk off the platform (remember, there is an invisible barrier on the left), it should pause the play and bring you back to the editor.
We will fix that in a later step.
The last thing to do with our Destroyer objects is to make them children off the camera object, as we will want them to follow along or they won`t be doing much at all. To do this, select them and drag them into the Main Camera object.
Step 10: The Hand
The hand that draws the line is pretty simple. Let`s make it.
First drag the hand sprite into your scene window, position it by using your camera object to see where in the scene it is sitting.
Transform the scale so x=2 and y=2.
Create a new empty game object, and name it Penciltip. Use the scene editor to position it at the very tip of the pencil.
Give it a little tag so that you can find it easily if need be. Do this by clicking on the little cube icon in the Inspector.
Now drag Penciltip into the hand object to pair them together. Finally drag the hand object into the Main Camera in the Hierarchy window.
It doesn`t do anything yet, but the pieces are in place. lets set up some other bits that we will need.
Step 11: Pencil Line
A prefab is like a recording of an object, you make the object into a prefab and can use it at will in your scene.
We will be using them for a lot of the rest of the game, as the level is programmatically generated.
Start by creating a new folder in the Assets folder, and call it Prefabs. Create a new Prefab by right clicking and selecting Prefab. Name the new Prefab pencilline.
Find the sprite called pencilline in the sprite folder, and drag it into the new gameObject in the hierarchy window.
Add a box collider 2D and resize it to fit the pencilline image.0.03 by 0.05 works.
Open your Prefab folder, then drag the GameObject onto the prefab. The icon will change to match the new prefab.
Delete the game object once you have placed it into your prefab. We won`t need the original anymore.
Now add a new C# script to your Scripts folder, call it pencilline. Open it up and enter the following script.
Drag the script onto the penciltip object in Hand. Then with penciltip still selected, open your prefab folder and drag your pencilline prefab over to the new obj parameter on your script controller.
Our Camera still has no control script, but if you run the game, you should see one pencilline object generated at the tip of the pencil. You can see it because the background is blue and the line was made for a white background.
Step 12: Roll Camera!
Let»s get the Camera rolling.
The Camera object is all made, so we really just need a controller script.
Just one little change before we write the script. The background colour. It needs to be white, the line will look crumby if not, not to mention the post it notes should you decide to use them.
Just select the main camera in the hierarchy window, and click the colour swatch in the Inspector, a colour selector will pop up. Choose white.
Okay, new script, i called mine pancam. Create one in your script folder and open it in Monodevelop, and enter the following.
Now you just need to apply the script to your Main Camera in hierarchy, and then drag the Player object onto the script parameter.
Try the game again, you have just made an infinite runner. Well, almost. We still need a few things, but it is getting close now.
My hand is just a little bit higher than I want it, but I will just nudge it down a little in the scene editor.
Step 13: Add a Score
Add a new GUIText object from the GameObject menu and name it Score.
Change the Text value to Score and the color to black in the Inspector.
Open the Game window, if it is not available, you can find it under the Window pull down at the top.
Adjust the Transform position, it works weird for GUI objects for some reason, think of it as percent of the viewable screen, where 0.5 is 50% and 0,0 is bottom left corner.
X=0.3 and y=0.97 puts it right up near the top in the left corner.
Now we need to add a bit more code to our Camera script. Update the script with theses changes.
Save the pancam script and return to unity.
Select the Main Camera again, and you will see that a new parameter is available in the Script component in the Inspector. Drag the Score GuiText object onto the Gui parameter.
Try playing again, you should now have a score going up.
Step 14: Bombs Away
There is no real danger yet for our hero. We’ll fix that. Lets make some cartoon bombs drop from the sky and break the line.
Create a new empty game object, and name it Bomb. In the sprite folder, find the bomb sprite, open it and add the first frame to Bomb. Adjust the transform scale to X=0.5, Y=0.5.
Add a circle collider 2D and change it’s scale and position to look good. We want the bombs to fall, so we will also need a rigidbody 2D, add that component as well.
We’ll also need an Animator to control our bomb states, so add that as well. Uncheck Apply Root Motion and check the Animate Physics box in the Inspector.
Open the animation window, make sure that you still have Bomb_0 of bomb still selected. Add an animation and call it bombidle, this will create a new default state in our Animator. Use the first 3 frames of the sprite sheet (drag and drop) and then reduce the frame rate by dropping Sample down to around 20.
Create another new clip, call this one bombexplode and use the remaining frames of the bomb sprite sheet. Again, reduce the framerate to about 20.
Down in the Animator window, creat a transition from bombidle to bombexplode, leave the condition for exit time and change the value to 5.00. This means our bomb will stay idle(fuse lit) for 5 seconds before switching states to explode.
Create a third animation in the Animation window, call it bombdead and leave it blank. In the Animator, create a transition from bombexplode to bombdead.
Create a new script called bomb in your script folder.
Finally, drag the bomb script into your bomb_0 object.
One small thing that I almost forgot, is to tag hand as hand. to do this, select your hand object in the hierarchy window, and then under tag, select add tag. Create a new tag at element0 named hand, then with your hand object selected, change the tag to hand. Also change the penciltip object tag to hand.
Try running the game, the bomb should drop, explode and take out the navbar. (depending of course where you have positioned it)
Step 15: Bomb Spawning
Kind of hard to play the game now, what we will do is make a spawn object to spawn the bombs, very much like the penciltip spawns the pencilline.
The first thing we need is a Prefab of our bomb. Navigate to the prefab folder and create a new prefab, name it bomb. Drag the Bomb object into the bomb prefab. Delete the original Bomb Object in the hierarchy once you have it as a Prefab.
Create a new quad object name it BombSpawn. Position it above the camera verify in Main Camera view or in the Game window.
Create a new script in your script folder called BombSpawner, and give it the following code.
First make the BombSpawn object a child of the Main Camera by dragging it into the camera via the hierarchy window.
Now drag the script onto the BombSpawn object in the Hierarchy window. Now with BombSpawn opened in the Inspector, drag the Bomb prefab to the little triangle labelled Obj in the script component.
We have to add an if statement back in our Bomb script (from last step) to delay the bombs falling until after the player has started to walk on the line. A quick check in my scene shows the hand sitting at 7.something so I will delay the drops until the bombs are past 12.
Here is the modified Bomb script.
Now Robot can jump on the line and walk a little bit before the bombs start falling. try it out. Still not very challenging. Let’s duplicate the BombSpawn object!! Then just move it over a little bit and we have two bomb spawners, let’s play.
Step 16: Platforms(or Doodles)
To generate the doodle platforms, we start by creating a few prefabs. Create a new folder in the Prefab folder and call it Doodles.
Create 10 new prefabs named doodle1 though to doodle10.
Create a new empty game object, no need to name it.
Open the sprites folder and find the doodles sheet, open it and select the first doodle. Drag it into the empty game object in the hierarchy window.
Add a box collider 2D to it in the inspector, then play with the scale and center to get it sitting nicely on the doodle. Remember, this is what Robot will be landing on.
Open your Prefabs/Doodles folder with the empty prefabs in it, and then drag the new GameObject into the doodle1 prefab.
Now, rather than repeating this entire process, just navigate back to the sprite folder, grab the next doodle, and drag it into the Sprite Renderer component of the Game Object, adjust the positioning of the collider and put it into the next doodle prefab.
Repeat this for the remaining doodle prefabs. Once they are all recorded as prefabs, you can delete the GameObject we made to create them.
Now Duplicate a BombSpawn object under our Main camera, and move it off screen to the right. Give it a new name in the Inspector, something like DoodleSpawn.
Then drag each of the new prefabs into the Obj parameter of our script component. Drag the first into element 0 to replace the bomb, and the others to the little triangle beside Obj to add them to the list.
Play with the min/max parameter in the script component to change how often they are generated. Duplicate the DoodleSpawn object and move it up if you want another set of levels.
One thing I noticed while playing is that Robots max speed was too low, I increased it over here. Go to your Player object and adjust the maxSpeed variable in the Script component if you find the same issue.
Step 17: Bonus Point Pickups
Making the Pickups is very similar to making the doodles. A few small differences. Start by creating a new folder in the Prefabs folder called Bonus, and populate it with 6 blank prefabs.
We will need a script to handle adding the bonus points to the GUIText object, so in the scripts folder, create a new script called BonusPoints. Here is the script to enter in Monodevelop.
Now return to the scene and create a new empty GameObject. Find powerups in the sprites folder, and drag the first sprite into the new GameObject.
Transform the scale to x=2,y=2 over in the inspector, then add a box collider 2D. This time we want to check the box marked Is Trigger.
Now drag the BonusPoints script into powerups_0. Open the prefabs/bonus folder and drag the GameObject into the prefab.
As in the previous step, just replace the Sprite Renderer Sprite for each prefab and save them.
Once the six Bonus Prefabs are made, we can delete the GameObject that we used to construct them.
To spawn our bonuses, we will just duplicate the DoodleSpawn object, rename it BonusSpawn, move it up a little bit and replace the object that it spawns.
Step 18: Game Over
The home stretch!! All we need now is for the player to die rather than a break in the code. That, and we’ll need a second scene, to display that the game has ended and offer the chance to play again.
Lets add this scene to the build before we start the new scene. In the File pulldown menu, select Build Settings.
In the dialog box that opens up, click the Add Current button, and verify that the scene has a scene # of zero. Close the dialog box.
Make sure you save your current scene and then select New Scene. Name the scene GameOver and put it in the Assets folder.
Add a GUIText object from the GameObject pulldown menu. In the inspector, change Anchor to upper center and alignment to center. Also change the font size to 20 and the color to black.
Back in the scene, drag the sticky note called notes_score to the scene and position it roughly center, use the Game window to see how it will look. Do the same with the Game Over sprite, just drop it where it looks good.
Create a gameOver script in the script folder, like this one.
Save it and drag it onto the Main Camera in our new scene.
Almost all finished, we need to add a function to our camera script to pass the score forward, and we need to alter our destroyer script where we have the code break to send us to the GameOver scene.
The new Camera script.
The fixed Destroyer script
Guess what? You just made a game! I did too!! woot for us!
Ok, so it is not the best game in the world, but that is hardly the point is it. At least it wasn’t for me. I was shocked at how simple it has all become, and I had to share. Go get making, I can’t wait to play some new cool games!
Step 19: Files, Etc
i included this last step to make the scripts we just wrote together a little easier to access.
So here are the scripts we just went through.
Thanks so much for stopping by, I hope you enjoyed it as much as I did.
Share and enjoy.