scieee AI-readable full text Open interactive document viewer

Type 2

Bort Moreno, Emilio José

Abstract

The project consists of an application for mobile devices where children should take care of a virtual pet keeping it happy thanks to the happiness bar used for tracking it. These cares will be provided to the virtual pet by introducing in a simple and intuitive way the values to monitor the children illness through the day. Once the child enters the necessary values and if they are within the correct ranges of glucose, the child will be rewarded with collectibles in the form of new creatures. We find a food screen, where we have different dishes to know the amount of carbohydrates in each of them. A simple endless runner has been developed to increase the happiness of our pet by playing with it. This product has been designed to facilitate the daily life of both parents and children who suffer from this disease. With this work, I have acquired new competences in terms of the development of applications and videogames with Unity, database management and improvement in the field of programming, since my profile both professionally and in the career is focused on design. During the whole project I have been required to test the knowledge in each of the fields of work necessary for the application development and as a result, I have developed new skills related to diabetes and improved my knowledge of Unity and databases. Thanks to the previously stated, I have been able to create a project as completely as possible.

Full text

Type 2 Emilio José Bort Moreno Final Degree Work Bachelor’s Degree in Video Game Design and Development Tutor: Begoña Martínez Salvador Universitat Jaume I ACKNOWLEDGMENTS First of all, I would like to thank Mónica Cubo, head of Paediatrics at the General Hospital of Castellón de la Plana for her collaboration that helped me understand all the necessary concepts about diabetes and the needs of the hospital and patients. I would also like to thank Dra Mar del Mar Marcos Lopez, PhD from the Universitat Jaume I and professor of the subject of Programming I, together with Begoña Martínez Salvador, PhD in Engineering in Computer Science from the Universitat Jaume I, which has made it possible to accomplish the design and development of this application. Last but not least I would like to thank the work and dedication of all the teachers partaking in the Videogames Design and Development Degree. ABSTRACT The project consists of an application for mobile devices where children should take care of a virtual pet keeping it happy thanks to the happiness bar used for tracking it. These cares will be provided to the virtual pet by introducing in a simple and intuitive way the values to monitor the children illness through the day. Once the child enters the necessary values and if they are within the correct ranges of glucose, the child will be rewarded with collectibles in the form of new creatures. We find a food screen, where we have different dishes to know the amount of carbohydrates in each of them. A simple endless runner has been developed to increase the happiness of our pet by playing with it. This product has been designed to facilitate the daily life of both parents and children who suffer from this disease. With this work, I have acquired new competences in terms of the development of applications and videogames with Unity, database management and improvement in the field of programming, since my profile both professionally and in the career is focused on design. During the whole project I have been required to test the knowledge in each of the fields of work necessary for the application development and as a result, I have developed new skills related to diabetes and improved my knowledge of Unity and databases. Thanks to the previously stated, I have been able to create a project as completely as possible. INDICE 1. INTRODUCTION ............................................................................................................... 6 1.1. Search for a need ........................................................................................................... 6 1.2. Research on diabetes ..................................................................................................... 6 1.2.1. What is the diabetes? ............................................................................................. 6 1.2.2. What is the ratio? ................................................................................................... 8 1.2.3. What is the carbohydrate ration? ........................................................................... 8 1.2.4. Insulin .................................................................................................................... 8 1.2.5. Correction of Hyperglycemia according to sensitivity index ................................ 9 1.3. Research on gamification methods ................................................................................ 9 1.3.1. What is gamification? ............................................................................................ 9 1.3.1.1. Gamification process ....................................................................................... 10 1.3.1.2. Gamification strategies for data collection ...................................................... 10 1.3.2. Research or similar applications.......................................................................... 12 1.3.2.1. MySugr ............................................................................................................ 13 1.3.2.2. GlucoZor ......................................................................................................... 14 1.4. Motivation ................................................................................................................... 14 1.5. Objectives .................................................................................................................... 15 1.6. Environment and initial state ....................................................................................... 16 2.1. Methodology ............................................................................................................... 17 2.2. Planning ....................................................................................................................... 18 2.3. Resources evaluation ................................................................................................... 21 3. SYSTEM ANALYSIS AND DESIGN ............................................................................. 22 3.1. Requirements analysis ................................................................................................. 22 3.1.1. Functionals requirements .................................................................................... 22 3.1.2 Non-functionals requirements ............................................................................. 24 3.2. Game mechanics ............................................................................................................. 24 3.2.1. Playability............................................................................................................ 24 3.2.2. Game’s flow ........................................................................................................ 24 3.2.3. Endless Run Game .............................................................................................. 26 3.2.4. Activity diagram and case use diagram ............................................................... 27 3.2.5. Interaction and controls ....................................................................................... 29 3.3. System architecture ..................................................................................................... 29 3.4. Interface design ........................................................................................................... 31 5 3.4.1. Characters ............................................................................................................ 31 3.4.1.1. Glu ................................................................................................................... 31 3.4.1.2. Collectables ..................................................................................................... 32 3.4.1.3. Main screen ..................................................................................................... 33 3.4.1.4. Screen introduction of values .......................................................................... 34 3.4.1.5. Open collectibles screen .................................................................................. 34 3.4.1.6. Collectables list screen .................................................................................... 35 3.4.1.7. Food screen ..................................................................................................... 35 3.4.1.8. Happiness Bar ................................................................................................. 36 3.4.1.9. Endless Run Game .......................................................................................... 36 4. WORK DEVELOPMENT AND RESULTS ................................................................... 37 4.1. Saved the state of the game ..................................................................................... 37 4.2. Use databases in Unity ............................................................................................ 37 4.3. Scene handling ........................................................................................................ 38 4.6. Food screen ............................................................................................................. 39 4.7. States of the day ...................................................................................................... 39 4.8. Develop Endless Runner ......................................................................................... 40 5. RESULTS AND FUTURE WORK ................................................................................. 42 5.1. Results ......................................................................................................................... 42 5.2. Testing ......................................................................................................................... 42 5.3. Evaluation ................................................................................................................... 44 5.4. Future work ................................................................................................................. 44 6. CONCLUSIONS ........................................................................................................... 46 7. BIBLIOGRAPHY ......................................................................................................... 47 8. APPENDIX A – SOURCE CODE ............................................................................... 49 9. APPENDIX B – VIDEOGAME ART .......................................................................... 90 6 1. INTRODUCTION In the following chapters we will proceed to describe and discuss the objectives that are intended to achieve with this work, we will also explain the process of how it has been carried out, the tools that have been used, the manner in which he idea was conceived and the key factors that have motivated us to carry out this specific project. 1.1. Search for a need Before starting the project, on Wednesday, October 11, 2018, we met with Dra Mónica Cubo, (Head of Paediatrics at the General Hospital of Castellón), at the Burriana health centre, that a series of guidelines, tips and clues, about what the health centre needed, and what we can provide to children, so that the application is useful. In the beginning, the application was going to be a combination of the MySugr and Glucozor applications, but after the meeting we changed the concept of the application and went to what is really useful for the health centre, which is our target, apart from the help for children. Also, we receive different books to extract part of the information necessary for the study of diabetes. With the ideas already clear about the project and the changes made in the strategies for data collection, on April 12, 2019 we made a second interview, to teach the first images and the final idea and ask a series of questions about the diabetes. 1.2. Research on diabetes In the first place, we had to carry out a study about [1] what diabetes is, for this we had to start asking what is this disease, which is the sensitivity factor, which is the ratio, carbohydrates, types of insulin and the corrections we can make in the data. 1.2.1. What is the diabetes? Diabetes is a chronic disease that arises because the pancreas does not synthesize the amount of insulin the human body needs, makes it of inferior quality or is not able to use it effective. 7 For the realization of the application we had to collect information about the different data we are going to use, among which we find the sensitivity factor, the ratio, the carbohydrate rations and the insulin. How is the sensitivity factor calculated? The insulin sensitivity factor (FSI), also known as the correction factor, is what decreases glucose, in each person (in milligrams / dl), each unit of rapid insulin that is put; that is, the amount of glucose that metabolizes 1 IU of insulin. When we have high glucose levels, it is essential to know the amount of insulin each patient needs to cover this excess blood glucose, for this we need to know what the sensitivity factor is. Although a formula can be used to calculate the sensitivity factor (see Figure 1), in our application we will only ask for that value when starting the application since it is a value that they provide us in the medical centre. We will have enabled in options the possibility of changing this data, since although for some patients it is a fixed value, for others it can vary. If we wanted to calculate this factor, it is essential to count the daily units of fixed insulin that we put in each day. For example: 6 units of fast at lunch + 18 units of slow + 7 units of fast food + 5 units of fast snack, would give us a total of 36 total daily units of insulin. After this step we would have to make the formula 1800 / or 1700 / daily dose (36 units) = sensitivity factor (1800/36) = 50. This means that for each unit of insulin that is injected, 50 milligrams / dl decreases glucose in our blood. Calculating IS 1800 IS = Usual daily insulin dose (Figure 1) Calculating the sensitivity 8 1.2.2. What is the ratio? The ratio or number of units of fast insulin needed for each 1 serving of HC (or 10 grams of HC), is a value that, although it can vary, is usually kept fixed for each patient, as is the sensitivity factor. in our application it is a value that we can modify. 1.2.3. What is the carbohydrate ration? Counting carbohydrates (HC) is essential to keep diabetes under control. To measure carbohydrates the concept of ration is used. A ration is the amount of food that contains certain grams of carbohydrates. There are several systems to count carbohydrates: 1 serving = 10gr HC On the food screen of our application we find the already measured carbohydrates that each food has 1.2.4. Insulin At present, the types of insulin available for the treatment of diabetes are several, each of them equally valid and adapted according to the patient and their needs. - Ultrafast action insulin - Rapid-acting insulin - Intermediate action insulin - Insulins with slow or basal action - Mixed Insulins In this way insulins are classified according to the action of each of them, differentiating three times since injected: The onset: is the process from the time insulin is injected until it reaches the bloodstream and begins to lower glucose levels. The insulin is not immediate, therefore, unless we are low in glucose, we must inject fast insulin before eating, after having calculated the amount that will be necessary. The peak of action: it is the moment of maximum action, that is, when insulin makes a greater effect and quickly reduces blood sugar levels. When the patient is in periods of 9 glycaemic decompensation, he has to wait for this period to pass so that the insulins do not overlap and we go from 200 to 40 glucose. The total duration: corresponds to the time that insulin is taking effect in our body. Since we puncture until it stops eliminating glucose 1.2.5. Correction of Hyperglycaemia according to sensitivity index We found another formula (see figure 2) to perform the correction, but since the ratio and sensitivity factor values are provided by the medical centre, we will not use it. Correction of hyperglycaemia real GC – desired GC UI = IS (Figure 2) Calculating the correction of hyperglycaemia 1.3. Research on gamification methods 1.3.1. What is gamification? When we speak of the term gamification, we refer to a series of dynamic learning techniques for the improvement of results, absorption of new knowledge or, in the case of our application, to be rewarded for carrying out a series of concrete actions. The main idea of gamification is not to create a game, it is to use the reward-rewardobjective systems that video games possess. The main objective that we find in our application is to motivate the child to keep his glucose levels within limits. We will do this through a reward system, in which the child will receive a new creature each time he meets these goals. To meet these objectives the child will have to enter in the application: (1) the values of the glucose levels prior to meals, (2) the rations consumed, (3) the units of insulin administered taking into account those rations and (4) the values of glucose levels two 16 Virtual Pet: The objective of these games is to care for a creature or animal, "since birth" and help it grow. In our case, we will have to introduce the values throughout the month and play with the game we have developed to keep our pet happy. CCG: The CCGs are characterized by the individuality of each letter. Each card has a function and effects in the game, as well as some features. To motivate the user in the introduction of values in our case instead of letters you will be rewarded with unique creatures as collectibles. Endless Runner: The goal of an endless runner is to get the maximum score by going through an infinite scenario, dodging objects, we have developed a simple endless runner to increase the happiness of our pet playing with it. To help the hospital we can generate at the end of the month a CSV file with all the values entered by the child during the month. We achieve all these objectives with: - A file: That stores the different states of the game, among them we find, the happiness indexes of our pet, the score of the game endless runner, the booleans to enable or disable the rewards received by the introduction of values. - In a database: All values for the control of diabetes, in order to be able to export them to PDF or CSV to be delivered to the medical centre. - In a file: The different states of the game. - In a database: All values for the control of diabetes, in order to be able to export them to PDF or CSV to be delivered to the medical centre. 1.6. Environment and initial state As mentioned in the previous section, due to the existing need for data preservation in most hospitals and for the families affected, the creation of a much more dynamic and interactive application arises, offering a much more efficient way to store data and to monitor this disease, that also includes a reward system that helps in motivating children into keep track of their our blood glucose values, insulin doses, etc... For the adequate development of this project, all of the required steps established by both the tutor and the head of pediatrics at the Hospital General (Mónica Cubo), at all times 17 have been thoroughly contrasted after having conducted numerous interviews in order to obtain a better understanding of the disease that have enabled the development of the application, and to disperse other substantial queries. PLANNING A RESOURCES EVALUATION In this chapter, we will focus on the more technical aspects of the application, as well as detailing the steps taken and the material required to fulfill all of the aspects of the project, an analysis of the economical viability of the project and the equipment needed for the implementation of this application. 1.7. Methodology For the methodology, we have used the spiral model [8], each phase of Spiral Model is divided into four quadrants as shown in the above (figure 11) The functions of these four quadrants - Objectives determination and identify alternative solutions: Requirements are gathered from the customers and the objectives are identified, elaborated and analysed at the start of every phase. Then alternative solutions possible for the phase are proposed in this quadrant. - Identify and resolve Risk: During the second quadrant all the possible solutions are evaluated to select the best possible solution. Then the risk associated with that solution is identified and the risks are resolved using the best possible strategy. At the end of this quadrant, Prototype is built for the best possible solution. - Develop next version of the Product: During the third quadrant, the identified features are developed and verified through testing. At the end of the third quadrant, the next version of the software is available - Review and plan for the next Phase: In the fourth quadrant, the Costumers evaluate the so far developed version of the software. In the end, planning for the next version of the software is available. 18 (Figure 11) Spiral model quadrants 1.8. Planning Next, we will detail the planning involved in the realization of this project, and to this effect, we will use (Figure 12) Next, each step is described: Activity Description Meeting with teacher First meeting with tutor to talk about the different ideas for the application P.1 Research diabetes children Search of information about diabetes in children and adults, control of the disease P.2 Research similar applications Download and try similar applications and see what can be improved P.3 Research strategies gamification data Gamification information search to make our application fun P.4 Game Document Design Realization and modification of the design document Meeting with Doctor Interview with Mónica Cube for the search of the need of the hospital P.5 UI Design Design UI with Adobe Illustrator P.6 Unity Database Investigation and Test As we needed to save a lot of data, we used SQLite in Unity 19 P.7 CSV in Unity Investigation and Test Search how to extract data from the database and export it to an easy-tomanage format P.8 Characters and Animation Design in Adobe illustrator P.9 Programming and development Program in Unity the application in this process is divided into different sections P.9.1 Creation all Scenes Create the scene manager P.9.2 Creation system to save data Create a save system P.9.3 Creation Animations Create animations using Unity P.9.4 Add Sounds Search for royalty-free sounds and enter into unity P.9.5 CSV implantation Search of tutorials and implementation for the creation of CSV files P.9.6 Database implantation Implement SQL and databases in unity P.9.7 Collection List Create the functionality to be able to store the creatures as if it were a Pokédex P.9.8 Develop Endless Runner For the lack of more playful part in the app a simple minigame is developed P.10 Hospital Test Test in the hospital to see the deficiencies of the application 20 (Figure 12) Gantt chart 21 1.9. Resources evaluation In this section we will explain why we consider that our application is viable. The equipment needed to make it is mainly a PC / Mac, an image editing software such as Adobe Illustrator. Adobe Illustrator [9] is a vector graphics editor developed and marketed by Adobe, Originally designed for the Apple Macintosh, development of Adobe Illustrator began in 1985. Along with Creative Cloud (Adobe's shift to monthly or annual subscription service delivered over the Internet), Illustrator CC was released. The latest version, Illustrator CC 2019, was released in October 2018 and is the 23rd generation in the product line. Adobe Illustrator was reviewed as the best vector graphics editing program in 2018, and the software for the creation of the application Unity, Unity [10] is a cross-platform game engine developed by Unity Technologies, first announced and released in June 2005 at Apple Inc.'s Worldwide Developers Conference as a Mac OS X-exclusive game engine. As of 2018, the engine had been extended to support more than 25 platforms. The engine can be used to create threedimensional, two-dimensional, virtual reality, and augmented reality games, as well as simulations and other experiences. The engine has been adopted by industries outside video gaming, such as film, automotive, architecture, engineering and construction, plus all the hours to invest, both research and development, therefore, the costs at the development level would be around 6,000 € or 8,000 € in the applications market. It is an approximate calculation, counting the number of hours used for the project a total of 150 hours, the monthly price of adobe illustrator (creative cloud) that has a price of 24,15 euros, and the license of Unity plus that has a monthly price of 25 euros. Needless to say that for merchandising purposes, an agreement must be established with the hospitals so that the application can be assigned to those patients that will benefit from it without having to upload it in any particular application market and this way preventing the use of any monetization system and the consequential issues concerning the requirements for these type of web stores. 22 2. SYSTEM ANALYSIS AND DESIGN Hereunder we will discuss the design, workflow and the interface of our application, as well as the mechanics of the game. 2.1. Requirements analysis In this section we talk about functional and non-functional aspects of our application. 2.1.1. Functionals requirements Requirement: The player will have to enter the Ratio and Sensitivity Factor values the first time the application is started. Input: Ratio values and sensitivity factor. Output: Insulin value that the patient must inject. Requirement: The player will have to enter the values Previous Glucose and Carbon Hydrates in the scene of introduction of values. Input: Previous glucose and carbohydrate values. Output: Insulin value that the patient must inject. Requirement: If the previous glucose entered by the player is below 80 or above 250, 2 different alerts appear. Input: Previous glucose value. Output: Previous Glucose <80 - Alert (take a juice) Previous Glucose> 250 - Alert (use of acetate strip) 23 Requirement: The player will have to enter the values for a week and if he has kept the glucose between 80 and 250. Input: Previous glucose and carbohydrate value. Output: The user gets a reward in the form of collectable and a happy pet Requirement: The player will have to fill the values of previous glucose and carbohydrates for a month. Input: Previous glucose and carbohydrate value. Output: Button to download the values from the table and take them to the medical centre. Requirement: The player needs to keep the pet happy Input: Play the endless runner Output: Increases the happiness bar Requirement: Playing endless runner keep Glu alive by dodging enemies Input: Arrows up and down Output: Character movement points increase Requirement: If Glu hits an enemy Input: Detect collision Output: If lives end, get out of the game Requirement: The player needs to see the carbohydrates of each food Input: Consult screen food Output: Screen with this data 24 3.1.2 Non-functionals requirements We must point out that currently the application is only available for Android and therefore, for iOS we should wait. In addition, due to the lack of time dedicated to the implementation, the application does not adapt to resolutions for tablets, although its installation is possible in these devices. Our application focus only on children between 6 and 12 years old with type 2 diabetes. 2.2. Game mechanics In this section all of the mechanics and actions that the player can carry out with the application have been detailed, explaining the movements of our main character, the actions that can be carried out as well as the collectible elements that can be found in the application 2.2.1. Playability The mechanics are quite simple, on the one hand, we have the data entry: when starting the application for the first time, we will be asked for the sensitivity factor and the ratio for each of the meals of the day. This will help us calculate the insulin that the player will have to inject to maintain glucose levels between 80 and 120 and keep Glu happy. Once introduced the initial values, (values that will provide the player in the medical centre), a small tutorial with our pet will appear, which will guide us through the interface, and will indicate where we have to enter the different values, and the different ones sections of our application. As the weeks go by, we will unlock rewards in the form of new creatures, collectibles. To unlock them, you only have to press the egg-shaped button that will appear at the bottom of the main screen. By clicking on the egg, the app will take us to the screen of opening eggs, where we will unlock the new creatures. To keep Glu happy, we can also play with it, by clicking on the play button 2.2.2. Game’s flow In this section of the document, the steps to be followed in the application are detailed from the start until the end of its use. When the child starts the application for the first 25 time, the start screen will appear where we will have the start button and the options button of the application. Once the child clicks on the start button, we will have a small presentation, where we will see for the first time Glu, our main character and at the same time guide in the application, who will ask us to introduce the ratio values and the sensitivity factor that the medical centre will have provided us in order to obtain the insulin values. After these steps, the child will be on the main screen, where we find the recipe button, the button where to see the unlocked rewards, the button to play at endless runner game and in the central area the button to enter values, this being a key button. In the lower part of this screen we find a small stage where we will have Glu, the happiness bar and later the rest of the creatures that we unlock will appear Once we click on the enter values button, the app will take us to the data entry screen. Thanks to the introduction of these values, the application will calculate the insulin dose that the child should inject. When the child enters the glucose values, if they are below 80 or above 250, an alert will appear (see Figure 12 and 13) where Glu will notify us that we have to take a juice, if the value is below 80, and if it is above 250, you will have to use an acetate strip. (Figure 12) Warning Scene (Figure 13) Warning Scene Once we finish the day, and if the child has kept the glucose values between 80 and 120, this having our pet happy, the player can see the happiness bar filled, an egg will appear at the bottom of the main screen 32 The circle symbolizes life and health, its meaning is very positive, in many cultures. The colour blue represents the sky that unites all nations and is the colour of the United Nations flag. The blue circle embodies the unity of the international diabetes community. (Figure 19) Glu and the global symbol of diabetes. 2.4.1.2.Collectables The collectibles are another important part of the game as they represent the way children are rewarded and motivate them to continue entering the required data, week after week, in the application. Once the child fulfills a series of requirements, these characters will appear in the shape of eggs on the lower part of the main screen. To open an egg and unlock the creature, the user must click on the egg and after doing so will then be taken to an "open egg" screen, where after clicking, a new creature will appear. (Figure 20) First collectible 33 2.4.1.3. Main screen The interface had different changes at the same time as progress was made in the game, at first, we found a coarser design (Figure 21) and finally it was modified, just like the main character stylized (Figure 22). (Figure 21) Old Interface (Figure 22) New Interface As we can see the introduction of Values, in the first version was made directly on the main game screen. Once the values are entered, we find the main screen - In the upper part we will have four buttons, one that will take us to the screen of introduction of values of glucose levels prior to meals and rations consumed, with which we will obtain the insulin value that the child should inject. The button of the rewards, will take us to the screen with the list of collectibles, where we will have a list with all the creatures that we have unlocked, the play button for play at endless run game to keep Glu, and finally the carbohydrate button, that will take us to the food screen where they will be available. list of foods with the carbohydrates of each of them. If we fulfil a series of requirements in this screen will appear the button in the form of an egg, which will take us to the screen of opening collectibles. 34 - In the lower part we will find our main character with new creatures as we go forward 2.4.1.4. Screen introduction of values This is one of the most important screens in the game, it is divided into 3 parts: at the top we will have the current date, in the next division we will find the time of day in which we are, in the next we will have a field to enter the numerical values of previous glucose and carbohydrates. Thanks to the introduction of these values, the application will calculate the insulin dose that the child should inject. Finally, at the bottom we will find Glu, carrying out the actions of breakfast, lunch, lunch, afternoon snack or dinner. (Figures 23 to 27). [Figure 23] Breakfast (Figure 24) Lunch (Figure 25) Lunch (Figure 26) Afternoon snack (Figure 27) Dinner 2.4.1.5. Open collectibles screen We find an egg (Figure 28) centred on the screen, on which we will have to press in order to unlock new creatures as collectables and in this way motivate the child every day to introduce values and maintain their glucose levels within limits (Figure 28) Button that takes us to the screen of opening collectibles 35 2.4.1.6. Collectables list screen This screen shows the collectibles that we have already unlocked and those that we still need to unlock (Figure 29) (Figure 29) Display with collectible list 2.4.1.7. Food screen In this screen (Figure 30) we will find a list of foods, with the name of the food, the size of the ration, a drawing of the size of the approximate ration and the values of weight, carbohydrates, and the number of rations. (Figure 30) Food screen 36 2.4.1.8. Happiness Bar We can see on the main screen a happiness bar (Figure 31), this will change if our glucose values are very low or very high, we can also improve the happiness bar by playing with Glu to the included game. (Figure 31) Happiness bar 2.4.1.9. Endless Run Game We can see (Figure 32) below the screen of the game, in which we find our player, the enemies and a score, when we play the game, we will also happy our pet to play with her. (Figure 32) Endless Game 37 3. WORK DEVELOPMENT AND RESULTS In the following breakdown of sections, we will proceed to describe each of the steps that have been carried out during the development of this application. 3.1. Saved the state of the game This was a complex task, since Unity has PlayerPrefabs, which allow to save and load int, float and string no matter what platform we are working on but its great limitation is that are designed to store one variable at a time and save and load several variables can become annoying thing to do. For this reason, we finally use the Notification Center script, in order to perform the saving tasks, in this state of the game we store the values of Ratio and Sensitivity Factor, which can be modified in options of the application, the name of the patient, the amount of days that have passed to enable or disable the rewards screen and the saving of activation or deactivation of the different collectibles. 3.2. Use databases in Unity For the creation of databases in Unity we use the DB Browser for Windows program on the one hand. With it we can create the tables and fields necessary for our application. In Unity we will have to install SQLite through the libraries for Android and creating the directory "StreamingAssets" for its correct functioning. The main table (Figure 33) of our database will store the necessary values to generate the table that we will provide to the hospital. The necessary fields of this database are: - Id: as a primary key, to store the data in an orderly manner, - Day: We store the current date - Type: Where the value of the moment of the day is stored - Previous Glucose: We store the value of the glucose that we have at that moment. - Ration: The rations we have consumed - Insulin: Calculation of insulin value thanks to all stored values - Remarks: This field was created, but in the end it has not been used and is reserved for future work in the application 38 (Figure 33) Patient data table created in DB Browser In the beginning we were going to store the data of Name, Ratio and Sensitivity Factor in another table, but finally, as those values are always the same, in order not to increase the size of the database and create repeated data we ignore the use of it. There is not much information on how to use databases in Unity, and it was quite complicated to make SQL work correctly, apart from that, different SQL command tests were performed that can be found at the end of the memory. 3.3. Scene handling A simple function (Figure 34), we quickly and efficiently switch between scenes 1. using System.Collections; 2. using System.Collections.Generic; 3. using UnityEngine; 4. using UnityEngine.UI; 5. using UnityEngine.SceneManagement; 6. 7. public class SceneManagerScript : MonoBehaviour { 8. 9. public Image fade; 10. 11. 12. public void CambioEscena(string es) 13. { 14. fade.CrossFadeAlpha(1, 1, true); 15. StartCoroutine(ActivoFade(es)); 16. } 39 17. 18. IEnumerator ActivoFade(string e) 19. { 20. yield return new WaitForSeconds(1); 21. SceneManager.LoadScene(e); 22. } 23. 24. } (Figure 34) Function scene handling 3.4. Sound The sounds were searched in different sound banks with Creative Commons license in this case the application has to be commercialized, we do not have legal problems with the different authors and their works 3.5. Export of variables We have tried to carry out this task using the iTextSharp [] plugin and it was not possible, after investigating a bit more I have found the plugin for Visual Studio SharpPDF, but there are problems with exporting on Android devices. So, I opted for the exporting files in CSV, which is a very versatile format and can be easily edited by any spreadsheet program. 3.6. Food screen For the food screen, we had to use a PDF provided by the General Hospital, currently we only have 3 foods introduced in the app, but they will be expanded in future work. 3.7. States of the day For the days states we use the function (check Time) with DateTime.Now.Hour [Figure 34] and DateTime.Today to take the complete date, but then we have to format it to introduce it in Unity's .text (Figure 35) to thus change between all the states of the day. 1. public Int32 hora = 0; 2. 3. public void comprobarHora() 4. { 5. hora = DateTime.Now.Hour; 40 6. } [Figure 34] Function get current system time 1. public DateTime today = DateTime.Today; 2. fecha.text = today.ToString("dd/MM/yyyy"); (Figure 35) Function get actual day This section has a lot of work, both design, animation and sound, as there are different backgrounds, animations and sounds for each of the moments, we have to check with the warnings, when we have insulin below 80 or above 250 grams. 3.8. Develop Endless Runner We have developed a small game of the genre Endless Runner, where Glu, must go dodging the enemies that come out in a random way in an infinite scenario, thanks to this game we will raise the happiness bar of Glu. Among the most important functions we find the movement of the player (Figure 36) along with the control of the lives when it collides, the spawner (Figure 37) and the detection of the enemies (Figure 38). 1. private void Update() 2. { 3. 4. if (health <= 0) { 5. spawner.SetActive(false); 6. restartDisplay.SetActive(true); 7. Destroy(gameObject); 8. } 9. 10. healthDisplay.text = health.ToString(); 11. 12. transform.position = Vector2.MoveTowards(transform. position, targetPos, speed * Time.deltaTime); 13. 14. if (Input.GetKeyDown(KeyCode.UpArrow) && transform. position.y < maxY) { 15. camAnim.SetTrigger("shake"); 16. Instantiate(moveEffect, transform.position, Quaternion.identity); 17. targetPos = new Vector2(transform.position.x, transform.position.y + increment); 18. } else if (Input.GetKeyDown(KeyCode.DownArrow) && t ransform.position.y > minY) { 19. camAnim.SetTrigger("shake"); 41 20. Instantiate(moveEffect, transform.position, Quaternion.identity); 21. targetPos = new Vector2(transform.position.x, transform.position.y - increment); 22. } 23. } 24. } (Figure 36) Player 1. private void Start() 2. { 3. timeBtwSpawns = startTimeBtwSpawns; 4. } 5. 6. private void Update() 7. { 8. if (timeBtwSpawns <= 0) 9. { 10. int rand = Random.Range(0, obstacleTemplate.Length); 11. Instantiate(obstacleTemplate[rand], transform.position, Quaternion.identity); 12. timeBtwSpawns = startTimeBtwSpawns; 13. if (startTimeBtwSpawns > minTime) { 14. startTimeBtwSpawns -= timeDecrease; 15. } 16. } 17. else { 18. timeBtwSpawns -= Time.deltaTime; 19. } 20. } (Figure 37) Spawner 1. void Update () { 2. transform.Translate(Vector2.left * speed * Time.deltaTim e); 3. } 4. 5. private void OnTriggerEnter2D(Collider2D other) 6. { 7. if (other.CompareTag("Player")) { 8. other.GetComponent<Player>().health--; 9. other.GetComponent<Player>().camAnim.SetTrigger("sha ke"); 10. Instantiate(effect, transform.position, Quaternion.identity); 11. Destroy(gameObject); 12. } 13. } (Figure 38) Enemy 48 [8] Spiral Model information [on line] Available in: https://en.wikipedia.org/wiki/Spiral_model [9] Adobe Illustrator [on line] Available in: https://en.wikipedia.org/wiki/Adobe_Illustrator [Accessed: 16-05-2019] [10] Unity 3D [on line] Available in: https://en.wikipedia.org/wiki/Unity_(game_engine) [Accessed: 16-05-2019] [11] Guerrilla test [on line] https://blog.maze.design/maze-guerilla-testing/ [Last Accessed 18-06-2019] [12] SharpPdf information in unity [online] Available in: http://www.devindia.biz/unity-pdf-generation-with-sharppdf-plugin/ [Accessed: 20-05-2019] [12] Creating Pdf in unity with C# [on line] Available in: http://www.rasteredge.com/how-to/csharp-imaging/pdf-creating/ [Accessed: 23-05-2019 [13]Documentation Unity [on line] Available in: https://docs.unity3d.com/es/current/Manual/index.html [Last Accessed 14-06-2019] 49 7. APPENDIX A – SOURCE CODE Connection + Insert BD on both PC and Android. 1. using System; 2. using System.Collections; 3. using System.Collections.Generic; 4. using System.Data; 5. using System.IO; 6. using Mono.Data.Sqlite; 7. using UnityEngine; 8. using UnityEngine.UI; 9. 10. public class Insert : MonoBehaviour 11. { 12. string rutaDB; 13. string strConexion; 14. 15. 16. string DBFileName = "datosPaciente.db"; 17. 18. IDbConnection dbConnection; // Crear conexión 19. IDbCommand dbCommand; // Comandos 20. IDataReader leerdatos; // Para poder leer 21. 22. 23. void Start() 24. { 25. AbrirDB(); 26. CerrarDB(); 27. } 28. 29. 30. void InsertarDatosPacientes() 31. { 32. ComandoINSERT(""); 33. } 34. 35. void AbrirDB() 36. { 37. // Si es PC 38. if (Application.platform == RuntimePlatform.Windows Editor) 39. { 40. rutaDB = Application.dataPath + "/StreamingAsse ts/" + DBFileName; //Se divide la ruta para las diferentes plataformas 41. } 42. 43. // Si es Android 44. 45. else if (Application.platform == RuntimePlatform.An droid) 46. { 47. rutaDB = Application.persistentDataPath + "/" + DBFileName; 48. // Comprobar si está en persistantData 49. if (!File.Exists(rutaDB)) 50. { 50 51. WWW loadDB = new WWW("jar:file://" + Application.dataPath + "!/asset s/" + DBFileName); //Ruta en formato generico de android (Java) 52. while (!loadDB.isDone) 53. { 54. } 55. File.WriteAllBytes(rutaDB, loadDB.bytes); 56. } 57. } 58. 59. // Crear y abrir conexión 60. 61. strConexion = "URI=file:" + rutaDB; 62. dbConnection = new SqliteConnection(strConexion); 63. dbConnection.Open(); 64. 65. } 66. 67. void CerrarDB() 68. { 69. // Cerrar conexiones 70. leerdatos.Close(); 71. leerdatos = null; 72. dbCommand.Dispose(); 73. dbCommand = null; 74. dbConnection.Close(); 75. dbConnection = null; 76. 77. } 78. 79. void ComandoINSERT(string dato) 80. { 81. // Crear consulta 82. dbCommand = dbConnection.CreateCommand(); 83. string sqlQuery = String.Format("insert into datos_pacientes(glucosa_previa) values (\"{0}\")", dato); 84. dbCommand.CommandText = sqlQuery; // Aquí pasamos la consulta 85. dbCommand.ExecuteScalar(); 86. 87. dbCommand.Dispose(); 88. dbCommand = null; 89. dbConnection.Close(); 90. dbConnection = null; 91. 92. 93. } 51 Use Notification Center, with AddObserver and PostNotifiction 1. using System.Collections; 2. using System.Collections.Generic; 3. using UnityEngine; 4. 5. public class AbrirHuevo : MonoBehaviour 6. { 7. 8. public bool nuevaCriatura; 9. 10. // Start is called before the first frame update 11. void Start() 12. { 13. NotificationCenter.DefaultCenter().AddObserver(this , "NuevaCriatura"); 14. CargarGuardar.cargarGuardar.cuentaDias = 0; 15. CargarGuardar.cargarGuardar.Guardar(); 16. 17. } 18. 19. // Update is called once per frame 20. void Update() 21. { 22. NotificationCenter.DefaultCenter().PostNotification (this, "NuevaCriatura"); 23. } 24. 25. public void NuevaCriatura(Notification notification) 26. { 27. CargarGuardar.cargarGuardar.criaturaUno = true; 28. CargarGuardar.cargarGuardar.Guardar(); 29. //Debug.Log(nuevaCriatura); 30. } 31. } 52 Glu Animated text 1. using UnityEngine; 2. using UnityEngine.UI; 3. using System.Collections; 4. 5. public class AnimatedText : MonoBehaviour 6. { 7. public float letterPaused = 0.025f; 8. public string[] message; 9. public Text textComp; 10. public GameObject enter; 11. public GameObject nombre; 12. public GameObject continuar; 13. public GameObject continuarNombre; 14. public GameObject rat; 15. public GameObject fac; 16. 17. 18. 19. private bool checkNext = false; 20. private int lineaActual = 0; 21. private int contador = 0; 22. private bool cambio = false; 23. 24. 25. public void FuncionCambioBool() 26. { 27. cambio = !cambio; 28. //NotificationCenter.DefaultCenter().PostNotificati on(this, "Incremento"); 29. 30. } 31. 32. void Start() 33. { 34. textComp.text = ""; 35. continuar = GameObject.Find("Boton"); 36. nombre = GameObject.Find("Nombre"); 37. rat = GameObject.Find("Ratio"); 38. fac = GameObject.Find("Factor"); 39. 40. 41. 42. StartCoroutine(TypeText(lineaActual)); 43. continuar.SetActive(false); 44. nombre.SetActive(false); 45. rat.SetActive(false); 46. fac.SetActive(false); 47. } 48. 49. 50. public void GuardarDatos() 51. { 52. NotificationCenter.DefaultCenter().PostNotification (this, "GuardarNombre"); 53. NotificationCenter.DefaultCenter().PostNotification (this, "GuardarRatio"); 54. NotificationCenter.DefaultCenter().PostNotification (this, "GuardarFactor"); 53 55. NotificationCenter.DefaultCenter().PostNotification (this, "SaltaTutorial"); 56. } 57. 58. 59. 60. private void Update() 61. { 62. 63. 64. if(checkNext) 65. { 66. enter.SetActive(true); 67. 68. } 69. else 70. { 71. enter.SetActive(false); 72. } 73. 74. if(lineaActual < message.Length - 1 && checkNext && cambio == true && contador !=3 && contador != 5 && contador != 7) 75. { 76. lineaActual++; 77. contador++; 78. checkNext = false; 79. textComp.text = ""; 80. cambio = false; 81. 82. StartCoroutine(TypeText(lineaActual)); 83. } 84. if(contador == 3) 85. { 86. 87. if (cambio == true) 88. { 89. nombre.SetActive(false); 90. lineaActual++; 91. contador++; 92. textComp.text = ""; 93. cambio = false; 94. StartCoroutine(TypeText(lineaActual)); 95. } 96. else 97. { 98. nombre.SetActive(true); 99. 100. } 101. } 102. 103. if (contador == 5) 104. { 105. 106. if (cambio == true) 107. { 108. rat.SetActive(false); 109. lineaActual++; 110. contador++; 111. textComp.text = ""; 112. cambio = false; 54 113. StartCoroutine(TypeText(lineaActual)); 114. } 115. else 116. { 117. rat.SetActive(true); 118. } 119. } 120. 121. if (contador == 7) 122. { 123. if (cambio == true) 124. { 125. fac.SetActive(false); 126. lineaActual++; 127. contador++; 128. textComp.text = ""; 129. cambio = false; 130. StartCoroutine(TypeText(lineaActual)); 131. } 132. else 133. { 134. fac.SetActive(true); 135. } 136. } 137. if (contador == 9) 138. { 139. continuar.SetActive(true); 140. } 141. 142. } 143. 144. IEnumerator TypeText(int line) 145. { 146. foreach(char letter in message[line].ToCharArray()) 147. { 148. textComp.text += letter; 149. 150. yield return 0; 151. yield return new WaitForSeconds(letterPaused); 152. } 153. 154. checkNext = true; 155. } 156. 157. public int getLineaActual() 158. { 159. return lineaActual; 160. } 161. 162. public int getLastLine() 163. { 164. return message.Length - 1; 165. } 166. 167. public bool getCheckNext() 168. { 169. return checkNext; 170. } 171. } 55 Load and Save System (Serializing and Deserializing the data) 1. 2. using System.Collections.Generic; 3. using UnityEngine; 4. using System.Collections; 5. using System.Runtime.Serialization.Formatters.Binary; // Para serializar 6. using System.IO; // Para trabajar con archivos 7. using System; 8. using UnityEngine.SceneManagement; 9. 10. public class CargarGuardar : MonoBehaviour{ 11. 12. 13. // Son los valores del estado del juego que necesitamos 14. 15. public bool tutorial = false; // Saltarse el tutorial 16. public string factSensibilidad; //Factor de sensibilidad que se podrá cambiar en opciones 17. public string ratio; // Ratio 18. public string insulina; 19. public string glucosa; 20. public string hidratos; 21. public string nombre; 22. public string fecha; 23. public string momento; 24. public int cuentaDias = 0; //Contador de días correctos dentro de rango 25. public bool criaturaUno = false; // Generar nueva criatura 26. public bool criaturaDos = false; 27. public bool criaturaTres = false; 28. public bool DixyBlack = true; 29. public bool JamesBlack = true; 30. public bool BenBlack = true; 31. public bool DixyCollect = false; 32. public bool JamesCollect = false; 33. public bool BenCollect = false; 34. public int cuentaFelicidad = 3; 35. 36. public static CargarGuardar cargarGuardar; 37. 38. private String rutaArchivo; 39. 40. public GameObject continuar; 41. 42. void Awake() 43. { 44. if(cargarGuardar == null) 45. { 46. cargarGuardar = this; 47. DontDestroyOnLoad(gameObject); 48. rutaArchivo = Application.persistentDataPath + "/estadoJuegoFinal.dat"; 49. } else if (cargarGuardar != this) 50. { 51. Destroy(gameObject); 52. } 53. 56 54. 55. } 56. 57. // Para acceder CargarGuardar.cargarGuardar.tutorial 58. 59. private void Start() 60. { 61. 62. Cargar(); 63. } 64. 65. private void Update() 66. { 67. 68. } 69. 70. public void Guardar() 71. { 72. 73. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarNombre"); 74. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarFactor"); 75. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarRatio"); 76. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarGlucosa"); 77. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarFecha"); 78. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarHidratos"); 79. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarInsulina"); 80. NotificationCenter.DefaultCenter().AddObserver(this , "SaltaTutorial"); 81. NotificationCenter.DefaultCenter().AddObserver(this , "NuevaCriatura"); 82. NotificationCenter.DefaultCenter().AddObserver(this , "CuentaDias"); 83. NotificationCenter.DefaultCenter().AddObserver(this , "CuentaFelicidad"); 84. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarMomento"); 85. 86. BinaryFormatter bf = new BinaryFormatter(); 87. 88. FileStream file = File.Create(rutaArchivo); 89. 90. DatosaGuardar datos = new DatosaGuardar(); 91. 92. datos.tutorial = tutorial; 93. datos.factSensibilidad = factSensibilidad; 94. datos.ratio = ratio; 95. datos.insulina = insulina; 96. datos.hidratos = hidratos; 97. datos.glucosa = glucosa; 98. datos.fecha = fecha; 99. datos.momento = momento; 100. 101. 102. 57 103. datos.criaturaUno = criaturaUno; 104. datos.criaturaDos = criaturaDos; 105. datos.criaturaTres = criaturaTres; 106. datos.cuentaDias = cuentaDias; 107. datos.cuentaFelicidad = cuentaFelicidad; 108. 109. datos.nombre = nombre; 110. 111. datos.DixyBlack = DixyBlack; 112. datos.JamesBlack = JamesBlack; 113. datos.BenBlack = BenBlack; 114. 115. datos.DixyCollect = DixyCollect; 116. datos.JamesCollect = JamesCollect; 117. datos.BenCollect = BenCollect; 118. 119. 120. 121. bf.Serialize(file, datos); 122. 123. file.Close(); 124. } 125. 126. public void Cargar() 127. { 128. if (File.Exists(rutaArchivo)) 129. { 130. BinaryFormatter bf = new BinaryFormatter(); 131. FileStream file = File.Open(rutaArchivo, FileMode.Open); 132. 133. DatosaGuardar datos = (DatosaGuardar)bf.Deserialize(file); //Hacer un casting 134. 135. tutorial = datos.tutorial; 136. factSensibilidad = datos.factSensibilidad; 137. ratio = datos.ratio; 138. insulina = datos.insulina; 139. hidratos = datos.hidratos; 140. glucosa = datos.glucosa; 141. fecha = datos.fecha; 142. momento = datos.momento; 143. 144. 145. 146. 147. criaturaUno = datos.criaturaUno; 148. criaturaDos = datos.criaturaDos; 149. criaturaTres = datos.criaturaTres; 150. cuentaDias = datos.cuentaDias; 151. nombre = datos.nombre; 152. 153. DixyBlack = datos.DixyBlack; 154. JamesBlack = datos.JamesBlack; 155. BenBlack = datos.BenBlack; 156. 157. DixyCollect = datos.DixyCollect; 158. JamesCollect = datos.JamesCollect; 159. BenCollect = datos.BenCollect; 160. 161. cuentaFelicidad = datos.cuentaFelicidad; 64 24. { 25. AbrirDB(); 26. //ComandoSelect("*", "albums"); 27. //ComandoWHERE("*", "albums", "AlbumId", "=", "33"); 28. //ComandoWHERE_AND("CustomerId", "FirstName", "LastName", "Country", "customers", "Country", "=", "Brazil", "CustomerID", ">", "10"); 29. //ComandoWHERE_AND_ORDERBY("CustomerId", "FirstName", "LastName", "Country", "customers", "Country", "=", "Brazil", "CustomerID", ">", "10", "FirstName", "ASC"); 30. ComandoINSERT("Insertar Glucemia previa"); 31. CerrarDB(); 32. } 33. 34. void AbrirDB() 35. { 36. // Si es PC 37. if (Application.platform == RuntimePlatform.Windows Editor) 38. { 39. rutaDB = Application.dataPath + "/StreamingAsse ts/" + DBFileName; //Se divide la ruta para las diferentes plataformas 40. } 41. 42. // Si es Android 43. 44. else if (Application.platform == RuntimePlatform.An droid) 45. { 46. rutaDB = Application.persistentDataPath + "/" + DBFileName; 47. // Comprobar si está en persistantData 48. if (!File.Exists(rutaDB)) 49. { 50. 51. 52. //UnityWebRequest loadDB = UnityWebRequest.Get("jar:file://" + Application.dataPath + "!/assets/" + DBFileName); 53. 54. WWW loadDB = new WWW("jar:file://" + Application.dataPath + "!/asset s/" + DBFileName); //Ruta en formato generico de android (Java) 55. while (!loadDB.isDone) 56. { 57. } 58. File.WriteAllBytes(rutaDB, loadDB.bytes); 59. } 60. } 61. 62. // Crear y abrir conexión 63. 64. strConexion = "URI=file:" + rutaDB; 65. dbConnection = new SqliteConnection(strConexion); 66. dbConnection.Open(); 67. 68. } 69. 70. void CerrarDB() 65 71. { 72. // Cerrar conexiones 73. leerdatos.Close(); 74. leerdatos = null; 75. dbCommand.Dispose(); 76. dbCommand = null; 77. dbConnection.Close(); 78. dbConnection = null; 79. 80. } 81. 82. 83. // select * 84. // from albums 85. 86. void ComandoSelect(string item, string tabla) 87. { 88. // Crear consulta 89. dbCommand = dbConnection.CreateCommand(); 90. string sqlQuery = "select " + item + " from " + tabla; 91. dbCommand.CommandText = sqlQuery; // Aquí pasamos la consulta 92. 93. // Leer la base de datos 94. leerdatos = dbCommand.ExecuteReader(); 95. while (leerdatos.Read()) 96. { 97. // En pantalla 98. //string testtoconsole = leerdatos.GetString(0); //marca 99. //int testing = leerdatos.GetInt32(1); //id 100. //myText.text = testtoconsole + " - " + testing.ToString(); 101. 102. //Control de errores 103. 104. try 105. { 106. Debug.Log(leerdatos.GetInt32(0) + " - " + leerdatos.GetString(1) + " - " + leerdatos.GetInt32(2)); 107. } 108. 109. catch (FormatException fe) 110. { 111. Debug.Log(fe.Message); 112. continue; 113. } 114. 115. catch (Exception e) 116. { 117. Debug.Log(e.Message); 118. continue; 119. } 120. 121. 122. } 123. } 124. 125. 126. // select AlbumId 66 127. // from albums 128. // where AlbumId = "33" 129. 130. 131. void ComandoWHERE(string item, string tabla, string cam po, string comparador, string dato) 132. { 133. // Crear consulta 134. dbCommand = dbConnection.CreateCommand(); 135. string sqlQuery = "select " + item + " from " + tabla + " where " + campo + " " + comparador + " " + dato; 136. dbCommand.CommandText = sqlQuery; // Aquí pasamos la consulta 137. 138. // Leer la base de datos 139. leerdatos = dbCommand.ExecuteReader(); 140. while (leerdatos.Read()) 141. { 142. 143. //Control de errores 144. 145. try 146. { 147. Debug.Log(leerdatos.GetInt32(0) + " - " + leerdatos.GetString(1) + " - " + leerdatos.GetInt32(2)); 148. } 149. 150. catch (FormatException fe) 151. { 152. Debug.Log(fe.Message); 153. continue; 154. } 155. 156. catch (Exception e) 157. { 158. Debug.Log(e.Message); 159. continue; 160. } 161. 162. 163. } 164. } 165. 166. 167. // select CustomerID, FirstName, LastName, Country 168. // from customers 169. // where Country = "Brazil" 170. // and CustomerId > 10 171. 172. 173. void ComandoWHERE_AND(string item1, string item2, strin g item3, string item4, 174. string tabla, 175. string campo1, string comparado r1, string dato1, 176. string campo2, string comparado r2, string dato2) 177. { 178. // Crear consulta 179. dbCommand = dbConnection.CreateCommand(); 180. 67 181. string sqlQuery = "select " + item1 + "," + item2 + "," + item3 + "," + item4 + //Ojo separar las columnas por "," 182. " from " + tabla + 183. " where " + campo1 + " " + comparador1 + " " + "'" + dato1 +"'"+ 184. " and " + campo2 + " " + comparador2 + dato2; 185. 186. 187. dbCommand.CommandText = sqlQuery; // Aquí pasamos la consulta 188. 189. // Leer la base de datos 190. leerdatos = dbCommand.ExecuteReader(); 191. while (leerdatos.Read()) 192. { 193. 194. 195. //Control de errores 196. 197. try 198. { 199. Debug.Log(leerdatos.GetInt32(0) + " " + leerdatos.GetString(1) + " " + leerdatos.GetString(2) + "- " + leerdatos.GetString(3)); 200. } 201. 202. catch (FormatException fe) 203. { 204. Debug.Log(fe.Message); 205. continue; 206. } 207. 208. catch (Exception e) 209. { 210. Debug.Log(e.Message); 211. continue; 212. } 213. 214. 215. } 216. } 217. 218. // select CustomerID, FirstName, LastName, Country 219. // from customers 220. // where Country = "Brazil" 221. // and CustomerId > 10 222. // order by FirstName ASC 223. 224. 225. void ComandoWHERE_AND_ORDERBY(string item1, string item 2, string item3, string item4, 226. string tabla, 227. string campo1, string comparado r1, string dato1, 228. string campo2, string comparado r2, string dato2, 229. string campo3, string orden) 230. { 231. // Crear consulta 68 232. dbCommand = dbConnection.CreateCommand(); 233. 234. string sqlQuery = "select " + item1 + "," + item2 + "," + item3 + "," + item4 + //Ojo separar las columnas por "," 235. " from " + tabla + 236. " where " + campo1 + " " + comparador1 + " " + "'" + dato1 + "'" + 237. " and " + campo2 + " " + comparador2 + dato2 + 238. " order by " + campo3 + " " + orden; 239. 240. 241. dbCommand.CommandText = sqlQuery; // Aquí pasamos la consulta 242. 243. // Leer la base de datos 244. leerdatos = dbCommand.ExecuteReader(); 245. while (leerdatos.Read()) 246. { 247. 248. 249. //Control de errores 250. 251. try 252. { 253. Debug.Log(leerdatos.GetInt32(0) + " " + leerdatos.GetString(1) + " " + leerdatos.GetString(2) + "- " + leerdatos.GetString(3)); 254. } 255. 256. catch (FormatException fe) 257. { 258. Debug.Log(fe.Message); 259. continue; 260. } 261. 262. catch (Exception e) 263. { 264. Debug.Log(e.Message); 265. continue; 266. } 267. 268. 269. } 270. } 271. 272. // select CustomerID, FirstName, LastName, Country 273. // from customers 274. // where Country IN ("Brazil", "USA"); 275. 276. 277. 278. void ComandoIN(string item1, string item2, string item3 , string item4, 279. string tabla, 280. string campo1, string dato1, st ring dato2) 281. { 282. // Crear consulta 69 283. dbCommand = dbConnection.CreateCommand(); 284. 285. string sqlQuery = "select " + item1 + "," + item2 + "," + item3 + "," + item4 + //Ojo separar las columnas por "," 286. " from " + tabla + 287. " where " + campo1 + " " + "IN" + " " + "(" + dato1 + "'" + "," + " + campo2 " + ")"; 288. 289. 290. 291. dbCommand.CommandText = sqlQuery; // Aquí pasamos la consulta 292. 293. // Leer la base de datos 294. leerdatos = dbCommand.ExecuteReader(); 295. while (leerdatos.Read()) 296. { 297. 298. 299. //Control de errores 300. 301. try 302. { 303. Debug.Log(leerdatos.GetInt32(0) + " " + leerdatos.GetString(1) + " " + leerdatos.GetString(2) + "- " + leerdatos.GetString(3)); 304. } 305. 306. catch (FormatException fe) 307. { 308. Debug.Log(fe.Message); 309. continue; 310. } 311. 312. catch (Exception e) 313. { 314. Debug.Log(e.Message); 315. continue; 316. } 317. 318. 319. } 320. } 321. 322. // insert into media_types(name) values ("image") 323. 324. 325. 326. void ComandoINSERT(string dato) 327. { 328. // Crear consulta 329. dbCommand = dbConnection.CreateCommand(); 330. string sqlQuery = String.Format("insert into media_types(Name) values (\"{0}\")", dato); 331. dbCommand.CommandText = sqlQuery; // Aquí pasamos la consulta 332. dbCommand.ExecuteScalar(); 333. 334. dbCommand.Dispose(); 335. dbCommand = null; 70 336. dbConnection.Close(); 337. dbConnection = null; 338. 339. 340. } 341. 342. } 71 Change Moment of Day 1. using System.Collections; 2. using System.Collections.Generic; 3. using UnityEngine; 4. 5. public class CambioMomentoPro : MonoBehaviour 6. { 7. 8. 9. public GameObject volver; 10. 11. public GameObject fondoDes; 12. public GameObject fondoAlm; 13. public GameObject fondoCom; 14. public GameObject fondoMer; 15. public GameObject fondoCen; 16. 17. public GameObject textoDes; 18. public GameObject textoAlm; 19. public GameObject textoCom; 20. public GameObject textoMer; 21. public GameObject textoCen; 22. 23. public GameObject aniDes; 24. public GameObject aniAlm; 25. public GameObject aniCom; 26. public GameObject aniMer; 27. public GameObject aniCen; 28. 29. 30. 31. 32. public Int32 hora = 0; 33. 34. public void comprobarHora() 35. { 36. hora = DateTime.Now.Hour; 37. } 38. 39. 40. public int contador = 0; 41. 42. 43. 44. public void FuncionContadorMas() 45. { 46. 47. 48. contador++; 49. 50. } 51. 52. 53. 54. public void FuncionContadorMenos() 55. { 56. contador--; 57. 58. } 59. 72 60. // Start is called before the first frame update 61. void Start() 62. { 63. 64. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarMomento"); 65. 66. comprobarHora(); 67. volver = GameObject.Find("Back"); 68. 69. fondoDes = GameObject.Find("BGDes"); ; 70. fondoAlm = GameObject.Find("BGAlm"); ; 71. fondoCom = GameObject.Find("BGCom"); ; 72. fondoMer = GameObject.Find("BGMer"); ; 73. fondoCen = GameObject.Find("BGCen"); ; 74. 75. textoDes = GameObject.Find("DesayunoM"); ; 76. textoAlm = GameObject.Find("AlmuerzoM"); ; 77. textoCom = GameObject.Find("ComidaM"); ; 78. textoMer = GameObject.Find("MeriendaM"); ; 79. textoCen = GameObject.Find("CenaM"); ; 80. 81. aniDes = GameObject.Find("Desayuno"); ; 82. aniAlm = GameObject.Find("Almuerzo"); ; 83. aniCom = GameObject.Find("Comida"); ; 84. aniMer = GameObject.Find("Merienda"); ; 85. aniCen = GameObject.Find("Cena"); ; 86. 87. volver.SetActive(false); 88. 89. fondoDes.SetActive(false); 90. textoDes.SetActive(false); 91. aniDes.SetActive(false); 92. 93. fondoAlm.SetActive(false); 94. textoAlm.SetActive(false); 95. aniAlm.SetActive(false); 96. 97. fondoCom.SetActive(false); 98. textoCom.SetActive(false); 99. aniCom.SetActive(false); 100. 101. fondoMer.SetActive(false); 102. textoMer.SetActive(false); 103. aniMer.SetActive(false); 104. 105. fondoCen.SetActive(false); 106. textoCen.SetActive(false); 107. aniCen.SetActive(false); 108. 109. 110. 111. 112. } 113. /* 114. public void GuardarMomento(Notification notification) 115. { 116. if (hora >= 7 && hora <= 10) 117. { 118. CargarGuardar.cargarGuardar.momento = "Desayuno"; 73 119. CargarGuardar.cargarGuardar.Guardar(); 120. } 121. else if (hora >= 10 && hora <= 12) 122. { 123. CargarGuardar.cargarGuardar.momento = "Almuerzo"; 124. CargarGuardar.cargarGuardar.Guardar(); 125. } 126. else if (hora >= 12 && hora <= 15) 127. { 128. CargarGuardar.cargarGuardar.momento = "Comida"; 129. CargarGuardar.cargarGuardar.Guardar(); 130. } 131. else if (hora >= 17 && hora <= 19) 132. { 133. CargarGuardar.cargarGuardar.momento = "Merienda"; 134. CargarGuardar.cargarGuardar.Guardar(); 135. } 136. else if (hora >= 17 && hora <= 19) 137. { 138. CargarGuardar.cargarGuardar.momento = "Cena"; 139. CargarGuardar.cargarGuardar.Guardar(); 140. } 141. 142. 143. } 144. */ 145. 146. public void GuardarMomento(Notification notification) 147. { 148. if (contador == 0) 149. { 150. CargarGuardar.cargarGuardar.momento = "Desayuno "; 151. CargarGuardar.cargarGuardar.Guardar(); 152. } 153. else if(contador == 1) 154. { 155. CargarGuardar.cargarGuardar.momento = "Almuerzo "; 156. CargarGuardar.cargarGuardar.Guardar(); 157. } 158. else if (contador == 2) 159. { 160. CargarGuardar.cargarGuardar.momento = "Comida"; 161. CargarGuardar.cargarGuardar.Guardar(); 162. } 163. else if (contador == 3) 164. { 165. CargarGuardar.cargarGuardar.momento = "Merienda "; 166. CargarGuardar.cargarGuardar.Guardar(); 167. } 168. else if (contador == 4) 169. { 170. CargarGuardar.cargarGuardar.momento = "Cena"; 171. CargarGuardar.cargarGuardar.Guardar(); 172. } 173. 174. 80 Food Change 1. using System.Collections; 2. using System.Collections.Generic; 3. using UnityEngine; 4. 5. public class CambiarComida : MonoBehaviour 6. { 7. 8. public int contadorComida = 0; 9. public int contadorTamaño = 0; 10. 11. public GameObject macaPeq; 12. public GameObject macaMed; 13. public GameObject macaGrd; 14. 15. public GameObject arrozPeq; 16. public GameObject arrozMed; 17. public GameObject arrozGrd; 18. 19. public GameObject guiPeq; 20. public GameObject guiMed; 21. public GameObject guiGrd; 22. 23. public bool mp = false; 24. public bool mm = false; 25. public bool mg = false; 26. 27. public bool ap = false; 28. public bool am = false; 29. public bool ag = false; 30. 31. public bool gp = false; 32. public bool gm = false; 33. public bool gg = false; 34. 35. public void FuncionContadorMasComida() 36. { 37. contadorComida++; 38. } 39. 40. public void FuncionContadorMasTamaño() 41. { 42. contadorTamaño++; 43. } 44. 45. public void FuncionContadorMenosComida() 46. { 47. contadorComida--; 48. } 49. 50. public void FuncionContadorMenosTamaño() 51. { 52. contadorTamaño--; 53. } 54. 55. // Start is called before the first frame update 56. void Start() 57. { 58. 59. macaPeq = GameObject.Find("MacarronesPeq"); 81 60. macaMed = GameObject.Find("MacarronesMed"); 61. macaGrd = GameObject.Find("MacarronesGrd"); 62. 63. arrozPeq = GameObject.Find("ArrozPeq"); 64. arrozMed = GameObject.Find("ArrozMed"); 65. arrozGrd = GameObject.Find("ArrozGrd"); 66. 67. guiPeq = GameObject.Find("GuisantesPeq"); 68. guiMed = GameObject.Find("GuisantesMed"); 69. guiGrd = GameObject.Find("GuisantesGrd"); 70. 71. macaPeq.SetActive(false); 72. macaMed.SetActive(false); 73. macaGrd.SetActive(false); 74. 75. arrozPeq.SetActive(false); 76. arrozMed.SetActive(false); 77. arrozGrd.SetActive(false); 78. 79. guiPeq.SetActive(false); 80. guiMed.SetActive(false); 81. guiGrd.SetActive(false); 82. 83. } 84. 85. // Update is called once per frame 86. void Update() 87. { 88. if(contadorComida == 0) 89. { 90. if (contadorTamaño == 0) 91. { 92. macaPeq.SetActive(true); 93. macaMed.SetActive(false); 94. macaGrd.SetActive(false); 95. arrozPeq.SetActive(false); 96. arrozMed.SetActive(false); 97. arrozGrd.SetActive(false); 98. guiPeq.SetActive(false); 99. guiMed.SetActive(false); 100. guiGrd.SetActive(false); 101. 102. 103. } 104. else if(contadorTamaño == 1) 105. { 106. macaPeq.SetActive(false); 107. macaMed.SetActive(true); 108. macaGrd.SetActive(false); 109. arrozPeq.SetActive(false); 110. arrozMed.SetActive(false); 111. arrozGrd.SetActive(false); 112. guiPeq.SetActive(false); 113. guiMed.SetActive(false); 114. guiGrd.SetActive(false); 115. } 116. else if(contadorTamaño == 2) 117. { 118. macaPeq.SetActive(false); 119. macaMed.SetActive(false); 120. macaGrd.SetActive(true); 82 121. arrozPeq.SetActive(false); 122. arrozMed.SetActive(false); 123. arrozGrd.SetActive(false); 124. guiPeq.SetActive(false); 125. guiMed.SetActive(false); 126. guiGrd.SetActive(false); 127. } 128. 129. } 130. else if(contadorComida == 1) 131. { 132. if (contadorTamaño == 0) 133. { 134. macaPeq.SetActive(false); 135. macaMed.SetActive(false); 136. macaGrd.SetActive(false); 137. arrozPeq.SetActive(true); 138. arrozMed.SetActive(false); 139. arrozGrd.SetActive(false); 140. guiPeq.SetActive(false); 141. guiMed.SetActive(false); 142. guiGrd.SetActive(false); 143. 144. } 145. else if (contadorTamaño == 1) 146. { 147. macaPeq.SetActive(false); 148. macaMed.SetActive(false); 149. macaGrd.SetActive(false); 150. arrozPeq.SetActive(false); 151. arrozMed.SetActive(true); 152. arrozGrd.SetActive(false); 153. guiPeq.SetActive(false); 154. guiMed.SetActive(false); 155. guiGrd.SetActive(false); 156. } 157. else if (contadorTamaño == 2) 158. { 159. macaPeq.SetActive(false); 160. macaMed.SetActive(false); 161. macaGrd.SetActive(false); 162. arrozPeq.SetActive(false); 163. arrozMed.SetActive(false); 164. arrozGrd.SetActive(true); 165. guiPeq.SetActive(false); 166. guiMed.SetActive(false); 167. guiGrd.SetActive(false); 168. } 169. } 170. else if (contadorComida == 2) 171. { 172. if (contadorTamaño == 0) 173. { 174. macaPeq.SetActive(false); 175. macaMed.SetActive(false); 176. macaGrd.SetActive(false); 177. arrozPeq.SetActive(false); 178. arrozMed.SetActive(false); 179. arrozGrd.SetActive(false); 180. guiPeq.SetActive(true); 181. guiMed.SetActive(false); 83 182. guiGrd.SetActive(false); 183. } 184. else if (contadorTamaño == 1) 185. { 186. macaPeq.SetActive(false); 187. macaMed.SetActive(false); 188. macaGrd.SetActive(false); 189. arrozPeq.SetActive(false); 190. arrozMed.SetActive(false); 191. arrozGrd.SetActive(false); 192. guiPeq.SetActive(false); 193. guiMed.SetActive(true); 194. guiGrd.SetActive(false); 195. } 196. else if (contadorTamaño == 2) 197. { 198. macaPeq.SetActive(false); 199. macaMed.SetActive(false); 200. macaGrd.SetActive(false); 201. arrozPeq.SetActive(false); 202. arrozMed.SetActive(false); 203. arrozGrd.SetActive(false); 204. guiPeq.SetActive(false); 205. guiMed.SetActive(false); 206. guiGrd.SetActive(true); 207. } 208. } 209. if (contadorTamaño > 2) 210. { 211. contadorTamaño = 0; 212. } 213. if (contadorTamaño < 0) 214. { 215. contadorTamaño = 2; 216. } 217. if (contadorComida > 2) 218. { 219. contadorComida = 0; 220. } 221. if (contadorComida < 0) 222. { 223. contadorComida = 2; 224. } 225. } 226. 227. } 84 Insert data in Load and Save System 1. using System.Collections; 2. using System.Collections.Generic; 3. using UnityEngine; 4. using UnityEngine.UI; 5. using UnityEngine.SceneManagement; 6. using System; 7. 8. public class Insertar : MonoBehaviour 9. { 10. 11. 12. public GameObject warning80; 13. public GameObject warning250; 14. 15. public GameObject hidratos; 16. public GameObject glucosa; 17. public GameObject insulina; 18. 19. public GameObject TextHidratos; 20. public GameObject TextGlucosa; 21. public GameObject TextInsulina; 22. 23. public GameObject botonContinuar; 24. 25. 26. 27. public float nhidratos; 28. public float nprevia; 29. public float ninsulina; 30. public float nratio; 31. public float nfactor; 32. 33. public DateTime today = DateTime.Today; 34. 35. 36. 37. 38. 39. public int contador = 0; 40. public string cargarNombre; 41. public string cargaRatio; 42. public string cargarFactor; 43. public bool cargarSaltar; 44. public float calculo; 45. 46. public InputField iglu; 47. public InputField ihc; 48. public InputField ins; 49. public InputField fecha; 50. 51. 52. 53. public int cuentaDias = 0; 54. 55. public int contadordias; 56. public int contadorfelicidad; 57. 58. public bool activo = false; 59. public int cuenta = 3; 85 60. 61. 62. 63. 64. 65. 66. public void FuncionContador() 67. { 68. contador++; 69. activo = false; 70. } 71. 72. public void cargarRatioyFactor() 73. { 74. 75. 76. 77. 78. //cargarNombre = CargarGuardar.cargarGuardar.nombre; 79. cargaRatio = CargarGuardar.cargarGuardar.ratio; 80. cargarFactor = CargarGuardar.cargarGuardar.factSens ibilidad; 81. //calculo = calculo + cargaRatio; 82. 83. nratio = float.Parse(cargaRatio); // Convertimos el string en float 84. nfactor = float.Parse(cargarFactor); 85. 86. 87. 88. 89. /*Debug.Log(cargarNombre); 90. Debug.Log(cargarFactor); 91. Debug.Log(cargaRatio); 92. Debug.Log(nhidratos); 93. Debug.Log(nprevia); 94. Debug.Log(calculo); 95. Debug.Log(today);*/ 96. } 97. 98. public void cambioActivo() 99. { 100. activo = true; 101. } 102. 103. 104. 105. // Start is called before the first frame update 106. void Start() 107. { 108. Debug.Log(contador); 109. 110. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarHidratos"); 111. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarGlucosa"); 112. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarInsulina"); 113. NotificationCenter.DefaultCenter().AddObserver(this , "GuardarFecha"); 86 114. NotificationCenter.DefaultCenter().AddObserver(this , "CuentaDias"); 115. NotificationCenter.DefaultCenter().AddObserver(this , "CuentaFelicidad"); 116. 117. fecha.text = today.ToString("dd/MM/yyyy"); 118. 119. TextHidratos = GameObject.Find("hc"); 120. hidratos = GameObject.Find("introduceHc"); 121. 122. TextGlucosa = GameObject.Find("glucosa"); 123. glucosa = GameObject.Find("introduceGlucosa"); 124. 125. TextInsulina = GameObject.Find("insulina"); 126. insulina = GameObject.Find("insulinaNecesaria"); 127. 128. warning80 = GameObject.Find("w80"); ; 129. warning250 = GameObject.Find("w250"); ; 130. 131. botonContinuar = GameObject.Find("Continuar"); 132. 133. botonContinuar.SetActive(false); 134. 135. 136. TextHidratos.SetActive(false); 137. hidratos.SetActive(false); 138. 139. TextGlucosa.SetActive(false); 140. glucosa.SetActive(false); 141. 142. TextInsulina.SetActive(false); 143. insulina.SetActive(false); 144. 145. warning80.SetActive(false); 146. warning250.SetActive(false); 147. 148. 149. } 150. 151. public void GuardarFecha(Notification notification) 152. { 153. CargarGuardar.cargarGuardar.fecha = today.ToString( "dd/MM/yyyy"); 154. CargarGuardar.cargarGuardar.Guardar(); 155. } 156. 157. public void GuardarHidratos(Notification notification) 158. { 159. CargarGuardar.cargarGuardar.glucosa = iglu.text; 160. CargarGuardar.cargarGuardar.Guardar(); 161. 162. } 163. 164. public void GuardarGlucosa(Notification notification) 165. { 166. CargarGuardar.cargarGuardar.hidratos = ihc.text; 167. CargarGuardar.cargarGuardar.Guardar(); 168. 169. } 170. 171. public void GuardarInsulina(Notification notification) 87 172. { 173. CargarGuardar.cargarGuardar.insulina = ins.text; 174. CargarGuardar.cargarGuardar.Guardar(); 175. 176. } 177. 178. public void CuentaDias(Notification notification) 179. { 180. CargarGuardar.cargarGuardar.cuentaDias = CargarGuar dar.cargarGuardar.cuentaDias + contadordias; 181. CargarGuardar.cargarGuardar.Guardar(); 182. Debug.Log(cuentaDias); 183. } 184. 185. public void CuentaFelicidad(Notification notification) 186. { 187. CargarGuardar.cargarGuardar.cuentaFelicidad = Carga rGuardar.cargarGuardar.cuentaFelicidad - contadorfelicidad; 188. CargarGuardar.cargarGuardar.Guardar(); 189. Debug.Log(contadorfelicidad); 190. } 191. // Update is called once per frame 192. void Update() 193. { 194. 195. 196. 197. 198. if (contador == 0) 199. { 200. TextHidratos.SetActive(true); 201. hidratos.SetActive(true); 202. 203. if (activo == false) 204. { 205. botonContinuar.SetActive(false); 206. } 207. if (activo == true) 208. { 209. botonContinuar.SetActive(true); 210. 211. } 212. 213. } 214. else if (contador == 1) 215. { 216. TextHidratos.SetActive(false); 217. hidratos.SetActive(false); 218. TextGlucosa.SetActive(true); 219. glucosa.SetActive(true); 220. 221. 222. 223. if (activo == false) 224. { 225. botonContinuar.SetActive(false); 226. } 227. if (activo == true) 228. { 229. botonContinuar.SetActive(true); 230. } 88 231. 232. 233. 234. 235. 236. 237. } 238. else if (contador == 2) 239. { 240. nprevia = float.Parse(iglu.text); 241. if (nprevia > 250) 242. { 243. warning250.SetActive(true); 244. contadorfelicidad = 1; 245. } 246. else if (nprevia < 80) 247. { 248. warning80.SetActive(true); 249. contadorfelicidad = 1; 250. } 251. else 252. { 253. contador = contador + 1; 254. 255. } 256. } 257. else if (contador == 3) 258. { 259. warning80.SetActive(false); 260. warning250.SetActive(false); 261. TextGlucosa.SetActive(false); 262. glucosa.SetActive(false); 263. TextInsulina.SetActive(true); 264. insulina.SetActive(true); 265. 266. nhidratos = float.Parse(ihc.text); 267. //nprevia = float.Parse(iglu.text); 268. 269. // (ratio * hc) +- (glucosa previa - valor deseado) / factor de sensibilidad) - Insulina activa 270. 271. calculo = ((nratio * nhidratos) + (nprevia - 10 0) / nfactor); 272. ins.text = calculo.ToString(); 273. 274. 275. 276. } 277. else if(contador == 4) 278. { 279. 280. contadordias++; 281. 282. NotificationCenter.DefaultCenter().PostNotifica tion(this, "GuardarHidratos"); 283. NotificationCenter.DefaultCenter().PostNotifica tion(this, "GuardarGlucosa"); 284. NotificationCenter.DefaultCenter().PostNotifica tion(this, "GuardarInsulina"); 285. NotificationCenter.DefaultCenter().PostNotifica tion(this, "GuardarFecha"); 89 286. NotificationCenter.DefaultCenter().PostNotifica tion(this, "CuentaDias"); 287. NotificationCenter.DefaultCenter().PostNotifica tion(this, "CuentaFelicidad"); 288. SceneManager.LoadScene("Principal"); 289. 290. } 291. } 292. 293. 294. 295. 296. } 96 Dinner Animation 97 Happiness Bar 98 Talking Glu Animation 99 New Creatures Animation Open Egg Animation 100 Egg, Hc, Trophy and Add Values Buttons. Options Buttons Back and Next Buttons