Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Creating E-Learning Games with Unity
Creating E-Learning Games with Unity

Creating E-Learning Games with Unity: Develop your own 3D e-learning game using gamification, systems design, and gameplay programming techniques.

eBook
$23.39 $25.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Creating E-Learning Games with Unity

Chapter 2. Interactive Objects and MissionMgr

A well-designed and engaging e-learning game will challenge the user, track his or her progress, and reward his or her performance appropriately. To do this, a series of classes will be required that will separate what we are tracking with the way in which we interact with it.

We will develop a system to implement a generic object that the user can interact with and collect. We will also develop another system that lets us build an abstract learning objective for the user to accomplish. We will then develop a system to collect objects into an inventory that can be used by the player. Lastly, we will develop software that tracks the user's progress towards these objectives and rewards him or her appropriately for success.

In this chapter, we will cover the following topics:

  • Understanding the base scripts

  • Building an interactive object

  • Putting it all together

  • Try it out!

  • Summary

Understanding the base scripts


The interactive Object class is the base script that enables a player in our game to have meaningful gameplay interactions. To meet the design needs of our game, this script provides an interface with which the game designer can specify how the player will interact with an object as it is picked up. In addition to this, it also permits subtle rotation on the object for a nice effect. The CustomGameObj and ObjectInteraction helper classes are used by the object class to define the specific nature of the interactions and how the object behaves in the inventory when collected.

The MissionMgr class is the system that tracks the user's progress through the game and rewards him or her on achieving success. When a user interacts with an interactive object, MissionToken attached to it (if any) is collected and tracked by MissionMgr. The MissionMgr class has a template of all missions, the tokens that each mission is composed of, and the reward that should be given when...

Building an interactive object


With these requirements in mind, let's build the framework for an interactive object that can be collected by the player.

Implementing the CustomGameObj script

We will begin with the CustomGameObj class. This class allows us to specify how an interactive object will behave when placed in the inventory, by giving it a unique type that is relevant for our game. Create the script by performing the following steps:

  1. Start from the codebase built in Chapter 1, Introduction to E-Learning and the Three Cs of 3D Games, to create a new subfolder in the assets folder named Chapter 2.

  2. Using the new script wizard, right-click on it and create a new C# script named CustomGameObject.

  3. We will also add a public enumerated type to this class called CustomObjectType. If you recall, an enumeration is just a list of identifiers of the integer type that share a common logical relationship with one another, such as the types of an object! Not only will this make discerning the type of...

Putting it all together


Now that we have developed the classes necessary for the InventoryMgr, MissionMgr, and InteractiveObj systems, let's build a scene that illustrates their functionality.

  1. To get started, let's continue from Chapter 1, Introduction to E-Learning and the Three Cs of 3D Games, where we left off. Load the scene and save a copy named chapter2.

  2. Add an instance of InventoryMgr to the Player GameObject by dragging-and-dropping it from the Project tab to the player object. Alternatively, click on Player and select Add component from the Inspector pane. Type in the name InventoryMgr and then click on it to add an instance.

  3. Click on Player and ensure that the Tag is set to Player. The InteractiveObj class will use this to make sure they can only be picked up by the player.

  4. Set Height and Width to 40 pixels to make the individual cells square shaped. Set the Yposition to 0.85 to indicate a y coordinate of 85 percent from the top of the screen.

  5. Create a new empty GameObject and name...

Try it out!


Congratulations! We now have two missions with which we can test interactive objects and player mission objectives. Note that when you play the game, you can collect the items in any order and that the inventory will update the quantity of objects from one to two as you collect them. The reward displays for two seconds and then the mission disables itself.

Summary


We have learned how to develop interactive objects, an inventory system, and a mission tracking system. We have shown examples of how components attached to GameObject can communicate with one another. We have extensively used the list container and the search pattern to implement tracking and inventory maintenance methods. Going forward, we will use these systems in conjunction with a little applied psychology and gamification theory to develop the first mission in our game.

Left arrow icon Right arrow icon

