Reader small image

You're reading from  Hands-On Game Development without Coding

Product typeBook
Published inNov 2018
Reading LevelBeginner
PublisherPackt
ISBN-139781789538335
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Lucas Bertolini
Lucas Bertolini
author image
Lucas Bertolini

Lucas Bertolini has 10+ years' experience as a video game software developer. He has worked on three major projects: for Pollux Ltd. (Hong Kong) as a game developer and designer; for Schell Games (Pittsburgh, US) where he moved and worked as a developer until the project was completed; and for Globant as a developer. He has worked in technical education for 5+ years and has taught a variety of programming courses. He is the cofounder of NGA and Bytenarchy Studios, both digital services development companies that use Unity as their main technology. Lucas has written Hands-On Game Development without Coding, available from Packt.
Read more about Lucas Bertolini

Right arrow

Basic Concepts - Variables and Components

Unity 2D and 3D have many things to offer, but at the beginning this can be a little overwhelming. This is why I want to take we step by step through these in order to show we what they are used for and when is the right time to use one tool or another.

Once we finish with this chapter, it will be easy to use Game Kit items and objects, and use them accordingly, depending on what we need. In addition to this, we will have a better understanding of the components that Unity and Unity 2D and 3D Game Kits provide.

The following topics will be covered in this chapter:

  • Visual Scripting
  • Data types and data visualization
  • Objects and components

Visual Scripting

We are taking our first steps in this Visual Scripting video game development story, but we never stop for a moment to think why we call it Visual Scripting and how it works.

If we think about the term Visual Scripting, we can think of it as the action of writing a script with our vision, but of course that makes no sense.

Visual Scripting is usually considered the act of creating a program using a summation of different small programs interacting with each other. There are different tools for Visual Scripting, which focus on reducing the difficulty of creating a program.

With these tools, the crafting of a program happens through an interface, and as a result of this, the user doesn't need to code, but instead has to click, drag, and drop. This is the reason it is considered to be visual interaction with the tool, hence the term Visual Scripting.

These...

Data types and data visualization

In Unity3D, as well as many other game engines, data can be represented in many ways, but this kind of information is mostly used by programmers. This is the reason we will detail a list of data types and how they are represented in Unity. This will help you communicate in future conversations with fellow programmers.

We will go through the main data types, but there are many others used in Unity:

  • Choices: Choices are usually represented by enums in the editor. This gives you the option to choose between a predefined set of options:
  • Text: Text is represented with a string in the editor. By clicking on the label and writing something, we will have the opportunity to show that text to the user:
  • Numbers: Numbers are represented in many ways in the editor; the most common ones are ints and floats. We will be able to write integers with the...

2D and 3D Game Kit introduction

These kits, provided by Unity, are a collection of the following:

  • Assets
  • Components
  • Systems
  • Tools
  • Objects

These kits are meant to help create our 3D and 2D games without writing any code. In both kits, there are examples of finished game levels, to show us what our game could look like.

As we read at the end of Chapter 2, User Interface – Layouts and Shortcuts, we are going on an adventure. Step by step, we will build our own levels that, later, we can merge with the ones provided by the kit, or we can keep on creating levels until the game is long enough.

We will divide the chapter into 3D Game Kit and 2D Game Kit sections to explain both kits and their features, so this means we can choose to use one that fits our needs and skip the other section.

This is a good feature of Hands-On Visual Scripting with Unity, because we can use the same...

Summary

Whether we choose to follow the 2D or 3D path, in this chapter, we have learned the principles of Visual Scripting and who it is aimed at. Also, we have learned about some of the basic data types in order to better communicate with our fellow developers, and if we are working on your own, to ensure we will be able to visualize these data types in Unity.

We had to decide which way we wanted to move forward, 2D or 3D. No matter our decision, we have covered the main prefab objects provided by the 2D and 3D Game Kits, and inspected them in detail.

We learned about the components they have, and will have noticed that many of them share the same components. The more similar their behavior is, the more similar the components they have are.

Now, it is time to start creating our game; we finally know everything we need to know to understand the flow and processes that we will...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Hands-On Game Development without Coding
Published in: Nov 2018Publisher: PacktISBN-13: 9781789538335
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Lucas Bertolini

Lucas Bertolini has 10+ years' experience as a video game software developer. He has worked on three major projects: for Pollux Ltd. (Hong Kong) as a game developer and designer; for Schell Games (Pittsburgh, US) where he moved and worked as a developer until the project was completed; and for Globant as a developer. He has worked in technical education for 5+ years and has taught a variety of programming courses. He is the cofounder of NGA and Bytenarchy Studios, both digital services development companies that use Unity as their main technology. Lucas has written Hands-On Game Development without Coding, available from Packt.
Read more about Lucas Bertolini