All language subtitles for 21. Loop All Enemy Waves

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic Download
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
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

Original subtitles

1 1

[MUSIC] 2

2

In this video, we're gonna give ourselves a way to have our waves loop over, and 3

3

over, and over. 4

4

So even if you have only two ways, and I'm gonna change my to two here, 5

5

it just goes wave one, wave two, wave one, wave two, over, and over, and over so 6

6

that our game can loop. 7

7

So we'll hop over into EnemeySpawner.cs, create ourselves a variable. 8

8

So we'll serialize this, so it's available in the inspector. 9

9

We're making a bool, so it's either gonna be either true or it's gonna be false and 10

10

we'll call it looping. 11

11

So I have a bool called looping, which we will initialize as false. 12

12

So bool looping = false;. 13

13

And then within our start method here's something really cool. 14

14

We're we can say we can change the type of return value for our start method. 15

15

So that when the engine calls start, it is doing something a little bit different, 16

16

we can change it to an IEnumerator, 17

17

so that we make our start a code routine, which is really nifty. 18

18

And then within our StartCoroutine, 19

19

just gonna put my curly braces down a line here. 20

20

So within our StartCoroutine we can create a do while loop, 21

21

which basically means it goes over and over and over at do while. 22

22

And we'll make it while looping is true. 23

23

So we'll give ourselves a little bit of room here and start by typing do. 24

24

And then give ourselves a code block in here of curly braces. 25

25

We're going to change our stock StockCoroutines inot our yield conditions. 26

26

So yield return StartCoroutine SpawnAllWaves. 27

27

So this now becomes the yield condition. 28

28

Once we get into the do while loop, we're saying do a thing, go, go, go, go, go. 29

29

And then, once it's finished doing all this, 30

30

the yield will then return back within our start method. 31

31

And we can say, close our, curly braces here, so we've got our yield condition. 32

32

And then we can say, While (looping). 33

33

And this is another way of saying While (looping) equals true. 34

34

We can say while, and then in brackets, looping. 35

35

So what we're doing here is saying when the engine call start, do this thing, 36

36

start the co-routines. 37

37

This is a series co-routine. 38

38

And we are gonna yield. 39

39

So come back to start and 40

40

continue with whatever is after this statement once this has completed. 41

41

So once this completed, we come back here. 42

42

We see the while. 43

43

If looping is true, then it jumps back up to the do and 44

44

it starts this all over again. 45

45

And because it started as part of the yield, then it waits until it's finished, 46

46

then it comes back to the while. 47

47

So this is a really neat loop and 48

48

a really neat way of saying we can do this particular thing here, this SpawnAllWaves, 49

49

we can do it over, and over, and over, so we can loop it in there. 50

50

So we'll save this up and hop over into Unity, check that it all worked. 51

51

The first thing we need to do is click On for Looping. 52

52

So let's check it without looping on, and make sure it's working as we're expecting. 53

53

You might wanna stop at the end of a number of waves, and 54

54

then the player can go on to another level, so you don't want it to loop. 55

55

Okay, that's it without looping. 56

56

We'll click Looping On, click on Play, and 57

57

we should see these waves looped over and over. 58

58

Okay, once, twice, okay, so you can see, they just keep getting spawned, 59

59

and spawned, and spawned. 60

60

And so you can imagine, this is a game, if we're spawning all these waves, and 61

61

the game is just going on and on, 62

62

you don't have to have to have created 300 different waves. 63

63

You can create a certain number 10 or 20 or 30 and the game will go on and 64

64

on forever. 65

65

And if you make your enemies engaging, if you make your waves interesting and 66

66

all that kind of good stuff then the player is gonna feel like this is 67

67

a pretty awesome game to play for a bunch of time. 68

68

Okay, so it's just a quick lecture on the do while loop and 69

69

how we have used that within our co-routine and how we have changed our 70

70

Start method to be an IEnumerator so that we can use it as a co-routine. 71

71

Great work, well done, I'm sure you're game is shaping up really nicely. 72

72

I look forward you seeing your sharing in the community. 73

73

If you've got something neat that you're enjoying with your waves, 74

74

then please do share it with us, and I'll see you in the next lecture.

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