What you will learn

  • Create a user interface system for pop-ups and menus Develop a game framework that supports multiple scene files for multiple missions Design a system to handle objective and mission tracking in the game Implement an inventory system for the player to collect objects Create interactive objects to populate the game world Program Non-Player Characters to interact with the player Use a 3D camera, character and control systems for your game Design eLearning game missions to teach, test and reinforce learning
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 25, 2014
Length: 246 pages
Edition :
Language : English
ISBN-13 : 9781849693424
Vendor :
Unity Technologies
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Mar 25, 2014
Length: 246 pages
Edition :
Language : English
ISBN-13 : 9781849693424
Vendor :
Unity Technologies
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 104.98
Mastering Unity 2D game development
$60.99
Creating E-Learning Games with Unity
$43.99
Total $ 104.98 Stars icon

Table of Contents

10 Chapters
Introduction to E-Learning and the Three Cs of 3D Games Chevron down icon Chevron up icon
Interactive Objects and MissionMgr Chevron down icon Chevron up icon
Mission One – Find the Facts Chevron down icon Chevron up icon
Mission One – Future Proofing the Code Chevron down icon Chevron up icon
User Interfaces in Unity Chevron down icon Chevron up icon
NPCs and Associated Technology Chevron down icon Chevron up icon
Mission Two – Testing a Player's Learning Chevron down icon Chevron up icon
Adding Animations Chevron down icon Chevron up icon
Synthesis of Knowledge Chevron down icon Chevron up icon
An Extensible Game Framework Pattern in Unity Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(10 Ratings)
5 star 60%
4 star 20%
3 star 20%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




