All language subtitles for 15. Creating the Game Loop Foundation

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian Download
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:00,256 --> 00:00:04,352 Let's start building out the Foundation of our main game 2 00:00:04,608 --> 00:00:09,728 So in games like vampire survivors and brotato in others in the genre 3 00:00:09,984 --> 00:00:12,288 Typically what happens if you have some amount 4 00:00:12,544 --> 00:00:13,056 Time 5 00:00:13,312 --> 00:00:16,384 That the level lasts or 6 00:00:16,640 --> 00:00:19,456 You define predetermined timeline 7 00:00:19,712 --> 00:00:20,736 10 minutes lads 8 00:00:21,248 --> 00:00:22,784 That you have to serve 9 00:00:23,296 --> 00:00:26,112 And so what we're going to do is we're going to follow the van 10 00:00:26,368 --> 00:00:27,136 Survivors model 11 00:00:27,392 --> 00:00:28,160 Where 12 00:00:28,416 --> 00:00:30,720 You have to survive for something like 10 min 13 00:00:31,232 --> 00:00:33,280 And then you have to collect 14 00:00:33,536 --> 00:00:35,840 Will experience orbs that the enemy 15 00:00:36,096 --> 00:00:37,120 Drop in 16 00:00:37,376 --> 00:00:38,912 To get your upgrade 17 00:00:39,424 --> 00:00:40,192 Before we die 18 00:00:40,448 --> 00:00:41,984 I'm noticing that are most 19 00:00:42,240 --> 00:00:45,056 Camera tweaks have reintroduced the jitter 20 00:00:45,568 --> 00:00:47,104 For the player would you may have no 21 00:00:47,616 --> 00:00:53,760 And this is the unfortunate thing about guedel there are some cork's and one of them is to die 22 00:00:54,784 --> 00:00:57,600 That you just kind of have to work around on a case 23 00:00:57,856 --> 00:00:58,368 Case basis 24 00:00:58,880 --> 00:01:00,909 So even though our snap transforms to pixel 25 00:01:00,911 --> 00:01:03,387 Subtitled by online-courses.club We compress knowledge for you! 26 00:01:03,388 --> 00:01:04,000 Setting was working earlier 27 00:01:04,512 --> 00:01:06,816 It appears not to be working now with the stronger 28 00:01:07,328 --> 00:01:07,840 Camera 29 00:01:08,096 --> 00:01:08,864 Accelerate 30 00:01:09,888 --> 00:01:13,216 So what we're going to do is really go back to the project project settings 31 00:01:13,472 --> 00:01:14,496 I'm working a turn off 32 00:01:15,008 --> 00:01:16,288 Do you snap to the Trance 33 00:01:16,544 --> 00:01:17,056 What's the pixel 34 00:01:17,312 --> 00:01:17,824 London 35 00:01:18,080 --> 00:01:19,104 The rendering set 36 00:01:19,616 --> 00:01:20,640 You can find it by 37 00:01:20,896 --> 00:01:21,408 Writing 38 00:01:21,664 --> 00:01:22,176 Snow 39 00:01:22,432 --> 00:01:23,200 In the filter 40 00:01:23,456 --> 00:01:25,504 And then I'm checking that and running it 41 00:01:26,016 --> 00:01:26,784 Until again 42 00:01:27,040 --> 00:01:29,344 I know that we're going back and forth on this but 43 00:01:29,600 --> 00:01:34,720 Just to know that setting is available and you can tweak it as necessary to make your game 44 00:01:34,976 --> 00:01:39,072 Good but the game is looking ok now without that setting on 45 00:01:39,328 --> 00:01:41,120 Install working and move forward with 46 00:01:41,376 --> 00:01:46,240 Alright so we need to keep track of the amount of time that the player is in the level 47 00:01:46,496 --> 00:01:47,264 After which 48 00:01:47,520 --> 00:01:48,800 The level will be 49 00:01:49,056 --> 00:01:49,568 Beaten 50 00:01:49,824 --> 00:01:52,640 So let's go ahead and create a new scene with controllers 51 00:01:53,152 --> 00:01:53,920 We're going to 52 00:01:54,176 --> 00:01:56,480 Select other node and then put a 53 00:01:56,736 --> 00:01:59,040 Route type of just the basic node in 54 00:01:59,808 --> 00:02:02,624 What's go ahead and rename this by double-clicking in 55 00:02:02,880 --> 00:02:04,160 Rename this too 56 00:02:04,416 --> 00:02:05,184 Mrs Colin 57 00:02:05,440 --> 00:02:06,208 Arena 58 00:02:07,232 --> 00:02:07,744 Time 59 00:02:08,256 --> 00:02:08,768 Manager 60 00:02:09,536 --> 00:02:11,328 Morgan save that was control 61 00:02:11,584 --> 00:02:13,120 Going to your scenes directory 62 00:02:13,376 --> 00:02:14,144 Manager 63 00:02:14,400 --> 00:02:17,216 And save it alongside the enemy manager there 64 00:02:17,728 --> 00:02:18,240 Alright 65 00:02:19,008 --> 00:02:21,312 So get her Arena time manager 66 00:02:21,824 --> 00:02:23,616 I'm going to go ahead and add a timer 67 00:02:24,128 --> 00:02:26,176 Reusing a light timers but timers are various 68 00:02:26,688 --> 00:02:28,480 And then we're going to set this timer to 69 00:02:28,992 --> 00:02:30,272 Have a wait time 70 00:02:30,528 --> 00:02:31,552 60 time 71 00:02:32,320 --> 00:02:33,856 So 600 seconds is 10 min 72 00:02:34,368 --> 00:02:36,928 But actually just turn it down to 60 for testing purposes 73 00:02:37,696 --> 00:02:38,720 Set away time 74 00:02:38,976 --> 00:02:39,488 I'm going to 75 00:02:39,744 --> 00:02:41,536 21 shot and auto start 76 00:02:41,792 --> 00:02:43,840 Ok and now before we do anything 77 00:02:44,096 --> 00:02:46,400 Let's create a new scene with control n 78 00:02:46,656 --> 00:02:49,216 Make this a type of canvas layer 79 00:02:49,728 --> 00:02:51,008 Tennis player 80 00:02:51,264 --> 00:02:51,776 And 81 00:02:52,800 --> 00:02:54,080 We're going to call this 82 00:02:54,592 --> 00:02:56,128 Arena time 83 00:02:56,640 --> 00:02:57,152 You are 84 00:02:57,664 --> 00:02:58,944 Go ahead and save that 85 00:02:59,200 --> 00:03:01,248 Go up to your scenes directory 86 00:03:01,504 --> 00:03:02,528 Create a new folder 87 00:03:02,784 --> 00:03:03,296 In here 88 00:03:03,552 --> 00:03:04,832 You are 89 00:03:05,344 --> 00:03:06,624 Or user interface 90 00:03:06,880 --> 00:03:08,672 And then go ahead and save it 91 00:03:08,928 --> 00:03:09,440 There 92 00:03:09,696 --> 00:03:10,208 Ok 93 00:03:10,464 --> 00:03:13,024 So we're going to start getting into control now there's a little bit here 94 00:03:13,280 --> 00:03:14,560 Which will dive into 95 00:03:14,816 --> 00:03:16,864 Later on more in depth 96 00:03:17,120 --> 00:03:18,656 We'll get a little bit of an introduction 97 00:03:18,912 --> 00:03:19,424 2 98 00:03:19,680 --> 00:03:21,472 Audi new 99 00:03:21,728 --> 00:03:22,240 Child 100 00:03:22,496 --> 00:03:23,520 With control 101 00:03:24,032 --> 00:03:24,800 Search for 102 00:03:25,312 --> 00:03:26,336 Margin container 103 00:03:26,592 --> 00:03:27,616 Garden answer 104 00:03:28,128 --> 00:03:34,272 Ok this is a control now then what controller it's basically are our ways of displaying UL ilm 105 00:03:34,528 --> 00:03:36,832 As well as laying out uil 106 00:03:37,088 --> 00:03:38,368 Emergent 107 00:03:38,624 --> 00:03:39,136 Is 108 00:03:39,392 --> 00:03:40,416 A container 109 00:03:40,672 --> 00:03:43,744 So it's designed to hold other control element 110 00:03:44,256 --> 00:03:47,584 Where you can also specify margins so you can give a little bit 111 00:03:47,840 --> 00:03:48,864 Padding on 112 00:03:49,120 --> 00:03:49,632 Side 113 00:03:49,888 --> 00:03:51,168 So if I go ahead 114 00:03:51,424 --> 00:03:55,520 Control a2ad a level node which is simply just text 115 00:03:56,032 --> 00:03:58,592 Can I go ahead and write in the text properly here test 116 00:03:58,848 --> 00:04:00,384 Sagar my margin container here 117 00:04:00,640 --> 00:04:03,712 Now what happens if I scroll down on my margin container 118 00:04:03,968 --> 00:04:05,760 Can I go to the theme override 119 00:04:06,016 --> 00:04:06,528 Constance 120 00:04:07,040 --> 00:04:10,112 I can define a modern lap so if I say margin-left of 16 121 00:04:10,624 --> 00:04:13,184 You can see that adds a 16 pixel 122 00:04:14,464 --> 00:04:15,744 Can I do the same on the rear 123 00:04:16,256 --> 00:04:17,791 Now we got 16 pixel pad 124 00:04:18,303 --> 00:04:19,327 On the road as well 125 00:04:19,583 --> 00:04:22,911 So this is just a nice way of displaying content 126 00:04:23,167 --> 00:04:24,191 That needs padding 127 00:04:24,447 --> 00:04:26,239 But also it's a nice way of 128 00:04:26,495 --> 00:04:29,567 Having a container when you need a container for layer 129 00:04:29,823 --> 00:04:34,175 And what does that mean well let's go ahead and do this so I can show you so 130 00:04:34,687 --> 00:04:35,711 Select reminder contain 131 00:04:36,223 --> 00:04:38,783 Go up to this little icon here 132 00:04:39,039 --> 00:04:40,831 That's for the Anchor in Australia 133 00:04:41,087 --> 00:04:41,855 Quick that 134 00:04:42,111 --> 00:04:44,671 And then the bottom right select the full 135 00:04:44,927 --> 00:04:45,439 Next auction 136 00:04:47,487 --> 00:04:49,791 So that's going to do is that's going to make 137 00:04:50,047 --> 00:04:51,071 The margin container 138 00:04:51,327 --> 00:04:54,143 Fill the entirety of the screen 139 00:04:54,655 --> 00:05:00,543 Ok and so what are we doing with the Serena time you are basically the goal here is we want to display the curry 140 00:05:00,799 --> 00:05:01,311 Time 141 00:05:01,567 --> 00:05:02,591 Of the 142 00:05:03,103 --> 00:05:04,383 So we want to 143 00:05:04,639 --> 00:05:06,175 Ideally count 144 00:05:06,687 --> 00:05:07,199 From 145 00:05:07,455 --> 00:05:08,223 0 146 00:05:08,479 --> 00:05:11,039 To keep track of how much time the player has been in the 147 00:05:11,551 --> 00:05:13,599 Is going to show the time at the top 148 00:05:14,111 --> 00:05:14,623 Screen 149 00:05:14,879 --> 00:05:16,671 So that means I'm going to take this label 150 00:05:16,927 --> 00:05:18,975 And we are going to 151 00:05:19,231 --> 00:05:19,999 Scroll down 152 00:05:20,255 --> 00:05:21,791 To the container sizing 153 00:05:22,047 --> 00:05:24,095 Let's change horizontal fill 154 00:05:24,351 --> 00:05:28,959 So fill you can see kind of what is represented by basically film means 155 00:05:29,215 --> 00:05:31,263 Stretch edge to edge 156 00:05:31,519 --> 00:05:33,823 In your container either vertically or horizontally 157 00:05:34,079 --> 00:05:35,359 Survey shows fuel for 158 00:05:35,615 --> 00:05:38,687 Well you can see now it's feeling the entire thing 159 00:05:38,943 --> 00:05:42,783 So what we want to actually do with horizontal if we want to use drink Centre 160 00:05:43,039 --> 00:05:44,063 Which will take 161 00:05:44,319 --> 00:05:45,855 This level and 162 00:05:46,111 --> 00:05:47,903 Put it into the centre of its container 163 00:05:48,159 --> 00:05:49,183 And then 164 00:05:49,439 --> 00:05:50,975 Let's just do you shrink begin 165 00:05:51,487 --> 00:05:52,767 Now our labour 166 00:05:53,023 --> 00:05:54,559 Is stuck at the top me 167 00:05:55,583 --> 00:05:57,119 This is why were using a marriage 168 00:05:57,375 --> 00:05:59,423 Container that kind of layout 169 00:05:59,679 --> 00:06:03,007 Option will not be available to us if we were not using 170 00:06:03,263 --> 00:06:03,775 Container 171 00:06:04,031 --> 00:06:06,335 So this is a container sizing 172 00:06:06,591 --> 00:06:07,103 Properly 173 00:06:07,615 --> 00:06:08,895 That can only be used 174 00:06:09,151 --> 00:06:09,919 When the news 175 00:06:10,175 --> 00:06:11,711 Parent is a type of 176 00:06:11,967 --> 00:06:14,271 Container and then what we're going to do a scroll down 177 00:06:14,527 --> 00:06:16,063 Sorry to go to the margin container 178 00:06:16,319 --> 00:06:17,855 And then scroll down back that 179 00:06:18,111 --> 00:06:20,159 Constant section of the theme override 180 00:06:20,671 --> 00:06:22,719 Put a margin top of lipsy 181 00:06:23,743 --> 00:06:25,791 So that gets the label off the top of the 182 00:06:26,047 --> 00:06:26,815 Just a little bit 183 00:06:27,071 --> 00:06:28,863 So before we go any further 184 00:06:29,375 --> 00:06:31,167 Let's go back to our main scene 185 00:06:31,679 --> 00:06:34,239 And instantiated a child's name by right clicking 186 00:06:34,495 --> 00:06:36,031 Clicking in st. Charles 187 00:06:36,543 --> 00:06:39,103 Search for Arena time you are 188 00:06:39,615 --> 00:06:40,383 Put that in there 189 00:06:40,639 --> 00:06:42,175 And then move this to be the first 190 00:06:43,199 --> 00:06:45,247 Sony editor you'll see that 191 00:06:45,503 --> 00:06:47,039 Is displayed right there 192 00:06:47,295 --> 00:06:49,087 But it's kind of off centre but watch this 193 00:06:49,599 --> 00:06:50,623 When we Run the game 194 00:06:50,879 --> 00:06:52,159 Now he's got that test 195 00:06:52,415 --> 00:06:53,951 Allude to the top of the score 196 00:06:54,463 --> 00:06:56,767 Are there is one thing to be careful of when you're using 197 00:06:57,023 --> 00:06:58,303 Containers in this way 198 00:06:58,559 --> 00:07:00,351 So let's go back to Arena time you 199 00:07:01,375 --> 00:07:02,143 Control note 200 00:07:02,399 --> 00:07:03,679 They will intercept 201 00:07:03,935 --> 00:07:04,447 Mouse 202 00:07:04,703 --> 00:07:05,215 Input 203 00:07:05,727 --> 00:07:07,519 So if we do this when we 204 00:07:07,775 --> 00:07:08,543 Put a mod 205 00:07:08,799 --> 00:07:10,335 Tina over the entirety of the screen 206 00:07:10,591 --> 00:07:13,151 No mouse input will be except 207 00:07:13,663 --> 00:07:15,199 While the mouse filter 208 00:07:15,455 --> 00:07:17,247 Is that to anything other than ignore 209 00:07:17,759 --> 00:07:19,039 Secure Martin container 210 00:07:19,295 --> 00:07:20,575 Scroll down to Mouse filter 211 00:07:20,831 --> 00:07:21,599 And turn off 212 00:07:22,111 --> 00:07:23,903 Filter by clicking ignore 213 00:07:24,159 --> 00:07:26,207 This means that it will no longer interested 214 00:07:26,463 --> 00:07:27,231 Mouse click 215 00:07:27,999 --> 00:07:31,071 I will get internet more later and we start building more complex your eyes 216 00:07:31,327 --> 00:07:32,607 Introduction to 217 00:07:32,863 --> 00:07:33,887 When does aquarium 218 00:07:34,143 --> 00:07:35,167 The canvas layer 219 00:07:35,679 --> 00:07:37,471 So the chemist layer as you probably 220 00:07:37,727 --> 00:07:38,239 Can see 221 00:07:38,495 --> 00:07:40,543 Is special in that eight keep 222 00:07:40,799 --> 00:07:41,823 The UA 223 00:07:42,335 --> 00:07:43,359 Glued to the 224 00:07:43,871 --> 00:07:44,383 So 225 00:07:44,639 --> 00:07:45,663 In other words 226 00:07:45,919 --> 00:07:50,015 It will always be at the top middle of the window regardless of 227 00:07:50,271 --> 00:07:51,551 The camera is in the game 228 00:07:52,063 --> 00:07:55,391 If we didn't have a chemist later and we just used a Martin container 229 00:07:55,647 --> 00:07:58,719 The magic container would be stuck at the origin of the world 230 00:07:58,975 --> 00:08:00,767 And will not follow our camera 231 00:08:01,023 --> 00:08:02,815 What's the benefit of using cannabis 232 00:08:03,327 --> 00:08:05,631 So what you do make this label actually display the 233 00:08:05,887 --> 00:08:06,911 The time that has 234 00:08:07,167 --> 00:08:07,679 Occurred 235 00:08:08,191 --> 00:08:09,215 While you're in 236 00:08:09,727 --> 00:08:10,239 The game 237 00:08:10,495 --> 00:08:15,103 So I'm going to do something to go to the arena time manager and we're going to add a script to r 238 00:08:15,615 --> 00:08:17,151 Manager creates 239 00:08:18,175 --> 00:08:19,455 The process map 240 00:08:19,967 --> 00:08:22,527 In awe when you've already metadata so go ahead and remove them 241 00:08:22,783 --> 00:08:23,807 What's create a new function 242 00:08:24,063 --> 00:08:24,831 Cardigan 243 00:08:25,343 --> 00:08:25,855 Time 244 00:08:26,111 --> 00:08:27,647 Get time 245 00:08:28,927 --> 00:08:30,975 Morgana doing here is we're going to return 246 00:08:31,231 --> 00:08:32,511 Dollar sign timer 247 00:08:33,279 --> 00:08:34,815 Say wait time 248 00:08:35,071 --> 00:08:35,839 - 249 00:08:36,351 --> 00:08:36,863 Timer 250 00:08:38,143 --> 00:08:39,679 Time underscore 251 00:08:40,191 --> 00:08:44,799 So far away time is 60 seconds and we have 60 seconds left then our time elapsed 252 00:08:45,055 --> 00:08:45,567 0 253 00:08:45,823 --> 00:08:48,895 And if we have a wait time of 60 seconds and red 254 00:08:49,151 --> 00:08:50,943 55 seconds left in our time 255 00:08:51,199 --> 00:08:51,711 That is 256 00:08:52,735 --> 00:08:56,319 Now in both cases here were getting the timer from the same 257 00:08:56,575 --> 00:08:58,367 And we don't necessarily want to do 258 00:08:58,623 --> 00:08:59,391 So what we can do 259 00:08:59,647 --> 00:09:01,439 Is we can use the unready keyword 260 00:09:01,695 --> 00:09:04,255 To assign the timer as soon as the notice 261 00:09:04,767 --> 00:09:06,303 So we can do as we can do at 262 00:09:06,815 --> 00:09:07,327 Henry 263 00:09:08,095 --> 00:09:09,887 Bar timer is equal to 264 00:09:10,399 --> 00:09:10,911 Timer 265 00:09:11,167 --> 00:09:12,959 So using a dollar sign petition 266 00:09:13,215 --> 00:09:16,543 What is the best thing to do is to shorthand for assigning 267 00:09:16,799 --> 00:09:17,567 A note 268 00:09:17,823 --> 00:09:19,103 To a variable 269 00:09:19,359 --> 00:09:21,151 When the note becomes red 270 00:09:21,663 --> 00:09:26,015 So now we have a reference to this timer if we don't need to fetch it from the same tree 271 00:09:26,527 --> 00:09:27,551 So you can highlight 272 00:09:27,807 --> 00:09:29,599 This dollar sign timer here 273 00:09:30,111 --> 00:09:31,135 And get time allowance 274 00:09:31,391 --> 00:09:32,415 Hit ctrl d 275 00:09:32,671 --> 00:09:33,695 To highlight 276 00:09:33,951 --> 00:09:34,463 Other 277 00:09:34,719 --> 00:09:36,255 Timer and then just right 278 00:09:36,511 --> 00:09:38,047 Our new variable in here instead 279 00:09:38,559 --> 00:09:40,863 Timer and that will replace both instances 280 00:09:41,119 --> 00:09:42,655 And now we don't have to do it a look 281 00:09:42,911 --> 00:09:43,679 In the tree 282 00:09:43,935 --> 00:09:44,447 Every time 283 00:09:44,703 --> 00:09:48,031 Let's go to our Arena time UI and switchback 284 00:09:48,287 --> 00:09:48,799 2 285 00:09:49,311 --> 00:09:49,823 The timo 286 00:09:50,079 --> 00:09:55,711 So this is our actual you white then we need to be able to get that time of laughs that we just 287 00:09:56,223 --> 00:10:00,460 So what I'm going to do if I'm going to attach a script to the route now here Arena time you out 288 00:10:00,461 --> 00:10:02,632 Subtitled by online-courses.club We compress knowledge for you! 289 00:10:02,634 --> 00:10:02,367 I keep those d v l 290 00:10:02,879 --> 00:10:03,903 What we going to do 291 00:10:04,159 --> 00:10:08,511 Is we are going to do an export variable so clear all the processing 292 00:10:08,767 --> 00:10:10,559 Ready methods that are pre-populated 293 00:10:11,071 --> 00:10:12,351 Let's do addicts 294 00:10:14,399 --> 00:10:15,167 Arena 295 00:10:15,423 --> 00:10:15,935 Time 296 00:10:16,191 --> 00:10:16,703 Manager 297 00:10:17,471 --> 00:10:19,263 And then we're going to do Colin and we're going to 298 00:10:20,031 --> 00:10:21,823 What we're going to do is going to take that as a no 299 00:10:22,079 --> 00:10:23,359 Now what is akinator 300 00:10:23,615 --> 00:10:25,663 Well I look at my Arena time UI 301 00:10:25,919 --> 00:10:26,943 I see that I have 302 00:10:27,199 --> 00:10:30,527 Is assign button now next to the arena time manager properly 303 00:10:30,783 --> 00:10:31,807 By clicking 304 00:10:32,063 --> 00:10:34,879 I can actually assign and note to this value here 305 00:10:35,135 --> 00:10:38,719 So that another way of referencing knows that may otherwise be 306 00:10:38,975 --> 00:10:41,535 Unknown in terms of where they are in the scene 307 00:10:42,303 --> 00:10:43,583 When is it going to be used for 308 00:10:43,839 --> 00:10:44,863 For the following 309 00:10:45,375 --> 00:10:47,423 If I go to my main scene again 310 00:10:47,679 --> 00:10:51,263 Switch to the 2D view I'm going to go ahead and right click 311 00:10:51,519 --> 00:10:52,543 Into main 312 00:10:52,799 --> 00:10:54,847 And then instantiated a child scene 313 00:10:55,103 --> 00:10:55,871 Arena 314 00:10:56,383 --> 00:10:57,407 Time manage 315 00:10:57,919 --> 00:10:58,687 I'm going to move 316 00:10:58,943 --> 00:11:00,735 Underneath the arena time you 317 00:11:01,247 --> 00:11:05,599 Now you can see if you click on the arena time you why I can take this Arena time manage 318 00:11:05,855 --> 00:11:06,879 Click and drag 319 00:11:07,391 --> 00:11:08,415 Over into 320 00:11:08,671 --> 00:11:09,183 That 321 00:11:09,695 --> 00:11:10,207 Assignment 322 00:11:10,463 --> 00:11:13,279 For the Aria time manager and now I've got a 323 00:11:14,047 --> 00:11:16,863 Now that we've got the arena time manager outside 324 00:11:17,119 --> 00:11:20,191 Let's go ahead and open up that Arena time you a script 325 00:11:20,703 --> 00:11:24,543 The Script button and now we can do this we can say 326 00:11:26,591 --> 00:11:27,103 Process 327 00:11:28,127 --> 00:11:31,455 Delta so we can overwrite the process method here 328 00:11:32,223 --> 00:11:35,039 And we can actually reference the arena time manager here 329 00:11:35,295 --> 00:11:37,343 And courgette time elapse 330 00:11:38,111 --> 00:11:44,255 Now we're not going to get the autocomplete because again go does not know what the type of this is it assumes that it's just a no 331 00:11:44,511 --> 00:11:49,119 Type so where does going to assume that we've done this correctly and we're not going to worry about that for now 332 00:11:49,375 --> 00:11:50,399 But we do want to do it 333 00:11:50,911 --> 00:11:52,959 So I'm going to say if Arena 334 00:11:53,215 --> 00:11:55,007 Time manager is equal to null 335 00:11:55,519 --> 00:11:56,799 I'm just going to return 336 00:11:57,055 --> 00:11:59,103 That way we're not going to deal with any pretence 337 00:11:59,359 --> 00:12:00,639 No reference 338 00:12:01,663 --> 00:12:06,015 So we can get an allowance letter signed the result of this get time elapsed to a 339 00:12:06,271 --> 00:12:08,831 Variables overtime underscore 340 00:12:09,343 --> 00:12:09,855 Alarm 341 00:12:11,135 --> 00:12:13,695 Alexa turn lights now I need to modify the tour 342 00:12:13,951 --> 00:12:14,463 Next 343 00:12:15,231 --> 00:12:18,303 Label celebs go back to the arena time you I see 344 00:12:18,815 --> 00:12:20,095 Does label 345 00:12:20,351 --> 00:12:20,863 Here 346 00:12:21,119 --> 00:12:22,399 We can right click this 347 00:12:22,655 --> 00:12:25,727 And we can say access as unique cname so go ahead and do that 348 00:12:26,239 --> 00:12:28,031 What does is this allowed 349 00:12:28,287 --> 00:12:30,847 To use a shorthand to reference the law 350 00:12:31,103 --> 00:12:32,639 Tell if we were to use 351 00:12:33,151 --> 00:12:35,199 What's a anon ready to grab the label 352 00:12:35,455 --> 00:12:37,759 What we typically have to do is do it 353 00:12:38,015 --> 00:12:38,783 Unread 354 00:12:40,575 --> 00:12:41,087 Label 355 00:12:41,599 --> 00:12:42,623 Is equal to 356 00:12:43,135 --> 00:12:44,415 Margin container 357 00:12:45,183 --> 00:12:45,951 Flashlight 358 00:12:46,463 --> 00:12:47,999 Which is an ideal 359 00:12:48,511 --> 00:12:51,071 This can get very long if you have a 360 00:12:51,327 --> 00:12:52,351 Biggar St 361 00:12:52,863 --> 00:12:59,007 But instead what we can do now is we can still use the dollar sign shorthand but instead of putting all the path segments in from 362 00:12:59,263 --> 00:13:01,567 The label we can just use a percent 363 00:13:02,079 --> 00:13:05,151 Cancel this wall as long as the label is marked as a unique 364 00:13:05,407 --> 00:13:06,175 Name 365 00:13:06,431 --> 00:13:07,199 In the 366 00:13:07,455 --> 00:13:08,735 Scene tree here 367 00:13:09,247 --> 00:13:10,015 We can 368 00:13:10,527 --> 00:13:11,807 Reference it with the process 369 00:13:12,063 --> 00:13:14,879 Any will always be found no matter how many levels deep 370 00:13:15,647 --> 00:13:18,719 I got a label and we can just simply say label 371 00:13:18,975 --> 00:13:19,743 Dart tag 372 00:13:21,023 --> 00:13:22,047 Is equal to 373 00:13:22,559 --> 00:13:23,583 Time alarm 374 00:13:24,351 --> 00:13:27,423 And we probably wanna convert to a string so we can do STR 375 00:13:27,935 --> 00:13:28,703 Time 376 00:13:29,983 --> 00:13:31,007 So that will 377 00:13:31,263 --> 00:13:34,335 The Our Time elapsed converted to a string and assign it to the level 378 00:13:34,591 --> 00:13:36,383 Had a Run the game as you have 379 00:13:36,895 --> 00:13:41,247 So it's got time counting up now what your notice is that it's printing an absurdly 380 00:13:41,503 --> 00:13:43,295 Large amount of 381 00:13:43,807 --> 00:13:46,367 Digits here we want us to be formatted Morley 382 00:13:46,623 --> 00:13:47,391 Traditional Thai 383 00:13:47,647 --> 00:13:48,671 What's go ahead and do that 384 00:13:49,183 --> 00:13:52,255 So let's go back to our Arena time UI script 385 00:13:52,767 --> 00:13:55,071 And we're going to create a new function sound 386 00:13:55,327 --> 00:13:56,095 Two new spaces 387 00:13:56,607 --> 00:13:57,119 Funk 388 00:13:57,375 --> 00:13:58,399 I'm gonna call this mess 389 00:13:58,655 --> 00:13:59,167 Former 390 00:13:59,423 --> 00:14:00,703 Underscore seconds 391 00:14:00,959 --> 00:14:02,495 And we're going to pass in 392 00:14:02,751 --> 00:14:04,543 A seconds number 393 00:14:04,799 --> 00:14:05,311 Second 394 00:14:05,567 --> 00:14:08,383 And if you want to you can type this by doing colon 395 00:14:08,895 --> 00:14:09,407 Float 396 00:14:09,663 --> 00:14:10,175 Just like 397 00:14:10,943 --> 00:14:12,479 Let's do another call at the end 398 00:14:13,247 --> 00:14:18,111 And this is going to return a string that actually make this little bit more 399 00:14:18,367 --> 00:14:21,183 Format underscore seconds underscore 2 400 00:14:21,439 --> 00:14:21,951 Clearscore 401 00:14:22,463 --> 00:14:22,975 String 402 00:14:24,255 --> 00:14:25,535 So we want to convey 403 00:14:26,047 --> 00:14:29,375 The second that we have to a minute and seconds 404 00:14:30,143 --> 00:14:31,167 And so how are we going to 405 00:14:31,679 --> 00:14:32,703 Well what we're going to do 406 00:14:32,959 --> 00:14:33,727 Is we're going to take 407 00:14:34,239 --> 00:14:36,799 The seconds and ÷ 62 408 00:14:37,311 --> 00:14:38,847 To save our minutes 409 00:14:39,103 --> 00:14:40,127 Is equal to 410 00:14:40,639 --> 00:14:41,151 Let's do the 411 00:14:41,663 --> 00:14:42,175 Floor 412 00:14:42,687 --> 00:14:44,735 Seconds ÷ 6 413 00:14:46,015 --> 00:14:49,599 So what is this going to do is this is going to take the second number ÷ 60 414 00:14:49,855 --> 00:14:53,951 If we're Western 60 seconds then the floor is going to go to zero 415 00:14:54,207 --> 00:14:55,999 Because it floors it to the new 416 00:14:56,255 --> 00:14:57,023 Integer 417 00:14:57,535 --> 00:14:58,047 Download 418 00:14:58,303 --> 00:14:58,815 Right 419 00:14:59,071 --> 00:15:00,351 Surrounded down essential 420 00:15:00,607 --> 00:15:03,935 The second is greater than or equal to 60 this overtime 421 00:15:04,191 --> 00:15:06,495 One or however many divisions 422 00:15:06,751 --> 00:15:09,055 So for instance of this was 120 L 423 00:15:09,823 --> 00:15:10,335 Ok 424 00:15:11,103 --> 00:15:14,175 Let's do another variable called remaining 425 00:15:14,943 --> 00:15:15,455 Seconds 426 00:15:16,223 --> 00:15:17,503 And what we're going to do is really say 427 00:15:17,759 --> 00:15:19,551 The remaining seconds is equal to 428 00:15:20,319 --> 00:15:21,087 Seconds 429 00:15:21,343 --> 00:15:22,111 Miners 430 00:15:23,647 --> 00:15:25,183 In parenthesis minutes 431 00:15:25,695 --> 00:15:26,719 X 432 00:15:27,487 --> 00:15:30,303 That's going to get us the remainder of the second 433 00:15:30,559 --> 00:15:32,863 And then we can return very simply 434 00:15:33,375 --> 00:15:34,143 Return 435 00:15:34,655 --> 00:15:36,191 STR minutes 436 00:15:38,751 --> 00:15:39,263 Plus 437 00:15:39,519 --> 00:15:40,799 In quotes Colin 438 00:15:41,055 --> 00:15:41,823 Plus 439 00:15:42,079 --> 00:15:42,591 String 440 00:15:43,359 --> 00:15:44,127 Remaining 441 00:15:45,663 --> 00:15:47,967 Now we're still going to have the issue of the 442 00:15:48,223 --> 00:15:50,271 Having massive amount of 443 00:15:50,783 --> 00:15:51,807 Decimal places 444 00:15:52,319 --> 00:15:53,343 And so we need to 445 00:15:53,599 --> 00:15:55,135 Take this remaining seconds 446 00:15:55,647 --> 00:15:57,439 And probably floor this as 447 00:15:57,951 --> 00:15:59,743 So let's inside of the string 448 00:16:00,255 --> 00:16:02,303 Do a floor of the remaining sex 449 00:16:02,815 --> 00:16:06,399 And then we can say up in our process label text is equal to 450 00:16:06,911 --> 00:16:08,703 Format seconds to string 451 00:16:08,959 --> 00:16:11,263 And then pass in our time 452 00:16:13,055 --> 00:16:14,591 What's going round the game and see her 453 00:16:15,359 --> 00:16:15,871 Perfect 454 00:16:16,127 --> 00:16:17,919 So there's still a little bit 455 00:16:18,175 --> 00:16:18,687 With this 456 00:16:18,943 --> 00:16:19,455 Formatting 457 00:16:19,711 --> 00:16:21,759 Princess we probably wanted display 458 00:16:22,015 --> 00:16:23,295 The leading 0 459 00:16:23,551 --> 00:16:25,343 When the number is less than 10 460 00:16:25,855 --> 00:16:28,415 How to get the leading zero on the second what we can do 461 00:16:28,927 --> 00:16:30,463 Is we can remove this 462 00:16:30,719 --> 00:16:31,487 String 463 00:16:31,743 --> 00:16:34,559 Function around that floor remaining seconds 464 00:16:35,071 --> 00:16:36,607 When we can do instead 465 00:16:37,119 --> 00:16:40,703 We want to use a format string would you can read about 466 00:16:40,959 --> 00:16:45,311 I will link to the documentation in the lesson resources that you can read about 467 00:16:45,823 --> 00:16:46,335 4 m 468 00:16:46,591 --> 00:16:49,151 But basically what we gonna do is string for me 469 00:16:49,407 --> 00:16:50,687 So I'm going to do a 470 00:16:51,199 --> 00:16:51,711 Quotes 471 00:16:51,967 --> 00:16:52,991 And then we're going to take 472 00:16:53,503 --> 00:16:54,271 Percent 473 00:16:54,527 --> 00:16:55,295 And I'm going to tell 474 00:16:55,807 --> 00:16:58,879 We want to do two leading Zeros so that's what that means 475 00:16:59,135 --> 00:16:59,903 02 476 00:17:00,159 --> 00:17:06,047 And Andy which tells us that it is an integer and then outside of the quotes we have to use percent 477 00:17:06,303 --> 00:17:07,327 Just like some 478 00:17:07,583 --> 00:17:08,607 And then we can 479 00:17:09,119 --> 00:17:11,167 This whole statement into 480 00:17:11,679 --> 00:17:12,191 Apprentice 481 00:17:12,959 --> 00:17:13,471 4 482 00:17:13,727 --> 00:17:14,495 Readability 483 00:17:16,031 --> 00:17:19,359 This is this as I want to have an integer string 484 00:17:19,615 --> 00:17:20,895 Has to dig 485 00:17:21,407 --> 00:17:23,455 And using a leading zero 486 00:17:23,711 --> 00:17:28,575 If the number is less than 10 so basically the same in force that there's two did 487 00:17:29,343 --> 00:17:31,647 It's also put leading zero in the front 488 00:17:31,903 --> 00:17:33,439 If the number is less than 10 489 00:17:33,695 --> 00:17:38,815 And then the present basically tells us ok what number are we putting into the store 490 00:17:39,327 --> 00:17:42,911 This percent indicates ok this is what were replacing into the Stream 491 00:17:43,167 --> 00:17:44,447 Which is our floor remaining 492 00:17:45,215 --> 00:17:47,775 If I run this now you can see that we've got a nice 493 00:17:48,031 --> 00:17:49,311 Countdown with a leading 494 00:17:49,567 --> 00:17:50,079 0 495 00:17:50,335 --> 00:17:54,175 So in the future will have to type this into the larger game systems 496 00:17:54,431 --> 00:17:56,479 But for now this little display 497 00:17:56,735 --> 00:17:57,247 Will 498 00:17:57,759 --> 00:18:00,063 Be good to build on in the future 32017

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.