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

Inventory and gameplay visuals (2D only)

As well as being able to show icons that tell us whether we have certain keys or not, we can also use the Hub Door component to generate a similar feature in the game, but applied differently:

The Hub Door component is designed to change the visual state of a sprite depending on which and how many items we have in our inventory. Let's take the Zone2 example:

The first time we get to the zone, the door state is completely inactive, as we can see in the previous screenshot. After we pick up the key, the visual will change:

The steps are repeated for the second key:

And finally, we pick up the last key, which unlocks the door and triggers a dialog canvas:

As mentioned previously, the script in charge of doing this is the Hub Door component. In order to know how to use it, we first need to know its properties:

Required Inventory...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Game Development without Coding
Published in: Nov 2018Publisher: PacktISBN-13: 9781789538335

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