SizzlingPopcorn May 09, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Horachek's "Creating E-Learning Games with Unity" is a great book for all game developers using Unity. Although he doesn't go through the basic overview of Unity, which can be found in several other books such as Mike Geig's "Unity Game Development in 24 Hours", he does use language that novice and advance users can understand.3 Things I Like About This Book:1) Horachek not only explains the scripts and classes in a step-by-step fashion, but also explains the logic behind them.2) More than one level is created in this book project. Most of the other books on Unity only go through one basic level.3) The knowledge and scripts learned from this book can be applied to any project, whether it be for e-learning or not. In the book you'll go through how to build an inventory system and also a mission system.
Amazon Verified review Amazon
Jennifer Doring Apr 25, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
What David Horachek has done here is much more than a book it is a universal framework,the Swiss Army Knife of e-learning architecture, a masterpiece.Comes with the perfect unity package available on the publisher's website for free.This package is THE framework every one needs to implement any E-Learning application and more in a breeze.Perfect for beginners who are afraid of C# programming.You start at page 1 with a zero level of programming, you end up at the end of the book super easy with C# and ready to do whatever you feel like doing.A Masterpiece.
Amazon Verified review Amazon
eduardo guendelman May 16, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
An easy to read book that is aimed to people with no previous knowledge (beginners) as well as to developers with years experience.Ed.
Amazon Verified review Amazon
Marie Broyles May 14, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Creating E-Learning Games with Unity by David Horachek is a great book for beginning game programmers interested in developing interactive eLearning serious games. I reviewed this book from two different perspectives – from a game developer’s perspective and the other from an instructional designer’s perspective.Each chapter included screen grabs with specific instructions and coding that allows the user to create their own 3D eLearning game incorporating gamification, systems design and gameplay. You do not need to know C# but, it is helpful to have a logic structure base understanding. David walks you through building Geography Quest. The game’s primary goal is to teach learners about the US 50 states. As the learner collects state flags, they learn state name and state trivia. Creating E-Learning Games was easy reading and included specific game build instructions. The developed game does teach facts and presents a great structure to teach game mechanics. As an instructional designer, I envision how the game structure can be adapted to other instructional subjects as well as adding additional levels by creating new interactive objects and flushing out the condition-and-response classes.I also read the book from an instructional designer’s perspective since anything identified as eLearning will capture instructional designers’ attention. Some instructional designers’ will have little training in game development or C# but, they will review this book because it focuses on eLearning. I thought the first chapter would present a more in-depth eLearning discussion. He does not discuss that in many eLearning projects that an instructional designer is involved throughout game design and development.An instructional designer wanting to build this game should have some basic Unity functionality and some C# logic understanding. The first chapter (Chapter 1, Introduction to E-Learning and the Three Cs of 3D Games), you begin building Geography Quest. Each game development task includes examples and detailed step-by-step instructions. Each following chapter presents development tasks showing examples with detailed instructions culminating in Chapter 10, An Extensible Game Framework Pattern in Unity, where you integrate your game levels into the game framework and package your game to run on a PC. In addition, in Chapter 3, Mission One – Find the Facts, David does a great discussing game difficulty & player skill. It is critical that the learner/player be challenged enough that they want to continue playing but, not so difficult that they want to quit the game.Game developers and programmers will have no trouble following David’s detailed instructions. However, instructional designers new to Unity should become familiar with Unity before attempting to build Geography Quest. Instructional designers with some experience with Unity should have no problem working through David’s instructions.Final ThoughtsAs much as I liked the game structure, I found myself thinking how Geography Quest framework could be repurposed with different content and educational uses. But, the book did not really reinforce this concept throughout the book. The book divided its focus between teaching someone how to build one 3D game and creating C# scripting.Creating E-Learning Games with Unity didn't spend enough time re-enforcing (game modifications) this point throughout the book, part was about teaching someone new to Unity 3D how to use the tools and the other part on the subject at hand. It might have been better to focus on what makes great educational games and have the reader need a certainly level of knowledge about Unity 3D before reading. However, the title states games and other games are not covered.With all that said, I would highly recommend this book to game and instructional designers interested in developing eLearning games.Pros• Great job on explaining educational content in a game development book• Instructions easy to follow with game build continuing in each chapter• Contains a chapter focusing on the Unity3D GUI system (Chapter 5, User Interfaces in Unity)• Covers closing the loop and reinforces what you have learned• Presented a solid game architecture that can be applied to other educational gamesCons• Directed at two distinct audiences, (designers and game programmers *does not mention instructional designer) would have been better to target experienced Unity3D developers to give them new skills.• Does not really discuss what makes a great educational game.• Some game tasks require additional coding that the author does include but, does not always explain the why that is being done – doing this would help experienced Unity developers.[...]
Amazon Verified review Amazon
L. R. May 18, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is a hands-on guide mainly focused on the e-learning gamification domain. It covers all the stages of game development but considering it as part of a learning process. Through the chapters of this book is described all the building stages of a e-learning game from scratch.In the first chapter it introduces the e-learning basics and the three Cs of 3D Games: Camera, Character and Controls. Therefore this chapter explores the scene creation, character system and how to represent them, camera and controls creation.The second chapter focuses on the creation of the mission manager, it describes how it is implemented from scratch and how to use it within the game development.The third chapter defines the first level considering a mission where the user must collect a set of flags belonging to the North American states. The level aims to make the learning process easy and funny. Therefore the entire implementation is described.The fourth chapter explains how to improve the scene view of the game, introduces finite state machine and show how to implement a game manager considering the use of more than one level and other useful features.The fifth chapter introduces more about the user interface interaction, creating the menu game and popups. It shows how to implement the UI for the game at each step and explores the related Unity UI classes.The sixth chapter shows how to implement non-player characters, their behavior and interaction with the human gamer and also how to adapt it to the entire game.The seventh chapter focuses on the creation of the second level. It shows how to implement the structure, framework and inclusion to the mission manager. The second level is a race where the player competes with other two NPC and is evaluated about the first level learning about the flags and North America states.The eighth chapter shows how to include the animation at the game using Unity, moreover shows how to get free 3D resources and how to customize them to create and animate 3D characters to being employed within the book’s e-learning game.The ninth chapter focuses on the learning theory and on the creation of the final stage of the game, it describes how to create the score and evaluation system.The last chapter integrates all the previous work in order to get the final version of the e-learning game framework that could be adapted to learn different topics through the game.This book provides a very practical guide to create a framework that enables to learn, validate and improve the knowledge of the player by playing. The book gamificates the e-learning process making it easy and funny to the player. I really liked the clear way that the author employes to explain how a learning process could be applied in a game level and then validate the acquired knowledge using a second level following the psychology of flown to solidify the acquired knowledge.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
Modal Close icon
Modal Close icon