1 00:00:00,000 --> 00:00:08,469 foreign 2 00:00:00,500 --> 00:00:08,469 [Music] 3 00:00:11,040 --> 00:00:14,940 and welcome to the last session of the 4 00:00:13,799 --> 00:00:17,699 day 5 00:00:14,940 --> 00:00:20,340 Don't Wait For Godot build a game today 6 00:00:17,699 --> 00:00:22,320 with Paris buttfield Addison 7 00:00:20,340 --> 00:00:24,300 Dr Paris Butterfield Edison is 8 00:00:22,320 --> 00:00:26,100 co-founder of secret lab a game 9 00:00:24,300 --> 00:00:29,039 development Studio based in Hobart 10 00:00:26,100 --> 00:00:31,619 Tasmania Australia I like how that's on 11 00:00:29,039 --> 00:00:33,480 there in this talk Paris will teach the 12 00:00:31,619 --> 00:00:35,820 fundamentals of the completely free open 13 00:00:33,480 --> 00:00:38,100 source game engine Godot 14 00:00:35,820 --> 00:00:39,719 it's powerful amazing runs on everything 15 00:00:38,100 --> 00:00:42,500 and there's never been a better time to 16 00:00:39,719 --> 00:00:47,040 learn please welcome Paris 17 00:00:42,500 --> 00:00:49,140 [Applause] 18 00:00:47,040 --> 00:00:50,340 oh yeah I have a PhD in Computing that 19 00:00:49,140 --> 00:00:52,980 I've miserably failed to use for 20 00:00:50,340 --> 00:00:55,079 anything useful so that's not important 21 00:00:52,980 --> 00:00:56,820 for this talk hi I'm Paris I run a 22 00:00:55,079 --> 00:00:58,260 studio called secret lab where we best 23 00:00:56,820 --> 00:01:00,120 known for a game called not in the woods 24 00:00:58,260 --> 00:01:02,039 which attracted a lot of fans a few 25 00:01:00,120 --> 00:01:03,600 years ago but we also build lots of 26 00:01:02,039 --> 00:01:06,960 narrative video games lots of video game 27 00:01:03,600 --> 00:01:08,220 tools all sorts of things and I am here 28 00:01:06,960 --> 00:01:09,540 today to talk about a game engine which 29 00:01:08,220 --> 00:01:10,799 we're increasingly starting to look at 30 00:01:09,540 --> 00:01:13,680 and increasingly starting to use called 31 00:01:10,799 --> 00:01:15,240 Godot Gadot depending on how you 32 00:01:13,680 --> 00:01:17,040 pronounce it uh it's obviously named 33 00:01:15,240 --> 00:01:18,780 after the play which I saw Sir Patrick 34 00:01:17,040 --> 00:01:20,280 Stewart in a few years ago he pronounced 35 00:01:18,780 --> 00:01:23,220 Godot so I'm going to go with Godot 36 00:01:20,280 --> 00:01:25,320 because Patrick Stewart reasonable okay 37 00:01:23,220 --> 00:01:26,640 so this is my company secret lab has 38 00:01:25,320 --> 00:01:27,479 absolutely nothing to do with the talk I 39 00:01:26,640 --> 00:01:29,640 just want to show you the pretty 40 00:01:27,479 --> 00:01:30,479 pictures we made this is the got our 41 00:01:29,640 --> 00:01:32,040 website 42 00:01:30,479 --> 00:01:33,479 I'm gonna I have no slides by the way 43 00:01:32,040 --> 00:01:35,640 I'm just gonna do things and hopefully 44 00:01:33,479 --> 00:01:36,960 it'll work so I have a copy of 45 00:01:35,640 --> 00:01:38,759 everything that works if everything 46 00:01:36,960 --> 00:01:40,200 miserably falls apart and I'll be 47 00:01:38,759 --> 00:01:41,700 copying pasting some code if I give up 48 00:01:40,200 --> 00:01:44,040 typing but other than that we'll see how 49 00:01:41,700 --> 00:01:45,180 it goes so I put this website up just 50 00:01:44,040 --> 00:01:46,259 because the starting point for 51 00:01:45,180 --> 00:01:47,340 everything I'm about to do this is not a 52 00:01:46,259 --> 00:01:49,500 tutorial please don't try and follow 53 00:01:47,340 --> 00:01:52,079 along you'll melt um 54 00:01:49,500 --> 00:01:52,979 all I did was I downloaded good o4 I say 55 00:01:52,079 --> 00:01:54,240 there's never been a better time to 56 00:01:52,979 --> 00:01:55,619 learn I said that a few months ago when 57 00:01:54,240 --> 00:01:57,360 I submitted this talk it was true then 58 00:01:55,619 --> 00:01:58,979 but it's truer now because godo4 just 59 00:01:57,360 --> 00:02:00,420 came out 60 00:01:58,979 --> 00:02:01,560 very true I have to rewrite the whole 61 00:02:00,420 --> 00:02:04,140 talk around and go to four but that's 62 00:02:01,560 --> 00:02:06,540 fine today I'm using the.net version of 63 00:02:04,140 --> 00:02:08,340 golo okay for a very specific reason 64 00:02:06,540 --> 00:02:09,179 that's because most game developers in 65 00:02:08,340 --> 00:02:10,920 the world 66 00:02:09,179 --> 00:02:12,420 who use Unity will have been very 67 00:02:10,920 --> 00:02:13,620 familiar with C sharp and unity is a 68 00:02:12,420 --> 00:02:15,360 very big popular game engine I think 69 00:02:13,620 --> 00:02:16,500 Gullo supporting c-sharp is a really 70 00:02:15,360 --> 00:02:17,879 good way to bring people over from the 71 00:02:16,500 --> 00:02:20,099 big proprietary engine 72 00:02:17,879 --> 00:02:21,540 so I've been learning I know C sharp 73 00:02:20,099 --> 00:02:22,980 very well from Unity I've been learning 74 00:02:21,540 --> 00:02:25,080 C sharp forgotto over the last two 75 00:02:22,980 --> 00:02:26,400 months getting better at it and I 76 00:02:25,080 --> 00:02:28,080 decided to have a crack at doing it in C 77 00:02:26,400 --> 00:02:29,220 sharp this time normally I would teach 78 00:02:28,080 --> 00:02:30,060 GD script which is the other program 79 00:02:29,220 --> 00:02:31,500 language 80 00:02:30,060 --> 00:02:33,060 but everything I'm about to teach you is 81 00:02:31,500 --> 00:02:34,739 translatable although they're using godo 82 00:02:33,060 --> 00:02:36,180 bits are the same so 83 00:02:34,739 --> 00:02:37,860 all I did to get started here was I 84 00:02:36,180 --> 00:02:39,060 downloaded godo film on my Mac there's 85 00:02:37,860 --> 00:02:41,879 not damn version and then I went and 86 00:02:39,060 --> 00:02:43,440 downloaded the.net SDK from Microsoft 87 00:02:41,879 --> 00:02:45,180 good old technically supports the mono 88 00:02:43,440 --> 00:02:47,760 SDK but I think that's not officially 89 00:02:45,180 --> 00:02:49,620 deprecated but basically deprecated now 90 00:02:47,760 --> 00:02:51,360 I downloaded.net6 I think it supports 91 00:02:49,620 --> 00:02:52,680 both 92 00:02:51,360 --> 00:02:53,640 uh with that other way I thought I'd 93 00:02:52,680 --> 00:02:54,540 just quickly show you this is what GD 94 00:02:53,640 --> 00:02:55,860 script looks like it's kind of like 95 00:02:54,540 --> 00:02:57,780 python but it's an internal programming 96 00:02:55,860 --> 00:02:59,160 language that goto made it's great it's 97 00:02:57,780 --> 00:03:00,660 really cool if you're happy to never 98 00:02:59,160 --> 00:03:02,040 touch these sharp using go through this 99 00:03:00,660 --> 00:03:03,360 is perfectly fantastic 100 00:03:02,040 --> 00:03:05,220 possibly better because it's tightly 101 00:03:03,360 --> 00:03:06,720 integrated with the editor 102 00:03:05,220 --> 00:03:07,739 with that I'm going to go to godo and 103 00:03:06,720 --> 00:03:09,840 now we're going to make a project live 104 00:03:07,739 --> 00:03:11,180 hopefully and not mess it up so I'm 105 00:03:09,840 --> 00:03:13,739 going to talk you through how it works 106 00:03:11,180 --> 00:03:14,760 uh God is very lightweight so Unity is 107 00:03:13,739 --> 00:03:16,319 this thing that consumes multiple 108 00:03:14,760 --> 00:03:17,819 gigabytes of your RAM and takes forever 109 00:03:16,319 --> 00:03:19,080 to download God is like 100 megabytes 110 00:03:17,819 --> 00:03:21,000 and just runs 111 00:03:19,080 --> 00:03:22,500 doesn't contact any sort of Licensing 112 00:03:21,000 --> 00:03:24,480 Service it's absolutely fantastic it's a 113 00:03:22,500 --> 00:03:26,280 breath of fresh air so I'm going to make 114 00:03:24,480 --> 00:03:29,340 a new project here I'm going to call it 115 00:03:26,280 --> 00:03:31,019 uh live platformer 116 00:03:29,340 --> 00:03:33,900 and I'm going to put it on my work drive 117 00:03:31,019 --> 00:03:36,659 so we're just going to go volumes 118 00:03:33,900 --> 00:03:37,860 work and then we're going to go here and 119 00:03:36,659 --> 00:03:39,120 select this folder and we're going to go 120 00:03:37,860 --> 00:03:40,920 create folder 121 00:03:39,120 --> 00:03:42,480 so that's my little platformer folder 122 00:03:40,920 --> 00:03:43,860 I'm going to leave it on the renderer we 123 00:03:42,480 --> 00:03:45,420 don't care about that right now and then 124 00:03:43,860 --> 00:03:47,159 we're creating it 125 00:03:45,420 --> 00:03:48,720 and because God I was written in God oh 126 00:03:47,159 --> 00:03:50,220 it's going to relaunch itself it's 127 00:03:48,720 --> 00:03:51,720 slightly quirky 128 00:03:50,220 --> 00:03:53,760 and we end up with this 129 00:03:51,720 --> 00:03:56,040 so everything in gato is a scene 130 00:03:53,760 --> 00:03:57,659 gotta works with scene files scenes are 131 00:03:56,040 --> 00:03:59,459 an area of your game where you've put 132 00:03:57,659 --> 00:04:00,720 something scene files also get stalled 133 00:03:59,459 --> 00:04:02,340 on disk which I'll show you in a minute 134 00:04:00,720 --> 00:04:04,739 but basically scene files are a thing 135 00:04:02,340 --> 00:04:06,840 which you work with and put stuff in 136 00:04:04,739 --> 00:04:08,640 the contents of scenes are called nodes 137 00:04:06,840 --> 00:04:10,500 so everything in a godo scene is just a 138 00:04:08,640 --> 00:04:12,720 node tree it's just a tree of stuff in 139 00:04:10,500 --> 00:04:14,159 an all called node stage in a scene 140 00:04:12,720 --> 00:04:15,599 other scenes can be embedded within 141 00:04:14,159 --> 00:04:17,220 scenes in gallo and you'll see how that 142 00:04:15,599 --> 00:04:18,239 works as we go through but basically 143 00:04:17,220 --> 00:04:19,979 everything you've got always a scene 144 00:04:18,239 --> 00:04:21,299 with a note in it and multiple nodes and 145 00:04:19,979 --> 00:04:23,100 nodes have nodes under them and so on 146 00:04:21,299 --> 00:04:23,820 and so on so we're going to make a 147 00:04:23,100 --> 00:04:25,020 little game we're gonna make a little 148 00:04:23,820 --> 00:04:27,360 platform game like a traditional little 149 00:04:25,020 --> 00:04:28,919 runny jumpy platform game as quickly as 150 00:04:27,360 --> 00:04:30,240 we can 151 00:04:28,919 --> 00:04:32,040 one thing I'm going to do that I forgot 152 00:04:30,240 --> 00:04:33,720 to do is I'm going to go here and go 153 00:04:32,040 --> 00:04:34,620 this folder that I've got here full of 154 00:04:33,720 --> 00:04:36,180 assets 155 00:04:34,620 --> 00:04:37,320 and I'm going to copy it into the folder 156 00:04:36,180 --> 00:04:38,940 I just made 157 00:04:37,320 --> 00:04:40,440 so what I call it I call it live 158 00:04:38,940 --> 00:04:42,000 platformer 159 00:04:40,440 --> 00:04:43,139 I'm going to drag this assets folder in 160 00:04:42,000 --> 00:04:44,699 and these notes in which I'll show you 161 00:04:43,139 --> 00:04:46,320 later and because I put a folder full of 162 00:04:44,699 --> 00:04:48,120 Assets in these assets are just a bunch 163 00:04:46,320 --> 00:04:49,320 of Sprites as pngs which I'll get to in 164 00:04:48,120 --> 00:04:51,060 a minute 165 00:04:49,320 --> 00:04:52,139 because I put a platform folder in gold 166 00:04:51,060 --> 00:04:53,880 is going to figure it out and put it in 167 00:04:52,139 --> 00:04:55,380 the sidebar over here so it knows we've 168 00:04:53,880 --> 00:04:57,180 got some assets 169 00:04:55,380 --> 00:04:58,259 okay so with that in mind I'm going to 170 00:04:57,180 --> 00:04:59,400 start so the first thing I'm going to do 171 00:04:58,259 --> 00:05:01,680 is I'm going to make a player something 172 00:04:59,400 --> 00:05:03,419 to run around in our little scene 173 00:05:01,680 --> 00:05:04,620 to do that I'm going to go over here and 174 00:05:03,419 --> 00:05:05,880 where it says create root node it's 175 00:05:04,620 --> 00:05:07,620 going to ask me what kind of node I want 176 00:05:05,880 --> 00:05:09,419 to be the root of this new empty scene 177 00:05:07,620 --> 00:05:10,199 it's given me and because we want to 178 00:05:09,419 --> 00:05:10,979 play out we're going to create a 179 00:05:10,199 --> 00:05:12,000 different kind of node we're going to 180 00:05:10,979 --> 00:05:13,560 actually click other node and then got 181 00:05:12,000 --> 00:05:14,759 it gives you this list of stuff where 182 00:05:13,560 --> 00:05:16,020 you can pick from what kind of node you 183 00:05:14,759 --> 00:05:18,300 want and we're going to get a character 184 00:05:16,020 --> 00:05:19,440 body so you can filter at the top can 185 00:05:18,300 --> 00:05:20,520 everyone see that okay is it visible 186 00:05:19,440 --> 00:05:22,139 yeah cool 187 00:05:20,520 --> 00:05:23,340 basically you you learn to kind of do it 188 00:05:22,139 --> 00:05:24,720 very fast and just type the kind of node 189 00:05:23,340 --> 00:05:26,039 you want and it eventually gets there 190 00:05:24,720 --> 00:05:27,479 but I'm going to do it slightly so I 191 00:05:26,039 --> 00:05:29,340 want a character body 3D which is a 192 00:05:27,479 --> 00:05:31,560 specialized kind of node that can be 193 00:05:29,340 --> 00:05:33,000 moved around with script so because God 194 00:05:31,560 --> 00:05:36,419 has a full physics engine like most game 195 00:05:33,000 --> 00:05:37,560 engines these days it mostly defaults to 196 00:05:36,419 --> 00:05:38,639 letting you move things with physics so 197 00:05:37,560 --> 00:05:40,440 like if you give something tell it to 198 00:05:38,639 --> 00:05:41,400 fall it falls we don't really want that 199 00:05:40,440 --> 00:05:42,539 to happen with the player character 200 00:05:41,400 --> 00:05:43,560 because we want to manually be able to 201 00:05:42,539 --> 00:05:46,320 move it around the environment so 202 00:05:43,560 --> 00:05:48,539 character body 3D 2D is a that kind of 203 00:05:46,320 --> 00:05:51,560 object if you play with other games this 204 00:05:48,539 --> 00:05:51,560 might be called a kinematic body 205 00:05:51,600 --> 00:05:55,320 so we now have this scene over here 206 00:05:53,820 --> 00:05:57,060 which has at its root a single node 207 00:05:55,320 --> 00:05:58,259 called character body 3D 208 00:05:57,060 --> 00:06:00,840 I'm going to click that and push return 209 00:05:58,259 --> 00:06:02,520 or enter and rename it to player 210 00:06:00,840 --> 00:06:03,419 very straightforward 211 00:06:02,520 --> 00:06:04,860 and then I'm going to add some other 212 00:06:03,419 --> 00:06:06,000 nodes below it so to add other nodes 213 00:06:04,860 --> 00:06:07,440 below it I can either right click on it 214 00:06:06,000 --> 00:06:08,400 and go add child mode or I can just 215 00:06:07,440 --> 00:06:09,660 click the plus button while it's 216 00:06:08,400 --> 00:06:11,100 highlighted 217 00:06:09,660 --> 00:06:12,479 okay 218 00:06:11,100 --> 00:06:14,580 first note I'm going to add is an 219 00:06:12,479 --> 00:06:17,100 animated 220 00:06:14,580 --> 00:06:19,139 Sprite 2D 221 00:06:17,100 --> 00:06:20,639 this is a Sprite that can be animated 222 00:06:19,139 --> 00:06:24,620 basically 223 00:06:20,639 --> 00:06:24,620 uh I'm going to name its player Sprite 224 00:06:25,080 --> 00:06:30,539 so here we have a tiny Tree in this node 225 00:06:28,740 --> 00:06:33,120 and I've lost my mouse 226 00:06:30,539 --> 00:06:36,319 which is very exciting 227 00:06:33,120 --> 00:06:36,319 I wonder where my mouse is gone 228 00:06:39,240 --> 00:06:41,819 yeah it has I'm just going to disconnect 229 00:06:40,620 --> 00:06:43,080 that and reconnect it is that going to 230 00:06:41,819 --> 00:06:45,240 cause a problem for you recording let's 231 00:06:43,080 --> 00:06:48,680 do that 232 00:06:45,240 --> 00:06:48,680 yep that's unfrozen okay 233 00:06:49,440 --> 00:06:55,500 computers eh 234 00:06:52,380 --> 00:06:58,740 and now reconnected it I see nothing 235 00:06:55,500 --> 00:07:00,240 there we go okay you're back okay cool 236 00:06:58,740 --> 00:07:01,440 no idea what happened my mouse just 237 00:07:00,240 --> 00:07:04,819 stopped working which is always very 238 00:07:01,440 --> 00:07:06,539 exciting anyway player Sprite has a 239 00:07:04,819 --> 00:07:08,220 animated so what I'm going to do is I'm 240 00:07:06,539 --> 00:07:09,300 going to select this player Sprite node 241 00:07:08,220 --> 00:07:10,979 on the left here and then go over to the 242 00:07:09,300 --> 00:07:12,060 inspector on the right which shows you 243 00:07:10,979 --> 00:07:13,380 the properties of the thing you've 244 00:07:12,060 --> 00:07:14,580 currently got selected 245 00:07:13,380 --> 00:07:15,660 and the thing we want to change is the 246 00:07:14,580 --> 00:07:16,919 animation so we want to expand that 247 00:07:15,660 --> 00:07:18,900 animation and then it's got Sprite 248 00:07:16,919 --> 00:07:20,460 frames empty so this is where you place 249 00:07:18,900 --> 00:07:21,660 an asset so if you had an animated set 250 00:07:20,460 --> 00:07:22,680 of sprite frames you could drag that in 251 00:07:21,660 --> 00:07:23,880 there we don't have that yet we're going 252 00:07:22,680 --> 00:07:25,259 to make it so we're going to click new 253 00:07:23,880 --> 00:07:26,639 Sprite frames 254 00:07:25,259 --> 00:07:27,900 and we're going to click that asset and 255 00:07:26,639 --> 00:07:29,699 down the bottom we get this little 256 00:07:27,900 --> 00:07:31,020 inspector thing where you can fiddle 257 00:07:29,699 --> 00:07:34,560 with what the actual animation looks 258 00:07:31,020 --> 00:07:36,539 like so I am going to add an animation 259 00:07:34,560 --> 00:07:38,520 here I want to have an idle player 260 00:07:36,539 --> 00:07:39,720 animation so those assets I dragged in 261 00:07:38,520 --> 00:07:42,060 earlier include a bunch of animations 262 00:07:39,720 --> 00:07:43,680 for moving and idling and so on one of 263 00:07:42,060 --> 00:07:45,960 them is a nice little sprite where the 264 00:07:43,680 --> 00:07:48,539 play just sits there 265 00:07:45,960 --> 00:07:50,039 so you'll see here we have idle so 266 00:07:48,539 --> 00:07:51,419 you'll see here we've got 267 00:07:50,039 --> 00:07:54,660 the Sprites that make up an idle 268 00:07:51,419 --> 00:07:56,340 animation there's just one file 269 00:07:54,660 --> 00:07:58,380 standard animation thing 270 00:07:56,340 --> 00:08:00,720 so there's one two three four five six 271 00:07:58,380 --> 00:08:01,740 seven eight nine ten eleven 272 00:08:00,720 --> 00:08:04,800 so what we're going to do is we're going 273 00:08:01,740 --> 00:08:06,780 to say up here horizontally we go 11 and 274 00:08:04,800 --> 00:08:09,240 1. 275 00:08:06,780 --> 00:08:11,220 1 and you'll see it's put lines between 276 00:08:09,240 --> 00:08:12,780 them at the right I just told it and 277 00:08:11,220 --> 00:08:14,759 then I can select them all 278 00:08:12,780 --> 00:08:15,900 and add them as frames to the project so 279 00:08:14,759 --> 00:08:17,039 now we have this little animation I 280 00:08:15,900 --> 00:08:18,720 happen to know this is a 20 FPS 281 00:08:17,039 --> 00:08:19,919 animation because 282 00:08:18,720 --> 00:08:21,000 I've been playing with it for a while 283 00:08:19,919 --> 00:08:22,800 but you might need to fiddle with that 284 00:08:21,000 --> 00:08:24,240 if you didn't make the animations we're 285 00:08:22,800 --> 00:08:25,860 going to rename that animation to idle 286 00:08:24,240 --> 00:08:26,940 in the bottom there and we're going to 287 00:08:25,860 --> 00:08:28,379 click this little button here which says 288 00:08:26,940 --> 00:08:29,639 it plays automatically 289 00:08:28,379 --> 00:08:32,960 and now my mouse has stopped working 290 00:08:29,639 --> 00:08:32,960 again which is very exciting 291 00:08:33,959 --> 00:08:36,419 what's going on I'm going to move my 292 00:08:34,979 --> 00:08:39,000 computer over here 293 00:08:36,419 --> 00:08:41,279 so hopefully stop leaning on it 294 00:08:39,000 --> 00:08:44,419 then try it 295 00:08:41,279 --> 00:08:44,419 again yeah it's just one 296 00:08:44,760 --> 00:08:48,380 you did not do this earlier when I 297 00:08:46,080 --> 00:08:48,380 tested 298 00:08:51,500 --> 00:08:55,040 this is not good 299 00:08:55,140 --> 00:08:58,560 let's try again 300 00:08:56,880 --> 00:09:02,779 it starts working the second the thing's 301 00:08:58,560 --> 00:09:02,779 not plugged in we shall see we shall see 302 00:09:04,800 --> 00:09:08,459 okay so we're back 303 00:09:06,839 --> 00:09:10,019 for now 304 00:09:08,459 --> 00:09:12,120 we've got this idle animation here with 305 00:09:10,019 --> 00:09:13,320 the 20fps set we're going to click this 306 00:09:12,120 --> 00:09:15,120 little button which says please run it 307 00:09:13,320 --> 00:09:16,140 all the time there's this button here 308 00:09:15,120 --> 00:09:17,760 and then we're going to click the place 309 00:09:16,140 --> 00:09:19,019 right up here and then push F which is 310 00:09:17,760 --> 00:09:20,519 going to focus it on the editor and then 311 00:09:19,019 --> 00:09:21,959 we're going to zoom in 312 00:09:20,519 --> 00:09:23,339 and we can see this little player Sprite 313 00:09:21,959 --> 00:09:25,140 and then we click play 314 00:09:23,339 --> 00:09:26,459 and it works so you might notice if you 315 00:09:25,140 --> 00:09:27,779 play Pixel platformer games it just 316 00:09:26,459 --> 00:09:29,700 doesn't look particularly good it's not 317 00:09:27,779 --> 00:09:30,899 like Pixel Perfect to fix that we're 318 00:09:29,700 --> 00:09:31,980 going to go to the project settings up 319 00:09:30,899 --> 00:09:35,180 here 320 00:09:31,980 --> 00:09:37,320 and set the renderer to 321 00:09:35,180 --> 00:09:38,760 nearest on the texture filtering just so 322 00:09:37,320 --> 00:09:39,839 it doesn't try and do any sort of fancy 323 00:09:38,760 --> 00:09:41,580 filtering and then it'll look nice and 324 00:09:39,839 --> 00:09:42,899 Pixel Perfect so if you're doing a pixel 325 00:09:41,580 --> 00:09:44,399 art or a 2d game you might want to do 326 00:09:42,899 --> 00:09:45,540 that sort of thing how do I try to 327 00:09:44,399 --> 00:09:47,519 explain what that means come and find me 328 00:09:45,540 --> 00:09:49,019 later if you want to talk about it 329 00:09:47,519 --> 00:09:50,339 basically you need to do that for kind 330 00:09:49,019 --> 00:09:52,500 of Pixel Perfect rendering anyway we 331 00:09:50,339 --> 00:09:53,519 have this one single Sprite with a idle 332 00:09:52,500 --> 00:09:55,980 animation 333 00:09:53,519 --> 00:09:57,779 uh that's all we need to do right now 334 00:09:55,980 --> 00:09:58,860 next thing we're going to do is we're 335 00:09:57,779 --> 00:10:00,480 going to save that scene so I'm going to 336 00:09:58,860 --> 00:10:01,920 push command s or control s on Windows 337 00:10:00,480 --> 00:10:03,060 and it's going to ask me for a name it's 338 00:10:01,920 --> 00:10:04,740 going to call it player so I'm just 339 00:10:03,060 --> 00:10:06,540 going to say that as player now that 340 00:10:04,740 --> 00:10:07,800 scene file with the node structure that 341 00:10:06,540 --> 00:10:09,300 we've just made is saved out as a file 342 00:10:07,800 --> 00:10:10,560 on disk 343 00:10:09,300 --> 00:10:13,260 so I'm going to make another scene up 344 00:10:10,560 --> 00:10:15,000 here with the scene menu new scene 345 00:10:13,260 --> 00:10:16,500 I'm going to use the 2D scene root node 346 00:10:15,000 --> 00:10:19,580 that God offers me 347 00:10:16,500 --> 00:10:19,580 and I'm going to rename it level 348 00:10:19,860 --> 00:10:22,440 this is going to be our level so we're 349 00:10:21,300 --> 00:10:24,480 going to make a traditional platform 350 00:10:22,440 --> 00:10:25,500 environment for our player to live in 351 00:10:24,480 --> 00:10:27,240 to do that we're going to use something 352 00:10:25,500 --> 00:10:29,100 called a tile map a tile map is a way of 353 00:10:27,240 --> 00:10:30,660 bringing in a whole bunch of Sprites in 354 00:10:29,100 --> 00:10:32,519 one nicely compressed and neat little 355 00:10:30,660 --> 00:10:34,920 PNG and then picking which bits mean 356 00:10:32,519 --> 00:10:36,779 what and using that to layer level 357 00:10:34,920 --> 00:10:37,560 God has fantastic turbo support so what 358 00:10:36,779 --> 00:10:38,940 I'm going to do is I'm going to add a 359 00:10:37,560 --> 00:10:41,399 child node 360 00:10:38,940 --> 00:10:43,500 the mouse has stopped working yet again 361 00:10:41,399 --> 00:10:45,420 does anyone have a USBC to HDMI adapter 362 00:10:43,500 --> 00:10:47,579 by any chance that's probably what's 363 00:10:45,420 --> 00:10:52,399 causing this problem I would imagine 364 00:10:47,579 --> 00:10:52,399 yeah only one port only one port 365 00:10:53,339 --> 00:10:56,839 this is very frustrating 366 00:11:02,100 --> 00:11:05,459 it's the cold keyboard for the whole 367 00:11:03,720 --> 00:11:06,600 computer phrases not just the mouse 368 00:11:05,459 --> 00:11:08,040 anyway 369 00:11:06,600 --> 00:11:09,600 I'll keep going while we fiddle and then 370 00:11:08,040 --> 00:11:10,740 we can see we can fix it luckily I'm not 371 00:11:09,600 --> 00:11:12,360 doing any sort of fancy things with the 372 00:11:10,740 --> 00:11:15,680 screen so I have a level Sprite I'm 373 00:11:12,360 --> 00:11:15,680 going to add a tile map node 374 00:11:16,740 --> 00:11:21,779 okay so I've added a tile map node I'm 375 00:11:19,380 --> 00:11:24,000 very sorry this is very frustrating 376 00:11:21,779 --> 00:11:26,399 oh let's try this one how exciting thank 377 00:11:24,000 --> 00:11:28,500 you please forgive me thank you 378 00:11:26,399 --> 00:11:31,500 appreciate you 379 00:11:28,500 --> 00:11:34,220 yeah yeah we'll see 380 00:11:31,500 --> 00:11:34,220 let's try that 381 00:11:36,000 --> 00:11:40,980 love I love computers 382 00:11:39,360 --> 00:11:42,600 don't we all 383 00:11:40,980 --> 00:11:44,640 okay 384 00:11:42,600 --> 00:11:46,880 I've added a tile map node a tile map is 385 00:11:44,640 --> 00:11:49,740 basically a fancy version of 386 00:11:46,880 --> 00:11:52,140 a a Sprite an animated Sprite like I was 387 00:11:49,740 --> 00:11:53,940 using earlier but lets you have multiple 388 00:11:52,140 --> 00:11:55,800 spots within it to find different areas 389 00:11:53,940 --> 00:11:58,260 so down here you'll see we have this 390 00:11:55,800 --> 00:11:59,339 empty thing at the bottom so once again 391 00:11:58,260 --> 00:12:00,959 I'm going to create an asset over here 392 00:11:59,339 --> 00:12:03,779 on the right and say I would like a new 393 00:12:00,959 --> 00:12:05,820 tile set a tile Map works with tile sets 394 00:12:03,779 --> 00:12:07,560 we're going to select that tile set 395 00:12:05,820 --> 00:12:09,899 and then we're going to drag in the uh 396 00:12:07,560 --> 00:12:12,360 the resource I've provided you tiles 397 00:12:09,899 --> 00:12:14,100 packed over here and just put it here 398 00:12:12,360 --> 00:12:15,300 it's going to say would you like to 399 00:12:14,100 --> 00:12:16,079 automatically create the tiles yes I 400 00:12:15,300 --> 00:12:19,079 would 401 00:12:16,079 --> 00:12:21,959 and then I'm going to drag this up 402 00:12:19,079 --> 00:12:23,040 and set this to 18 by 18. 403 00:12:21,959 --> 00:12:26,040 because I happen to know that's the 404 00:12:23,040 --> 00:12:28,380 resolution of the titles in this thing 405 00:12:26,040 --> 00:12:29,579 so now we have this task set here which 406 00:12:28,380 --> 00:12:30,779 has a bunch of tiles in it for a 407 00:12:29,579 --> 00:12:31,560 standard platformer so you can kind of 408 00:12:30,779 --> 00:12:33,000 Select them all and they're all 409 00:12:31,560 --> 00:12:35,160 independent tiles 410 00:12:33,000 --> 00:12:36,360 okay so I'm going to use that to lay out 411 00:12:35,160 --> 00:12:37,740 my level so I'm briefly going to make a 412 00:12:36,360 --> 00:12:39,540 little level here so I'm going to go 413 00:12:37,740 --> 00:12:41,399 tile map and then I'm going to use the 414 00:12:39,540 --> 00:12:43,380 painting tool here 415 00:12:41,399 --> 00:12:45,540 I'm going to save this scene as level 416 00:12:43,380 --> 00:12:47,639 and then I'm going to just decorate it 417 00:12:45,540 --> 00:12:50,700 doesn't really matter what you do 418 00:12:47,639 --> 00:12:52,019 as long as it kind of makes sense so you 419 00:12:50,700 --> 00:12:53,700 can you know do all the things you 420 00:12:52,019 --> 00:12:55,680 expect like hold shift and draw lines 421 00:12:53,700 --> 00:12:57,360 which are really good 422 00:12:55,680 --> 00:12:58,680 and you can build little floating in the 423 00:12:57,360 --> 00:13:00,860 air platforms by selecting multiple 424 00:12:58,680 --> 00:13:00,860 things 425 00:13:00,899 --> 00:13:04,560 it's really fun to just play with this 426 00:13:03,480 --> 00:13:06,600 I want to put that one there actually 427 00:13:04,560 --> 00:13:08,160 put that one there put that one there 428 00:13:06,600 --> 00:13:10,139 put that one there put that one there 429 00:13:08,160 --> 00:13:12,540 put that one there and because I haven't 430 00:13:10,139 --> 00:13:13,680 got time to explain how to make a player 431 00:13:12,540 --> 00:13:14,760 that can't go out of bounds I'm actually 432 00:13:13,680 --> 00:13:16,139 just going to build a box around the 433 00:13:14,760 --> 00:13:17,880 whole level 434 00:13:16,139 --> 00:13:20,220 which is really convenient for stuff 435 00:13:17,880 --> 00:13:22,440 like this so I'm just going to go big 436 00:13:20,220 --> 00:13:25,680 line here 437 00:13:22,440 --> 00:13:28,980 big line here 438 00:13:25,680 --> 00:13:30,959 big line big line 439 00:13:28,980 --> 00:13:34,100 I'm gonna go over here a bit more and 440 00:13:30,959 --> 00:13:34,100 then do another one up here 441 00:13:34,380 --> 00:13:37,980 and then you get the idea so I'm just 442 00:13:36,180 --> 00:13:41,540 making a box basically so 443 00:13:37,980 --> 00:13:44,519 nothing bad can ever happen so 444 00:13:41,540 --> 00:13:47,339 he says uh and then I'm going to make 445 00:13:44,519 --> 00:13:49,139 another platform over here 446 00:13:47,339 --> 00:13:51,139 put that one there and then just stretch 447 00:13:49,139 --> 00:13:53,880 that all the way across there oops 448 00:13:51,139 --> 00:13:54,959 stretch that all the way across there 449 00:13:53,880 --> 00:13:56,519 okay 450 00:13:54,959 --> 00:13:59,279 and then for a bit of variety I'll put 451 00:13:56,519 --> 00:14:00,839 some up here as well here here I have no 452 00:13:59,279 --> 00:14:02,639 idea this level's even jumpable with my 453 00:14:00,839 --> 00:14:04,440 character but we'll see 454 00:14:02,639 --> 00:14:05,880 uh that's that's good enough so now we 455 00:14:04,440 --> 00:14:07,139 have this this lovely level 456 00:14:05,880 --> 00:14:08,459 uh 457 00:14:07,139 --> 00:14:10,920 that's fantastic 458 00:14:08,459 --> 00:14:12,300 it's a bit ugly with the background so 459 00:14:10,920 --> 00:14:13,740 if I run this right now God I will 460 00:14:12,300 --> 00:14:15,660 attempt to build it and then show me 461 00:14:13,740 --> 00:14:16,620 what it sees so it's kind of just seeing 462 00:14:15,660 --> 00:14:18,839 the top 463 00:14:16,620 --> 00:14:20,519 the bottom actually which is not great 464 00:14:18,839 --> 00:14:21,600 and that gray background is a bit ugly 465 00:14:20,519 --> 00:14:23,579 so what I'm going to do is I'm going to 466 00:14:21,600 --> 00:14:24,839 add a texture to the background so I'm 467 00:14:23,579 --> 00:14:26,040 going to add another child node called 468 00:14:24,839 --> 00:14:28,260 texture 469 00:14:26,040 --> 00:14:30,360 wrecked which is here which just 470 00:14:28,260 --> 00:14:31,680 displays the texture 471 00:14:30,360 --> 00:14:34,079 and the texture actor is looking for a 472 00:14:31,680 --> 00:14:35,639 texture see it's empty here so in my 473 00:14:34,079 --> 00:14:37,019 assets I've got this green 474 00:14:35,639 --> 00:14:38,760 over here 475 00:14:37,019 --> 00:14:40,860 I'm just going to pick that up drag it 476 00:14:38,760 --> 00:14:43,139 into the empty slot you'll see we've got 477 00:14:40,860 --> 00:14:44,940 this green thing sitting here now 478 00:14:43,139 --> 00:14:46,320 I'm just going to be really lazy and put 479 00:14:44,940 --> 00:14:50,699 that there 480 00:14:46,320 --> 00:14:52,199 set it to tail and then scale it 481 00:14:50,699 --> 00:14:53,279 so we'll end up with this nice texture 482 00:14:52,199 --> 00:14:54,420 behind the level 483 00:14:53,279 --> 00:14:55,920 and you'll see it's currently in front 484 00:14:54,420 --> 00:14:57,120 of my level that's because the ordering 485 00:14:55,920 --> 00:14:59,820 in this thing matters so if I change 486 00:14:57,120 --> 00:15:02,279 this stuff here it'll be behind it 487 00:14:59,820 --> 00:15:03,899 so now we've got this kind of like thing 488 00:15:02,279 --> 00:15:05,279 that kind of looks like Sonic which is 489 00:15:03,899 --> 00:15:08,699 good let's see that's what we're going 490 00:15:05,279 --> 00:15:10,560 for uh we need a player so 491 00:15:08,699 --> 00:15:12,000 you'll still see if I run this so if I 492 00:15:10,560 --> 00:15:13,440 push command r or click the play button 493 00:15:12,000 --> 00:15:14,519 got it will compile this game and run it 494 00:15:13,440 --> 00:15:15,899 for me 495 00:15:14,519 --> 00:15:17,100 uh first I'll actually ask because I've 496 00:15:15,899 --> 00:15:18,180 now got multiple scenes It'll ask me 497 00:15:17,100 --> 00:15:19,320 which one I want the main scene to be I 498 00:15:18,180 --> 00:15:20,459 want it to be the level so I'm going to 499 00:15:19,320 --> 00:15:22,560 say select current but it doesn't 500 00:15:20,459 --> 00:15:24,120 usually matter you'll still see the 501 00:15:22,560 --> 00:15:25,440 perspectives of it wrong we'll fix that 502 00:15:24,120 --> 00:15:26,579 in a minute by adding a camera to the 503 00:15:25,440 --> 00:15:27,660 scene the camera is literally what it 504 00:15:26,579 --> 00:15:29,579 sounds like it shows you what you wanted 505 00:15:27,660 --> 00:15:31,800 to see 506 00:15:29,579 --> 00:15:33,360 so to fix this I'm going to go back to 507 00:15:31,800 --> 00:15:34,500 the player 508 00:15:33,360 --> 00:15:35,699 actually first I'm going to add the 509 00:15:34,500 --> 00:15:36,839 player why not we'll add the player so 510 00:15:35,699 --> 00:15:39,060 I'm going to zoom in on my scene here 511 00:15:36,839 --> 00:15:40,800 and drag remember we saved the player as 512 00:15:39,060 --> 00:15:42,180 a scene you see down here this T scene 513 00:15:40,800 --> 00:15:43,620 thing I'm going to drag that into the 514 00:15:42,180 --> 00:15:46,019 scene 515 00:15:43,620 --> 00:15:48,300 and put it just there 516 00:15:46,019 --> 00:15:50,220 so you'll see it's this entity which 517 00:15:48,300 --> 00:15:52,560 encapsulates the entirety of that player 518 00:15:50,220 --> 00:15:53,519 scene into one thing I mean to put on 519 00:15:52,560 --> 00:15:55,199 the ground there and I'm going to save 520 00:15:53,519 --> 00:15:56,100 that now if I run that we won't be able 521 00:15:55,199 --> 00:15:57,300 to see anything different because it'll 522 00:15:56,100 --> 00:15:59,660 still be that weird perspective but rest 523 00:15:57,300 --> 00:16:01,620 assured the player is up there somehow 524 00:15:59,660 --> 00:16:02,279 I'm doing that deliberately just so you 525 00:16:01,620 --> 00:16:03,240 can see that like it doesn't 526 00:16:02,279 --> 00:16:04,199 automatically show you what you wanted 527 00:16:03,240 --> 00:16:06,240 to show 528 00:16:04,199 --> 00:16:07,740 if I save that command s and go back to 529 00:16:06,240 --> 00:16:09,180 the pliocene so you'll see the scenes 530 00:16:07,740 --> 00:16:10,620 are sort of assembling in tabs up here 531 00:16:09,180 --> 00:16:12,920 and you get a little preview of what 532 00:16:10,620 --> 00:16:12,920 they are 533 00:16:13,139 --> 00:16:17,880 uh I am going to make a camera so 534 00:16:16,740 --> 00:16:19,199 first thing I'm going to add to the 535 00:16:17,880 --> 00:16:21,899 player scene is I'm going to add a 536 00:16:19,199 --> 00:16:23,399 remote transform 537 00:16:21,899 --> 00:16:24,839 with remote transform basically says I 538 00:16:23,399 --> 00:16:25,860 am a position somewhere in the world and 539 00:16:24,839 --> 00:16:28,260 I would like you to be able to tell you 540 00:16:25,860 --> 00:16:29,459 tell something else about my location 541 00:16:28,260 --> 00:16:31,019 we need that because we want the camera 542 00:16:29,459 --> 00:16:32,399 to follow the player so by giving the 543 00:16:31,019 --> 00:16:33,540 player a remote transform the player has 544 00:16:32,399 --> 00:16:35,399 a position that can be broadcast to 545 00:16:33,540 --> 00:16:36,660 other things 546 00:16:35,399 --> 00:16:39,600 so I've added the remote transform and 547 00:16:36,660 --> 00:16:41,759 then I'm going to add a camera 548 00:16:39,600 --> 00:16:44,040 2D 549 00:16:41,759 --> 00:16:46,259 so we have multiple new things in the 550 00:16:44,040 --> 00:16:47,699 scene now and in the camera 2D 551 00:16:46,259 --> 00:16:49,320 we don't need to change anything we just 552 00:16:47,699 --> 00:16:50,639 want to leave it exactly alone we can do 553 00:16:49,320 --> 00:16:51,839 some smoothing so you know like some 554 00:16:50,639 --> 00:16:53,040 games it kind of follows you slightly 555 00:16:51,839 --> 00:16:54,180 behind your actual movement it 556 00:16:53,040 --> 00:16:54,959 automatically does that if you want but 557 00:16:54,180 --> 00:16:56,339 we're not going to do anything there 558 00:16:54,959 --> 00:16:59,160 we're going to go fit on this remote 559 00:16:56,339 --> 00:17:00,420 transform 2D I'm going to click it and 560 00:16:59,160 --> 00:17:02,100 then in the inspector I'm going to say 561 00:17:00,420 --> 00:17:03,420 remote path 562 00:17:02,100 --> 00:17:05,760 assign and I'm going to tell it to 563 00:17:03,420 --> 00:17:08,339 broadcast its position to the camera 564 00:17:05,760 --> 00:17:09,780 so now basically I'm saying camera your 565 00:17:08,339 --> 00:17:11,339 position is wherever the remote 566 00:17:09,780 --> 00:17:12,419 transform tells you to be so I'm going 567 00:17:11,339 --> 00:17:13,380 to save that scene and then I'm going to 568 00:17:12,419 --> 00:17:15,000 return to the level we're going to run 569 00:17:13,380 --> 00:17:16,740 it again 570 00:17:15,000 --> 00:17:17,819 the level which is embedding the player 571 00:17:16,740 --> 00:17:19,079 remember and you'll see now the camera 572 00:17:17,819 --> 00:17:21,059 is kind of following following the 573 00:17:19,079 --> 00:17:22,439 player player can't move but the camera 574 00:17:21,059 --> 00:17:24,179 is following the player 575 00:17:22,439 --> 00:17:25,319 it's kind of tiny I don't really like 576 00:17:24,179 --> 00:17:26,520 that so what I'm going to do is I'm 577 00:17:25,319 --> 00:17:29,520 going to quit that 578 00:17:26,520 --> 00:17:30,960 go up to this project settings 579 00:17:29,520 --> 00:17:34,740 go to the window 580 00:17:30,960 --> 00:17:36,660 and say the window should be 1440 by 900 581 00:17:34,740 --> 00:17:38,220 maybe something like that 582 00:17:36,660 --> 00:17:39,960 oh good my computer's doing weird things 583 00:17:38,220 --> 00:17:43,320 again thank you 584 00:17:39,960 --> 00:17:45,120 thank you computer love that and the 585 00:17:43,320 --> 00:17:47,419 scale should be five or six let's go 586 00:17:45,120 --> 00:17:47,419 with six 587 00:17:48,240 --> 00:17:54,120 now we should end up with 588 00:17:51,419 --> 00:17:57,600 this one looks a lot more like a game 589 00:17:54,120 --> 00:17:59,640 so the camera is actually 590 00:17:57,600 --> 00:18:00,840 in a reasonable position now so if I 591 00:17:59,640 --> 00:18:02,039 could move if I could move this player 592 00:18:00,840 --> 00:18:04,919 this would be great 593 00:18:02,039 --> 00:18:07,919 can't they so 594 00:18:04,919 --> 00:18:09,539 we're going to add a script to the 595 00:18:07,919 --> 00:18:11,400 player the script is going to let us 596 00:18:09,539 --> 00:18:12,900 control the player and dust Its Behavior 597 00:18:11,400 --> 00:18:13,919 make it so it can die and things like 598 00:18:12,900 --> 00:18:16,620 that 599 00:18:13,919 --> 00:18:18,419 gonna go player 600 00:18:16,620 --> 00:18:19,260 go on my player node I'm going to click 601 00:18:18,419 --> 00:18:21,780 the player I'm going to click this 602 00:18:19,260 --> 00:18:23,400 little add script button 603 00:18:21,780 --> 00:18:25,020 and I'm going to say I would like a new 604 00:18:23,400 --> 00:18:27,720 script I'm going to ask for a script 605 00:18:25,020 --> 00:18:28,980 that is in uh C sharp not GD script just 606 00:18:27,720 --> 00:18:30,960 because I don't want to teach you Judy 607 00:18:28,980 --> 00:18:32,700 script today I want to teach you C sharp 608 00:18:30,960 --> 00:18:33,600 with unity I got it it's much more fun 609 00:18:32,700 --> 00:18:35,160 and it's a great way to bring over 610 00:18:33,600 --> 00:18:36,960 people who use Unity 611 00:18:35,160 --> 00:18:38,340 inherits from character buddy 2D which 612 00:18:36,960 --> 00:18:39,539 is the root kind of the no we made the 613 00:18:38,340 --> 00:18:40,799 player and we're going to say we want 614 00:18:39,539 --> 00:18:42,299 the basic movement script so you could 615 00:18:40,799 --> 00:18:43,799 have a completely empty script but godo 616 00:18:42,299 --> 00:18:46,020 comes with a bunch of basic scripts for 617 00:18:43,799 --> 00:18:47,460 things you might want to do so standard 618 00:18:46,020 --> 00:18:50,580 3D and 2D movement that's kind of free 619 00:18:47,460 --> 00:18:52,440 so we're going to let it do that 620 00:18:50,580 --> 00:18:54,600 I'm going to call player.cs because why 621 00:18:52,440 --> 00:18:55,860 not I'm going to correct and it's going 622 00:18:54,600 --> 00:18:58,860 to file up vs code because I've said 623 00:18:55,860 --> 00:19:01,700 that's my preferred external editor 624 00:18:58,860 --> 00:19:01,700 so 625 00:19:02,160 --> 00:19:07,740 here is the default script it's given us 626 00:19:04,200 --> 00:19:09,960 it sets some speed uh jump velocity 627 00:19:07,740 --> 00:19:11,400 it's importing a global property for 628 00:19:09,960 --> 00:19:13,200 Gravity which is just a thing you can 629 00:19:11,400 --> 00:19:15,299 Define how far fast it pulls things down 630 00:19:13,200 --> 00:19:17,280 and we have a physics process function 631 00:19:15,299 --> 00:19:18,720 which is called every tick which is how 632 00:19:17,280 --> 00:19:19,799 we move things into Game World which is 633 00:19:18,720 --> 00:19:20,640 basically checking if you're on the 634 00:19:19,799 --> 00:19:22,200 floor 635 00:19:20,640 --> 00:19:24,120 so if you're not on the floor on the 636 00:19:22,200 --> 00:19:25,740 floor is a function in godo which I'm 637 00:19:24,120 --> 00:19:28,679 going to save this and quit so hopefully 638 00:19:25,740 --> 00:19:31,580 it starts uh Auto completing code 639 00:19:28,679 --> 00:19:31,580 with a bit of luck 640 00:19:32,460 --> 00:19:37,020 there we go okay so on floor is a 641 00:19:35,760 --> 00:19:38,580 function that godo provides that 642 00:19:37,020 --> 00:19:40,140 basically says of course it doesn't 643 00:19:38,580 --> 00:19:41,460 whatever on4 is a function that God 644 00:19:40,140 --> 00:19:43,500 provides it basically says am I touching 645 00:19:41,460 --> 00:19:45,299 something else so if it will return 646 00:19:43,500 --> 00:19:46,679 derivatives if we're not on the floor 647 00:19:45,299 --> 00:19:48,120 we're probably in the air which means we 648 00:19:46,679 --> 00:19:50,400 need to apply gravity that's all this is 649 00:19:48,120 --> 00:19:53,100 doing uh this is checking if a key is 650 00:19:50,400 --> 00:19:55,320 pressed and is jumping if so by applying 651 00:19:53,100 --> 00:19:57,299 the jump velocity to the Y value of the 652 00:19:55,320 --> 00:19:58,500 character and this is checking if you're 653 00:19:57,299 --> 00:19:59,640 pushing left or right and basically 654 00:19:58,500 --> 00:20:01,140 changing the vector you're pointing 655 00:19:59,640 --> 00:20:03,059 accordingly that's all this function is 656 00:20:01,140 --> 00:20:04,260 doing then we call this magic move and 657 00:20:03,059 --> 00:20:05,700 slide function which basically just 658 00:20:04,260 --> 00:20:07,860 magically automatically tells gotta to 659 00:20:05,700 --> 00:20:09,960 move it in goto 3 you just have to pass 660 00:20:07,860 --> 00:20:12,240 the velocity and the the the magnitude 661 00:20:09,960 --> 00:20:13,320 into move and slide now it just uses the 662 00:20:12,240 --> 00:20:14,460 values on the thing it's currently 663 00:20:13,320 --> 00:20:16,080 attached to so whatever you call move 664 00:20:14,460 --> 00:20:17,460 and slide on it pulls the numbers it 665 00:20:16,080 --> 00:20:19,620 needs for you 666 00:20:17,460 --> 00:20:20,700 so now if I run this simply by having a 667 00:20:19,620 --> 00:20:22,380 touch description you'll see now the 668 00:20:20,700 --> 00:20:23,700 player if I select the player and look 669 00:20:22,380 --> 00:20:24,600 at the Players inspector over on the 670 00:20:23,700 --> 00:20:25,500 right you'll see it's got a script 671 00:20:24,600 --> 00:20:27,539 attached 672 00:20:25,500 --> 00:20:28,860 if I run this now after selecting the uh 673 00:20:27,539 --> 00:20:31,140 saving the scene and then selecting the 674 00:20:28,860 --> 00:20:33,980 level scene we can move the player or 675 00:20:31,140 --> 00:20:33,980 can we we'll see 676 00:20:35,340 --> 00:20:39,539 so I can move it so if I'm if I'm really 677 00:20:37,980 --> 00:20:41,340 quick 678 00:20:39,539 --> 00:20:43,020 if I'm really quick while it starts you 679 00:20:41,340 --> 00:20:44,640 see I can 680 00:20:43,020 --> 00:20:45,960 so I do have control over the player but 681 00:20:44,640 --> 00:20:47,700 it's not quite what we wanted 682 00:20:45,960 --> 00:20:49,080 that's because there's no physical 683 00:20:47,700 --> 00:20:51,360 barriers on any of the stuff in this 684 00:20:49,080 --> 00:20:53,820 world so to fix this we actually need to 685 00:20:51,360 --> 00:20:54,720 say there are colliders on things so the 686 00:20:53,820 --> 00:20:55,919 first thing I'm going to add a collider 687 00:20:54,720 --> 00:20:58,080 to is the player so I'm going to go back 688 00:20:55,919 --> 00:20:59,640 to this player scene and go well 689 00:20:58,080 --> 00:21:01,200 actually you can see here this this 690 00:20:59,640 --> 00:21:03,059 little error 691 00:21:01,200 --> 00:21:05,100 which has been there all along has been 692 00:21:03,059 --> 00:21:06,240 telling us the node has no shape so it 693 00:21:05,100 --> 00:21:07,860 can't Collide or interact with lyrics 694 00:21:06,240 --> 00:21:09,240 Just because this thing has a picture of 695 00:21:07,860 --> 00:21:10,980 a player character doesn't mean the game 696 00:21:09,240 --> 00:21:13,200 engine knows that the shape of that 697 00:21:10,980 --> 00:21:14,880 player character maps to that picture so 698 00:21:13,200 --> 00:21:17,160 we need to add a collider so I'm going 699 00:21:14,880 --> 00:21:19,799 to add a child node 700 00:21:17,160 --> 00:21:21,000 of collision shape 2D you'll notice 701 00:21:19,799 --> 00:21:23,160 there's 3D versions of all the things 702 00:21:21,000 --> 00:21:24,780 I'm saying God I just 2D in 3D 703 00:21:23,160 --> 00:21:25,980 sometimes I teach this as 3D if you want 704 00:21:24,780 --> 00:21:28,080 to watch a 3D version of this tutorial 705 00:21:25,980 --> 00:21:29,159 go look at LCA talks from a year or two 706 00:21:28,080 --> 00:21:30,480 ago I did one there with a different 707 00:21:29,159 --> 00:21:33,240 game 708 00:21:30,480 --> 00:21:34,380 uh looking at a collision shape 709 00:21:33,240 --> 00:21:35,640 here 710 00:21:34,380 --> 00:21:36,720 and then I'm going to go over here on 711 00:21:35,640 --> 00:21:38,940 the Collision shape and tell what shape 712 00:21:36,720 --> 00:21:40,140 it is I like to use capsules so I've 713 00:21:38,940 --> 00:21:41,220 created a capsule shape and you'll see 714 00:21:40,140 --> 00:21:42,960 here now we have this little capsule 715 00:21:41,220 --> 00:21:44,880 around the player I'm going to make it a 716 00:21:42,960 --> 00:21:47,039 little bit smaller 717 00:21:44,880 --> 00:21:48,600 and make it touch his feet 718 00:21:47,039 --> 00:21:50,580 and I'm going to save that 719 00:21:48,600 --> 00:21:52,559 so now if we go back to the level 720 00:21:50,580 --> 00:21:55,440 we will not fall through the ground or 721 00:21:52,559 --> 00:21:57,659 maybe not we'll see oh the ground also 722 00:21:55,440 --> 00:21:59,100 needs a collider right so to do this 723 00:21:57,659 --> 00:22:00,480 because we're using a tile map we have 724 00:21:59,100 --> 00:22:01,980 to click the tile map 725 00:22:00,480 --> 00:22:03,720 which is this thing 726 00:22:01,980 --> 00:22:05,159 and then we have to say 727 00:22:03,720 --> 00:22:06,360 over here in the properties of this 728 00:22:05,159 --> 00:22:08,880 timeout we have to say we would like a 729 00:22:06,360 --> 00:22:10,200 physics layer 730 00:22:08,880 --> 00:22:11,340 and you'll see here if you're paying 731 00:22:10,200 --> 00:22:12,720 attention that you can add multiple 732 00:22:11,340 --> 00:22:13,980 physics layers and mask them against 733 00:22:12,720 --> 00:22:15,780 each other so you can have physics 734 00:22:13,980 --> 00:22:17,520 layers that only cause collisions but do 735 00:22:15,780 --> 00:22:18,600 not report those collisions or you can 736 00:22:17,520 --> 00:22:19,799 have physics layers that do not cause 737 00:22:18,600 --> 00:22:21,000 collisions but report when they 738 00:22:19,799 --> 00:22:22,020 intersect something so you can use that 739 00:22:21,000 --> 00:22:23,940 for detecting when you've hit certain 740 00:22:22,020 --> 00:22:26,039 objects we're just going to go with the 741 00:22:23,940 --> 00:22:27,299 simple option and make one physics layer 742 00:22:26,039 --> 00:22:29,159 because I've had the physics I already 743 00:22:27,299 --> 00:22:31,440 to Define what shape belongs to each of 744 00:22:29,159 --> 00:22:32,820 these tiles uh we haven't got time to be 745 00:22:31,440 --> 00:22:35,460 fancy so I'm just going to select the 746 00:22:32,820 --> 00:22:38,280 entire uh whoops that was the wrong 747 00:22:35,460 --> 00:22:40,919 button I'm going to select the entire uh 748 00:22:38,280 --> 00:22:43,860 tile map here just by dragging and I'm 749 00:22:40,919 --> 00:22:45,240 going to click on 750 00:22:43,860 --> 00:22:47,220 this button 751 00:22:45,240 --> 00:22:49,679 and then I'm going to go down to here 752 00:22:47,220 --> 00:22:51,000 and go here I'll explain what I'm doing 753 00:22:49,679 --> 00:22:53,520 one second so I've just selected all 754 00:22:51,000 --> 00:22:55,860 these tiles I haven't I've selected all 755 00:22:53,520 --> 00:22:58,020 of these tiles 756 00:22:55,860 --> 00:22:59,340 in this inspector which kind of is the 757 00:22:58,020 --> 00:23:00,659 inspector for the tiles you currently 758 00:22:59,340 --> 00:23:03,120 have selected there's a physics section 759 00:23:00,659 --> 00:23:04,740 and I'm going to say we need a shape so 760 00:23:03,120 --> 00:23:06,360 you can draw a polygon on here if you 761 00:23:04,740 --> 00:23:08,100 wanted to get fancy and do it manually 762 00:23:06,360 --> 00:23:10,260 but if I just push f 763 00:23:08,100 --> 00:23:13,440 it will fill a shape to the square 764 00:23:10,260 --> 00:23:15,179 so now every single one of these tiles 765 00:23:13,440 --> 00:23:16,200 no matter which one I pick have you seen 766 00:23:15,179 --> 00:23:17,460 on the bottom there has a square 767 00:23:16,200 --> 00:23:19,320 collider on it 768 00:23:17,460 --> 00:23:21,740 that's good for now good enough saving 769 00:23:19,320 --> 00:23:21,740 that running 770 00:23:23,220 --> 00:23:27,120 now we sit on the ground and because 771 00:23:24,960 --> 00:23:28,919 I've mapped the controls it works so 772 00:23:27,120 --> 00:23:32,760 that's pretty good that's a good start 773 00:23:28,919 --> 00:23:34,620 always colliding it's a good start so we 774 00:23:32,760 --> 00:23:36,480 can also we can also jump 775 00:23:34,620 --> 00:23:37,799 which is nice 776 00:23:36,480 --> 00:23:38,880 so we can get up there but we can't do 777 00:23:37,799 --> 00:23:39,960 the traditional platforming thing of 778 00:23:38,880 --> 00:23:41,220 jumping through from the bottom which 779 00:23:39,960 --> 00:23:43,559 kind of sucks 780 00:23:41,220 --> 00:23:45,419 and we slide and we don't animate 781 00:23:43,559 --> 00:23:47,580 which is also a bit crap 782 00:23:45,419 --> 00:23:48,720 uh let's fix the animation first so to 783 00:23:47,580 --> 00:23:51,780 fix animation we're going to go back to 784 00:23:48,720 --> 00:23:53,340 that player in our player see and click 785 00:23:51,780 --> 00:23:55,140 the player Sprite 786 00:23:53,340 --> 00:23:59,340 and add some more animations so I've got 787 00:23:55,140 --> 00:24:02,159 a couple more animations we have jump 788 00:23:59,340 --> 00:24:03,539 which is just a single frame 789 00:24:02,159 --> 00:24:05,900 because when you jump you just want to 790 00:24:03,539 --> 00:24:05,900 basically 791 00:24:06,320 --> 00:24:12,120 right it is still technically 20 FPS but 792 00:24:09,299 --> 00:24:13,980 it doesn't really matter we also want a 793 00:24:12,120 --> 00:24:16,440 move animation 794 00:24:13,980 --> 00:24:18,960 which is not a single frame 795 00:24:16,440 --> 00:24:21,539 that's one two three four five six seven 796 00:24:18,960 --> 00:24:24,919 eight nine ten eleven twelve 797 00:24:21,539 --> 00:24:24,919 twelve by one 798 00:24:25,080 --> 00:24:29,280 so it's segmented again based on what I 799 00:24:26,820 --> 00:24:31,919 just told it 800 00:24:29,280 --> 00:24:33,900 the screen is not updating that is very 801 00:24:31,919 --> 00:24:36,960 exciting 802 00:24:33,900 --> 00:24:39,200 when did it stop updating I am cursed 803 00:24:36,960 --> 00:24:39,200 today 804 00:24:39,419 --> 00:24:44,840 oh good that's that's that's that's 805 00:24:41,580 --> 00:24:44,840 totally mysterious 806 00:24:45,000 --> 00:24:48,240 I've been presenting off this laptop for 807 00:24:46,559 --> 00:24:50,940 weeks with no problem 808 00:24:48,240 --> 00:24:52,380 it's fine okay let's keep going select 809 00:24:50,940 --> 00:24:53,400 all those frames add those frames I just 810 00:24:52,380 --> 00:24:56,039 made so I basically just split the 811 00:24:53,400 --> 00:24:57,600 frames up based on 12x1 so now we have a 812 00:24:56,039 --> 00:24:59,640 nice move animation 813 00:24:57,600 --> 00:25:01,260 it looks great 814 00:24:59,640 --> 00:25:02,580 it's 20 FPS 815 00:25:01,260 --> 00:25:04,380 right 816 00:25:02,580 --> 00:25:07,159 looks fantastic uh what other animations 817 00:25:04,380 --> 00:25:07,159 do I need to add 818 00:25:07,500 --> 00:25:09,500 um 819 00:25:09,539 --> 00:25:12,780 you do not because you're just going to 820 00:25:10,980 --> 00:25:14,520 flip the Sprite 821 00:25:12,780 --> 00:25:15,299 and I'm very lazy that's good for now so 822 00:25:14,520 --> 00:25:17,460 I'm going to save that and then I'm 823 00:25:15,299 --> 00:25:20,039 going to go back into the player script 824 00:25:17,460 --> 00:25:22,440 so to make this actually animate we need 825 00:25:20,039 --> 00:25:24,900 to get a handle on that animated Sprite 826 00:25:22,440 --> 00:25:25,860 node so we can instruct it to change its 827 00:25:24,900 --> 00:25:27,000 animation when different things happen 828 00:25:25,860 --> 00:25:28,380 in the code 829 00:25:27,000 --> 00:25:29,820 to the to do that I'm going to add a 830 00:25:28,380 --> 00:25:31,260 property up here 831 00:25:29,820 --> 00:25:32,460 because my order complete is working it 832 00:25:31,260 --> 00:25:34,200 would never stop working here we go 833 00:25:32,460 --> 00:25:36,179 actually there we go great 834 00:25:34,200 --> 00:25:39,539 animated Sprite 2D you'll remember is 835 00:25:36,179 --> 00:25:40,860 the same type as this node 836 00:25:39,539 --> 00:25:44,159 so we're going to say we want to animate 837 00:25:40,860 --> 00:25:45,720 the Sprite 2D player Sprite 838 00:25:44,159 --> 00:25:47,400 and then in ready 839 00:25:45,720 --> 00:25:50,400 which we don't have currently so we're 840 00:25:47,400 --> 00:25:53,159 going to go public override 841 00:25:50,400 --> 00:25:54,840 void I think it's called ready 842 00:25:53,159 --> 00:25:55,980 yep 843 00:25:54,840 --> 00:25:57,360 so this function is called when 844 00:25:55,980 --> 00:25:59,100 something is instantiated into the scene 845 00:25:57,360 --> 00:26:02,179 only once and because ready we want to 846 00:25:59,100 --> 00:26:02,179 get a handle on the player Sprite 847 00:26:02,220 --> 00:26:07,559 so to do that we get node 848 00:26:04,559 --> 00:26:08,760 of type animated Sprite 2D 849 00:26:07,559 --> 00:26:09,900 and I'll explain what I'm doing a second 850 00:26:08,760 --> 00:26:11,640 then we put the name in here so this 851 00:26:09,900 --> 00:26:13,679 thing is called player Sprite 852 00:26:11,640 --> 00:26:15,659 my biggest complaint with goto now is it 853 00:26:13,679 --> 00:26:16,620 loves strings it uses strings for 854 00:26:15,659 --> 00:26:17,640 literally everything even when you're 855 00:26:16,620 --> 00:26:18,539 using a language where there are better 856 00:26:17,640 --> 00:26:20,520 options 857 00:26:18,539 --> 00:26:22,080 so for whatever reason and it makes 858 00:26:20,520 --> 00:26:23,760 sense with gdscript and made sense long 859 00:26:22,080 --> 00:26:24,840 ago when they created it and it's the 860 00:26:23,760 --> 00:26:26,520 thing lots of other game engines do as 861 00:26:24,840 --> 00:26:27,900 well you refer to everything by its 862 00:26:26,520 --> 00:26:29,400 string name which is just weird to me 863 00:26:27,900 --> 00:26:31,380 but it works 864 00:26:29,400 --> 00:26:33,120 it seems like it could be fragile under 865 00:26:31,380 --> 00:26:34,500 certain circumstances suppose that we're 866 00:26:33,120 --> 00:26:35,640 saying there is an animators brought to 867 00:26:34,500 --> 00:26:37,740 it equal player Sprite and when you 868 00:26:35,640 --> 00:26:40,559 responding to scene please inspect your 869 00:26:37,740 --> 00:26:42,419 node tree and find the animators bright 870 00:26:40,559 --> 00:26:43,380 2D node of name player Sprite and assign 871 00:26:42,419 --> 00:26:45,120 it to that 872 00:26:43,380 --> 00:26:46,919 if you use GD script there is shorthand 873 00:26:45,120 --> 00:26:48,299 which does all that in one go so it's 874 00:26:46,919 --> 00:26:51,480 one of the negatives of using C sharp 875 00:26:48,299 --> 00:26:52,679 anyway we have a handle on the uh the 876 00:26:51,480 --> 00:26:54,000 player Sprite now 877 00:26:52,679 --> 00:26:54,900 so what I'm going to do now is I'm going 878 00:26:54,000 --> 00:26:57,179 to 879 00:26:54,900 --> 00:26:58,860 basically 880 00:26:57,179 --> 00:27:02,760 change the Sprite when we need to change 881 00:26:58,860 --> 00:27:04,200 the Sprite so if you're on the floor 882 00:27:02,760 --> 00:27:05,340 so if you're not on the floor so if 883 00:27:04,200 --> 00:27:06,720 gravity's happening we need to do some 884 00:27:05,340 --> 00:27:09,299 certain certain things so because we're 885 00:27:06,720 --> 00:27:11,220 jumping if we're inside this 886 00:27:09,299 --> 00:27:16,380 right here we are jumping that's what we 887 00:27:11,220 --> 00:27:19,100 need to know so if velocity dot y 888 00:27:16,380 --> 00:27:19,100 is 889 00:27:19,500 --> 00:27:26,059 jumping basically 890 00:27:22,860 --> 00:27:26,059 change the player Sprite 891 00:27:26,279 --> 00:27:30,779 to jump 892 00:27:29,100 --> 00:27:31,919 it'll change that one frame animation of 893 00:27:30,779 --> 00:27:34,919 it going like that 894 00:27:31,919 --> 00:27:34,919 otherwise 895 00:27:37,080 --> 00:27:42,779 play full because we're not on the floor 896 00:27:40,740 --> 00:27:43,679 but we're not jumping which means we're 897 00:27:42,779 --> 00:27:45,059 falling 898 00:27:43,679 --> 00:27:47,240 I'll set the full screen up in a minute 899 00:27:45,059 --> 00:27:50,760 that's what I forgot to do 900 00:27:47,240 --> 00:27:52,500 that's everything we need to do there 901 00:27:50,760 --> 00:27:54,240 otherwise 902 00:27:52,500 --> 00:27:56,400 so if we are not on the floor which 903 00:27:54,240 --> 00:27:57,799 means we are not not on the floor not is 904 00:27:56,400 --> 00:28:00,720 on floor which means we are on the floor 905 00:27:57,799 --> 00:28:02,100 we then need to sorry Mike C sharp code 906 00:28:00,720 --> 00:28:06,779 style is terrible by the way don't judge 907 00:28:02,100 --> 00:28:10,520 me uh if velocity.x is zero 908 00:28:06,779 --> 00:28:10,520 that means we are idle 909 00:28:14,760 --> 00:28:19,020 so we are not jumping we're not falling 910 00:28:17,100 --> 00:28:23,340 we are not moving either 911 00:28:19,020 --> 00:28:24,720 we play idol else player Sprite 912 00:28:23,340 --> 00:28:26,880 play 913 00:28:24,720 --> 00:28:28,020 move 914 00:28:26,880 --> 00:28:29,520 so that's everything we need to do there 915 00:28:28,020 --> 00:28:31,020 I need to go back out of full Sprite so 916 00:28:29,520 --> 00:28:32,880 basically 917 00:28:31,020 --> 00:28:37,340 I'm missing a bracket 918 00:28:32,880 --> 00:28:37,340 on 27 I'm missing a bracket oh yeah 919 00:28:39,020 --> 00:28:43,080 currently it's 920 00:28:41,220 --> 00:28:47,100 up yeah I think it's up but you could 921 00:28:43,080 --> 00:28:49,460 you can change that just to be confusing 922 00:28:47,100 --> 00:28:49,460 down 923 00:28:50,279 --> 00:28:54,080 so yeah so it's the other way around yes 924 00:28:51,659 --> 00:28:54,080 very good 925 00:28:54,840 --> 00:28:58,320 okay so one thing I do on my daily life 926 00:28:56,580 --> 00:28:59,520 is I work with Unreal Engine Godot and 927 00:28:58,320 --> 00:29:00,840 unity and they all have completely 928 00:28:59,520 --> 00:29:02,340 different coordinate systems and it just 929 00:29:00,840 --> 00:29:04,320 does my head in I also program Swift 930 00:29:02,340 --> 00:29:05,700 c-sharp rust and a bunch of other 931 00:29:04,320 --> 00:29:08,580 languages so I forget semicolons 932 00:29:05,700 --> 00:29:11,220 brackets don't mind me I do know how to 933 00:29:08,580 --> 00:29:11,940 program I'm just very stupid 934 00:29:11,220 --> 00:29:13,679 um 935 00:29:11,940 --> 00:29:16,020 so here we have a things by saying if 936 00:29:13,679 --> 00:29:17,640 we're if we're on the floor and not 937 00:29:16,020 --> 00:29:20,460 moving play idle or on the floor and 938 00:29:17,640 --> 00:29:22,799 moving play move if we're in the air uh 939 00:29:20,460 --> 00:29:23,880 and jumping play the jump animation 940 00:29:22,799 --> 00:29:24,899 you'll be in there and fall and play the 941 00:29:23,880 --> 00:29:26,460 full animation 942 00:29:24,899 --> 00:29:28,080 the only and we've got to handle to the 943 00:29:26,460 --> 00:29:29,520 thing that lets us play the animation 944 00:29:28,080 --> 00:29:30,840 the only thing I forgot to do is any I 945 00:29:29,520 --> 00:29:32,220 don't think I added the the full 946 00:29:30,840 --> 00:29:33,899 animation to the Sprite so I'm going to 947 00:29:32,220 --> 00:29:36,659 add another animation here 948 00:29:33,899 --> 00:29:38,820 I think I call it fall 949 00:29:36,659 --> 00:29:40,860 and I'm pretty sure it is just a single 950 00:29:38,820 --> 00:29:43,320 frame of falling I think it's just the 951 00:29:40,860 --> 00:29:46,620 exact opposite of the jump animation 952 00:29:43,320 --> 00:29:48,179 yeah okay I'm going to save that and run 953 00:29:46,620 --> 00:29:50,100 and we'll see what what stupid mistake 954 00:29:48,179 --> 00:29:52,380 I've made 955 00:29:50,100 --> 00:29:53,880 so now he runs he runs backwards still 956 00:29:52,380 --> 00:29:55,500 we'll fix that in a minute and he can 957 00:29:53,880 --> 00:29:56,700 jump 958 00:29:55,500 --> 00:29:58,860 that's pretty good that looks pretty 959 00:29:56,700 --> 00:30:00,779 good to me 960 00:29:58,860 --> 00:30:01,799 so now we're going to make him flip the 961 00:30:00,779 --> 00:30:02,760 other way we need when he needs to go 962 00:30:01,799 --> 00:30:05,760 the other way 963 00:30:02,760 --> 00:30:10,039 um that's a bit disappointing so 964 00:30:05,760 --> 00:30:10,039 in our player script 965 00:30:10,919 --> 00:30:15,020 we're going to go down to the line 966 00:30:15,260 --> 00:30:18,679 this one here 967 00:30:19,140 --> 00:30:24,620 and basically say this is if we are 968 00:30:22,380 --> 00:30:24,620 moving 969 00:30:25,080 --> 00:30:34,200 so if we do not have a zero Vector we're 970 00:30:28,080 --> 00:30:36,179 going to say if velocity dot X is zero 971 00:30:34,200 --> 00:30:40,320 then we want to play it 972 00:30:36,179 --> 00:30:43,200 what have I done oh my gosh 973 00:30:40,320 --> 00:30:45,179 I'm so stupid don't mind me a player 974 00:30:43,200 --> 00:30:48,299 Sprite 975 00:30:45,179 --> 00:30:49,679 dot flip h 976 00:30:48,299 --> 00:30:52,500 and hopefully that's obvious what that 977 00:30:49,679 --> 00:30:53,760 does it flips it on the horizontal else 978 00:30:52,500 --> 00:30:56,760 uh 979 00:30:53,760 --> 00:30:56,760 velocity 980 00:30:58,980 --> 00:31:04,559 dot X is greater than zero then player 981 00:31:03,360 --> 00:31:06,140 Sprite 982 00:31:04,559 --> 00:31:08,640 flip 983 00:31:06,140 --> 00:31:11,220 uh actually I'm gonna do a different way 984 00:31:08,640 --> 00:31:13,559 equals true 985 00:31:11,220 --> 00:31:14,880 so if H equals false sorry I've changed 986 00:31:13,559 --> 00:31:15,899 my mind on that a few times so basically 987 00:31:14,880 --> 00:31:17,580 depending on which direction we're 988 00:31:15,899 --> 00:31:19,020 facing flip the Sprite 989 00:31:17,580 --> 00:31:20,700 so that should now feel significantly 990 00:31:19,020 --> 00:31:21,840 you know around the player scene you can 991 00:31:20,700 --> 00:31:22,799 see what happens I ran the player C 992 00:31:21,840 --> 00:31:23,880 which means we get the player doing 993 00:31:22,799 --> 00:31:27,240 nothing 994 00:31:23,880 --> 00:31:30,179 gotta run the correct side now 995 00:31:27,240 --> 00:31:32,159 so hopefully now go that way it goes 996 00:31:30,179 --> 00:31:34,880 that way go that way it goes that way 997 00:31:32,159 --> 00:31:37,080 pretty good right 998 00:31:34,880 --> 00:31:38,340 so what's on we've got time for a couple 999 00:31:37,080 --> 00:31:39,659 more things okay 1000 00:31:38,340 --> 00:31:40,980 so the next thing I'm going to add is 1001 00:31:39,659 --> 00:31:42,419 these platforms don't feel very good to 1002 00:31:40,980 --> 00:31:43,860 jump at because you want to go through 1003 00:31:42,419 --> 00:31:45,000 them and land on the top 1004 00:31:43,860 --> 00:31:46,260 thankfully God who knows that you're 1005 00:31:45,000 --> 00:31:48,840 probably making a stupid little platform 1006 00:31:46,260 --> 00:31:51,840 game and makes that easy 1007 00:31:48,840 --> 00:31:53,039 very easy so back in here where we set 1008 00:31:51,840 --> 00:31:54,120 up the physics Collision for the 1009 00:31:53,039 --> 00:31:56,940 platforms 1010 00:31:54,120 --> 00:31:58,919 if I select all of these again 1011 00:31:56,940 --> 00:31:59,700 and because I'm tremendously lazy I'm 1012 00:31:58,919 --> 00:32:00,720 just going to do it to all of them 1013 00:31:59,700 --> 00:32:02,220 realistically you'd want to carefully 1014 00:32:00,720 --> 00:32:03,539 map out a polygon for each of these so 1015 00:32:02,220 --> 00:32:06,240 you don't end up with all the same thing 1016 00:32:03,539 --> 00:32:08,039 so you'll see this polygon is a square 1017 00:32:06,240 --> 00:32:09,899 if we go down here to the polygon we've 1018 00:32:08,039 --> 00:32:11,940 defined 1019 00:32:09,899 --> 00:32:14,520 and take one way 1020 00:32:11,940 --> 00:32:15,840 you'll notice they're now all one way 1021 00:32:14,520 --> 00:32:17,100 which basically means they only Collide 1022 00:32:15,840 --> 00:32:18,419 on the top you can change the direction 1023 00:32:17,100 --> 00:32:20,279 that Arrow points and you can give it 1024 00:32:18,419 --> 00:32:22,440 kind of like a feather like a a limit 1025 00:32:20,279 --> 00:32:24,799 where you can still pass through it and 1026 00:32:22,440 --> 00:32:24,799 I'm going to run 1027 00:32:25,080 --> 00:32:28,380 yes but I haven't not got time to show 1028 00:32:27,000 --> 00:32:30,059 you that but yes you can absolutely do 1029 00:32:28,380 --> 00:32:31,080 that so now if I jump up at the 1030 00:32:30,059 --> 00:32:32,760 platforms I should be able to go through 1031 00:32:31,080 --> 00:32:35,460 them along on the top 1032 00:32:32,760 --> 00:32:37,200 which feels good already right 1033 00:32:35,460 --> 00:32:38,820 having designs level very well but it's 1034 00:32:37,200 --> 00:32:41,820 it's a nice feeling 1035 00:32:38,820 --> 00:32:42,779 okay so we have about what 10 minutes 1036 00:32:41,820 --> 00:32:45,600 left I think that's probably enough time 1037 00:32:42,779 --> 00:32:47,640 to make an enemy so I'm gonna attempt 1038 00:32:45,600 --> 00:32:49,860 fate 1039 00:32:47,640 --> 00:32:51,840 the enemy is already the HDMI cable but 1040 00:32:49,860 --> 00:32:55,340 we'll uh we'll see how this goes 1041 00:32:51,840 --> 00:32:55,340 so I'm going to make a brand new scene 1042 00:32:55,980 --> 00:32:59,220 okay made a new scene and this scene is 1043 00:32:58,140 --> 00:33:01,080 going to be very similar to our player 1044 00:32:59,220 --> 00:33:03,740 it's going to have a character body 2D 1045 00:33:01,080 --> 00:33:03,740 as the root 1046 00:33:04,440 --> 00:33:08,340 you're very mature you don't laugh when 1047 00:33:05,820 --> 00:33:09,419 I say root that's great most people most 1048 00:33:08,340 --> 00:33:10,559 of the people laugh at all the stupid 1049 00:33:09,419 --> 00:33:11,940 things gaming is cool stuff because 1050 00:33:10,559 --> 00:33:14,159 you've got like root nodes you've got 1051 00:33:11,940 --> 00:33:16,380 like empty children you've got all sorts 1052 00:33:14,159 --> 00:33:18,000 of stuff that like people just giggle at 1053 00:33:16,380 --> 00:33:19,620 so I'm very impressed with you all we 1054 00:33:18,000 --> 00:33:21,240 have an enemy which is just a character 1055 00:33:19,620 --> 00:33:22,620 body 2D again I'm going to add an 1056 00:33:21,240 --> 00:33:26,240 animated Sprite so the player can 1057 00:33:22,620 --> 00:33:26,240 actually see the enemy doing something 1058 00:33:26,419 --> 00:33:31,019 enemy Sprite and once again I'm going to 1059 00:33:29,519 --> 00:33:31,799 add an animation to that Sprite over 1060 00:33:31,019 --> 00:33:33,659 here 1061 00:33:31,799 --> 00:33:35,340 and my mouse has stopped working again I 1062 00:33:33,659 --> 00:33:36,539 love that 1063 00:33:35,340 --> 00:33:38,279 I'm going to give it a second there we 1064 00:33:36,539 --> 00:33:40,620 go 1065 00:33:38,279 --> 00:33:43,919 use bright click you still see yep okay 1066 00:33:40,620 --> 00:33:46,679 cool this player needs a move animation 1067 00:33:43,919 --> 00:33:50,659 sorry this enemy needs a move animation 1068 00:33:46,679 --> 00:33:50,659 and we're going to add my enemy frames 1069 00:33:52,220 --> 00:33:57,600 that is definitely not on my end that is 1070 00:33:55,200 --> 00:33:59,039 so weird 1071 00:33:57,600 --> 00:34:04,760 not 1072 00:33:59,039 --> 00:34:04,760 this is the so I don't know don't know 1073 00:34:06,720 --> 00:34:11,000 yeah this is an entirely different 1074 00:34:08,580 --> 00:34:11,000 visual 1075 00:34:12,000 --> 00:34:14,520 I'm going to go with that something 1076 00:34:13,260 --> 00:34:15,720 weird God is doing with the drawing 1077 00:34:14,520 --> 00:34:17,339 context it doesn't really like being 1078 00:34:15,720 --> 00:34:19,320 projected but uh 1079 00:34:17,339 --> 00:34:21,800 we'll see let's see if I can make it 1080 00:34:19,320 --> 00:34:21,800 full screen 1081 00:34:23,159 --> 00:34:26,280 so yeah no no I don't know what's going 1082 00:34:24,960 --> 00:34:28,639 on there that's weird this is very 1083 00:34:26,280 --> 00:34:31,139 unique 1084 00:34:28,639 --> 00:34:33,359 really you can you can actually see the 1085 00:34:31,139 --> 00:34:34,379 mouse cursor but not the con okay we're 1086 00:34:33,359 --> 00:34:36,659 going to unplug it and do that again 1087 00:34:34,379 --> 00:34:39,320 this is fun it's okay we still have time 1088 00:34:36,659 --> 00:34:39,320 to make an enemy 1089 00:34:40,260 --> 00:34:45,179 I hate computers I'm ready to give up on 1090 00:34:43,320 --> 00:34:46,260 the whole tech industry honestly 1091 00:34:45,179 --> 00:34:48,599 um okay 1092 00:34:46,260 --> 00:34:50,820 yep can you see this 1093 00:34:48,599 --> 00:34:54,060 okay so I'm adding a run animation which 1094 00:34:50,820 --> 00:34:55,740 which is uh nine hello twelve 1095 00:34:54,060 --> 00:34:58,380 that's so weird 1096 00:34:55,740 --> 00:35:00,720 okay select uh clear frames there we go 1097 00:34:58,380 --> 00:35:02,640 there's 12 frames of a little frog dude 1098 00:35:00,720 --> 00:35:06,540 looks very menacing 1099 00:35:02,640 --> 00:35:09,180 we'll play him he's 20 FPS as well 1100 00:35:06,540 --> 00:35:11,160 very menacing little frog I'm going to 1101 00:35:09,180 --> 00:35:13,200 add a collision shape to the Frog so you 1102 00:35:11,160 --> 00:35:16,700 can actually collide with things 1103 00:35:13,200 --> 00:35:16,700 and give it another capsule 1104 00:35:16,740 --> 00:35:23,160 so he needs the capsule to touch the 1105 00:35:18,420 --> 00:35:26,040 bottom roughly yep that's good enough 1106 00:35:23,160 --> 00:35:28,680 and I'm going to save this as enemy 1107 00:35:26,040 --> 00:35:30,119 and add a script to him 1108 00:35:28,680 --> 00:35:32,339 again we're just going to leave it as 1109 00:35:30,119 --> 00:35:33,960 default basic movement 1110 00:35:32,339 --> 00:35:35,220 so if I left this as it is now we'd be 1111 00:35:33,960 --> 00:35:36,060 driving both characters at once with the 1112 00:35:35,220 --> 00:35:37,380 input so I'm going to actually delete 1113 00:35:36,060 --> 00:35:38,339 all of this so I just wanted to get the 1114 00:35:37,380 --> 00:35:40,680 basics 1115 00:35:38,339 --> 00:35:43,560 so I'm going to actually go over here 1116 00:35:40,680 --> 00:35:45,359 and get a script I prepared earlier 1117 00:35:43,560 --> 00:35:47,280 just because I don't want to have to 1118 00:35:45,359 --> 00:35:49,560 type all this 1119 00:35:47,280 --> 00:35:52,440 I'll explain what I've done so this 1120 00:35:49,560 --> 00:35:53,940 player this enemy class gets a handle on 1121 00:35:52,440 --> 00:35:55,079 the enemy Sprite Which is the thing we 1122 00:35:53,940 --> 00:35:56,460 just made 1123 00:35:55,079 --> 00:35:58,560 we're not using that yet so I'll delete 1124 00:35:56,460 --> 00:36:01,500 that 1125 00:35:58,560 --> 00:36:02,579 and when it's ready it gets it gets a 1126 00:36:01,500 --> 00:36:05,160 reference to that 1127 00:36:02,579 --> 00:36:06,839 and then as it moves it checks if it's 1128 00:36:05,160 --> 00:36:08,579 on a wall we don't want that either 1129 00:36:06,839 --> 00:36:10,440 sorry 1130 00:36:08,579 --> 00:36:13,920 uh it moves and it flips its spot 1131 00:36:10,440 --> 00:36:14,820 accordingly so if it hits a wall so it's 1132 00:36:13,920 --> 00:36:15,960 going to run this image it kind of hits 1133 00:36:14,820 --> 00:36:17,339 a wall and bounces back and goes the 1134 00:36:15,960 --> 00:36:19,560 other way and keeps going so if it hits 1135 00:36:17,339 --> 00:36:21,420 a wall it flips its direction 1136 00:36:19,560 --> 00:36:22,920 that's all it does so is on wall is very 1137 00:36:21,420 --> 00:36:24,660 simple is on floor just checks if you're 1138 00:36:22,920 --> 00:36:25,859 touching something on the sides these 1139 00:36:24,660 --> 00:36:27,119 are all just convenience functions that 1140 00:36:25,859 --> 00:36:28,320 godo provides you could write all this 1141 00:36:27,119 --> 00:36:29,460 manually Yourself by checking the 1142 00:36:28,320 --> 00:36:30,540 direction of things but you don't need 1143 00:36:29,460 --> 00:36:32,280 to 1144 00:36:30,540 --> 00:36:33,540 so we say if we flip the Sprite we're 1145 00:36:32,280 --> 00:36:35,099 going one way flips otherwise otherwise 1146 00:36:33,540 --> 00:36:36,660 we just move 1147 00:36:35,099 --> 00:36:38,400 and it just goes back and forth so 1148 00:36:36,660 --> 00:36:40,020 that's all this is going to do which 1149 00:36:38,400 --> 00:36:42,240 make sure it's called Sprite 1150 00:36:40,020 --> 00:36:43,859 and here enemy Sprite I'm going to save 1151 00:36:42,240 --> 00:36:45,300 that into the level I'm going to make an 1152 00:36:43,859 --> 00:36:46,740 area for this enemy to go because you'll 1153 00:36:45,300 --> 00:36:48,900 see there's actually no spot for him to 1154 00:36:46,740 --> 00:36:51,300 sit currently so I'm going to go into 1155 00:36:48,900 --> 00:36:54,540 the tile map click this button 1156 00:36:51,300 --> 00:36:55,740 lay the tile map out 1157 00:36:54,540 --> 00:36:57,420 sorry I have stuff click a few things 1158 00:36:55,740 --> 00:36:59,700 before it works now I'm going to put a 1159 00:36:57,420 --> 00:37:01,680 block here 1160 00:36:59,700 --> 00:37:02,880 and I'm going to extend the floor a 1161 00:37:01,680 --> 00:37:05,040 little bit 1162 00:37:02,880 --> 00:37:06,780 so I can go there and I'm going to put 1163 00:37:05,040 --> 00:37:09,180 another block here this is a really 1164 00:37:06,780 --> 00:37:12,240 silly level but you get the idea 1165 00:37:09,180 --> 00:37:14,820 so now down here we have an enemy we're 1166 00:37:12,240 --> 00:37:18,079 going to drag him into the level 1167 00:37:14,820 --> 00:37:18,079 and put him there 1168 00:37:18,180 --> 00:37:20,940 and I'm going to drag him down onto the 1169 00:37:19,680 --> 00:37:23,160 ground 1170 00:37:20,940 --> 00:37:24,960 and hopefully 1171 00:37:23,160 --> 00:37:27,780 here I run this he'll go back and forth 1172 00:37:24,960 --> 00:37:29,700 in that spot is it 1173 00:37:27,780 --> 00:37:31,079 nope currently he's not let's find out 1174 00:37:29,700 --> 00:37:33,560 what I did wrong who would debugger how 1175 00:37:31,079 --> 00:37:33,560 convenient 1176 00:37:34,200 --> 00:37:37,800 account instant script make sure the 1177 00:37:36,119 --> 00:37:40,380 script exists okay so the problem is 1178 00:37:37,800 --> 00:37:42,720 here is this is capital E and the script 1179 00:37:40,380 --> 00:37:46,040 is not 1180 00:37:42,720 --> 00:37:46,040 so we're just going to rename that 1181 00:37:47,640 --> 00:37:51,200 oh my gosh 1182 00:37:51,540 --> 00:37:55,980 I'm just gonna I'm just gonna quit Gotto 1183 00:37:54,060 --> 00:37:56,880 and unplug and plug back in I'm going to 1184 00:37:55,980 --> 00:37:57,960 show you the final version because 1185 00:37:56,880 --> 00:37:59,640 clearly that's not fun and we've got 1186 00:37:57,960 --> 00:38:01,140 seven minutes left or so 1187 00:37:59,640 --> 00:38:02,400 so 1188 00:38:01,140 --> 00:38:03,839 basically that enemy was going to go 1189 00:38:02,400 --> 00:38:06,119 back and forth in one scene and not do 1190 00:38:03,839 --> 00:38:08,460 much of anything 1191 00:38:06,119 --> 00:38:09,660 here is the final version of this little 1192 00:38:08,460 --> 00:38:11,520 project which I'll give you the source 1193 00:38:09,660 --> 00:38:14,460 code to before we finish today 1194 00:38:11,520 --> 00:38:17,460 is that can you see anything oh my gosh 1195 00:38:14,460 --> 00:38:17,460 mcec 1196 00:38:18,180 --> 00:38:22,859 there we go okay this is the final 1197 00:38:20,280 --> 00:38:24,660 version that I made to test this 1198 00:38:22,859 --> 00:38:26,960 it's exactly the same as the code you 1199 00:38:24,660 --> 00:38:30,480 just seen it all just works 1200 00:38:26,960 --> 00:38:32,599 except for the freaking room 1201 00:38:30,480 --> 00:38:32,599 um 1202 00:38:34,440 --> 00:38:38,220 I don't know how to fix this but there 1203 00:38:36,900 --> 00:38:40,020 is a full game that you can download on 1204 00:38:38,220 --> 00:38:42,119 git I will send you the link now so you 1205 00:38:40,020 --> 00:38:43,200 can see it is very very fun for you to 1206 00:38:42,119 --> 00:38:45,060 play with this and it means you can 1207 00:38:43,200 --> 00:38:47,339 learn so if anyone wants to play with 1208 00:38:45,060 --> 00:38:49,500 this outside of the screen that 1209 00:38:47,339 --> 00:38:52,579 constantly flickers you can look at my 1210 00:38:49,500 --> 00:38:54,480 GitHub which is Paris paparsba and it's 1211 00:38:52,579 --> 00:38:56,099 eo23-godo and I have no idea why this is 1212 00:38:54,480 --> 00:38:57,480 just flickering At Me Now 1213 00:38:56,099 --> 00:38:58,500 I'm going to give it one final attempt 1214 00:38:57,480 --> 00:38:59,400 to show you the final version of this 1215 00:38:58,500 --> 00:39:02,280 game 1216 00:38:59,400 --> 00:39:04,020 and otherwise I'm giving up 1217 00:39:02,280 --> 00:39:05,640 but you get the idea goto is a very 1218 00:39:04,020 --> 00:39:06,839 simple way to build games out of pieces 1219 00:39:05,640 --> 00:39:08,400 and you can basically build things out 1220 00:39:06,839 --> 00:39:12,000 of these modular components that make it 1221 00:39:08,400 --> 00:39:14,940 very simple to not have to think about 1222 00:39:12,000 --> 00:39:17,099 too much flickering not have to think 1223 00:39:14,940 --> 00:39:18,960 about too much about what's going on and 1224 00:39:17,099 --> 00:39:19,980 whether you need to make things relate 1225 00:39:18,960 --> 00:39:21,180 to each other in a certain way because 1226 00:39:19,980 --> 00:39:22,859 they kind of all just talk to each other 1227 00:39:21,180 --> 00:39:24,300 in a way that makes sense 1228 00:39:22,859 --> 00:39:27,560 I'm gonna give it one file attempt to 1229 00:39:24,300 --> 00:39:27,560 show you and we'll give up 1230 00:39:27,660 --> 00:39:31,500 computer 1231 00:39:29,640 --> 00:39:32,880 okay so you can get a copy of the game 1232 00:39:31,500 --> 00:39:34,200 here all the source code of the final 1233 00:39:32,880 --> 00:39:35,820 version is there 1234 00:39:34,200 --> 00:39:36,780 please please play with it it's really 1235 00:39:35,820 --> 00:39:38,160 quite fun 1236 00:39:36,780 --> 00:39:39,480 all the credits for the art I did not 1237 00:39:38,160 --> 00:39:42,300 make any of the up by the way I stole it 1238 00:39:39,480 --> 00:39:43,260 all it's all cc0 or CC Buy 1239 00:39:42,300 --> 00:39:45,300 um 1240 00:39:43,260 --> 00:39:46,859 you can find me on Mastered on there and 1241 00:39:45,300 --> 00:39:49,020 we're writing a book on Gotto which will 1242 00:39:46,859 --> 00:39:50,460 be great that's not out yet that's just 1243 00:39:49,020 --> 00:39:52,619 totally a placeholder page but follow me 1244 00:39:50,460 --> 00:39:54,480 on social or bookmark that link if you 1245 00:39:52,619 --> 00:39:55,920 want to play with it 1246 00:39:54,480 --> 00:39:57,839 um Here's the final version of the game 1247 00:39:55,920 --> 00:39:59,760 which is all the same features you just 1248 00:39:57,839 --> 00:40:00,900 saw this enemy is exactly the same code 1249 00:39:59,760 --> 00:40:02,460 that we were just making he just goes 1250 00:40:00,900 --> 00:40:04,500 back and forth and hits the thing 1251 00:40:02,460 --> 00:40:06,599 there is another enemy up the top 1252 00:40:04,500 --> 00:40:08,040 somewhere which does the same thing but 1253 00:40:06,599 --> 00:40:09,900 stays on a platform 1254 00:40:08,040 --> 00:40:11,400 that's accomplished by pointing raycasts 1255 00:40:09,900 --> 00:40:12,300 which are basically perfect lasers that 1256 00:40:11,400 --> 00:40:14,220 tell you when they're hitting something 1257 00:40:12,300 --> 00:40:15,720 down on either side and then tell if one 1258 00:40:14,220 --> 00:40:16,980 stops detecting something it flips and 1259 00:40:15,720 --> 00:40:18,300 points the other way 1260 00:40:16,980 --> 00:40:19,859 there are also coins you can collect in 1261 00:40:18,300 --> 00:40:21,480 this version so you can jump up on 1262 00:40:19,859 --> 00:40:23,160 platforms and collect coins 1263 00:40:21,480 --> 00:40:24,660 you'll see the coin go up in the corner 1264 00:40:23,160 --> 00:40:26,640 and if I jump on one of these frogs it 1265 00:40:24,660 --> 00:40:28,859 will kill me 1266 00:40:26,640 --> 00:40:30,359 and respawn me all this code for this 1267 00:40:28,859 --> 00:40:31,320 version is in the repo so if anyone 1268 00:40:30,359 --> 00:40:32,339 wants to play with this you can grab 1269 00:40:31,320 --> 00:40:34,140 this 1270 00:40:32,339 --> 00:40:35,220 lots of people the most frequent 1271 00:40:34,140 --> 00:40:37,579 question I get asked about God is should 1272 00:40:35,220 --> 00:40:40,320 you learn GD script or C sharp 1273 00:40:37,579 --> 00:40:41,940 I don't love C sharp I think it's a 1274 00:40:40,320 --> 00:40:43,140 great language but I don't love I don't 1275 00:40:41,940 --> 00:40:44,339 enjoy using it I think it's got lots of 1276 00:40:43,140 --> 00:40:47,160 great features but I don't enjoy writing 1277 00:40:44,339 --> 00:40:48,900 code in it that said I think if you want 1278 00:40:47,160 --> 00:40:51,180 to do this professionally or make big 1279 00:40:48,900 --> 00:40:52,380 games for real you should do C sharp 1280 00:40:51,180 --> 00:40:53,760 just because there's a bigger community 1281 00:40:52,380 --> 00:40:55,260 of stuff out there and you can bring all 1282 00:40:53,760 --> 00:40:57,060 sorts of random dlls in that do all 1283 00:40:55,260 --> 00:40:58,320 sorts of good stuff from the massive 1284 00:40:57,060 --> 00:41:00,900 library of stuff that people have done 1285 00:40:58,320 --> 00:41:02,940 in the mono and.net community 1286 00:41:00,900 --> 00:41:05,040 um if you are just doing this for fun 1287 00:41:02,940 --> 00:41:06,480 then pick whatever language you enjoy GD 1288 00:41:05,040 --> 00:41:07,800 script is really easy to use and there's 1289 00:41:06,480 --> 00:41:09,119 lots of convenience helpers which means 1290 00:41:07,800 --> 00:41:10,920 you don't need to initialize stuff 1291 00:41:09,119 --> 00:41:12,839 already you just say I would like a 1292 00:41:10,920 --> 00:41:13,800 handle on my animated Sprite and it 1293 00:41:12,839 --> 00:41:15,300 gives you one 1294 00:41:13,800 --> 00:41:17,280 it's much easier to use it's also all 1295 00:41:15,300 --> 00:41:19,859 built into the god of editor 1296 00:41:17,280 --> 00:41:21,660 so I would say GD script for hobby hobby 1297 00:41:19,859 --> 00:41:23,460 or using or playing or building games 1298 00:41:21,660 --> 00:41:25,500 with your kids C sharp for anything 1299 00:41:23,460 --> 00:41:26,640 slightly more serious than that other 1300 00:41:25,500 --> 00:41:27,720 than that I'm happy to take questions if 1301 00:41:26,640 --> 00:41:29,460 anyone has any questions and my computer 1302 00:41:27,720 --> 00:41:30,720 keeps cooperating but thank you for 1303 00:41:29,460 --> 00:41:32,400 listening apologies for the tech issues 1304 00:41:30,720 --> 00:41:39,540 you've been a great audience regardless 1305 00:41:32,400 --> 00:41:41,520 [Applause] 1306 00:41:39,540 --> 00:41:43,220 uh thank you Paris that's great and we 1307 00:41:41,520 --> 00:41:45,240 should apologize 1308 00:41:43,220 --> 00:41:46,260 presented in this conversation center so 1309 00:41:45,240 --> 00:41:47,940 many times and something's gone wrong 1310 00:41:46,260 --> 00:41:48,900 every time but luckily the next day 1311 00:41:47,940 --> 00:41:50,599 people are here because they're actually 1312 00:41:48,900 --> 00:41:55,520 good at their job 1313 00:41:50,599 --> 00:41:55,520 uh any questions for Paris yes 1314 00:41:57,000 --> 00:42:00,359 anyone 1315 00:41:58,400 --> 00:42:01,560 I was just wondering do you know if 1316 00:42:00,359 --> 00:42:03,540 there's any performance differences 1317 00:42:01,560 --> 00:42:05,460 between GD script and C sharp C sharp is 1318 00:42:03,540 --> 00:42:07,440 significantly more performant 1319 00:42:05,460 --> 00:42:08,760 um you can also Bridge it to cs plus and 1320 00:42:07,440 --> 00:42:09,660 all sorts of crazy stuff 1321 00:42:08,760 --> 00:42:11,400 um 1322 00:42:09,660 --> 00:42:12,660 I say it's significantly more form that 1323 00:42:11,400 --> 00:42:13,800 is because that is strictly true whether 1324 00:42:12,660 --> 00:42:14,940 that actually makes a difference when 1325 00:42:13,800 --> 00:42:16,800 you're building a silly little video 1326 00:42:14,940 --> 00:42:19,940 game is another question look at this 1327 00:42:16,800 --> 00:42:19,940 it's just working perfectly now 1328 00:42:23,599 --> 00:42:28,800 Unity when would you choose to use color 1329 00:42:27,119 --> 00:42:30,119 until recently I would not have chosen 1330 00:42:28,800 --> 00:42:32,160 to use godo for a professional project 1331 00:42:30,119 --> 00:42:33,420 so we build games for a living I've been 1332 00:42:32,160 --> 00:42:35,700 doing that for 15 years I would not have 1333 00:42:33,420 --> 00:42:36,720 chosen good o until recently 1334 00:42:35,700 --> 00:42:38,880 um 1335 00:42:36,720 --> 00:42:41,820 I would not choose this HDMI cable slice 1336 00:42:38,880 --> 00:42:43,920 this through I'm not good as I've got 04 1337 00:42:41,820 --> 00:42:45,780 if you want to make a 2d game it is as 1338 00:42:43,920 --> 00:42:47,280 good or better than any other 1339 00:42:45,780 --> 00:42:49,800 proprietary options 1340 00:42:47,280 --> 00:42:51,420 if you want to make a 3D game it really 1341 00:42:49,800 --> 00:42:54,480 depends on what you're doing 1342 00:42:51,420 --> 00:42:56,760 it is a lot Messier in the 3D space than 1343 00:42:54,480 --> 00:42:58,500 it is in the 2D space simply because God 1344 00:42:56,760 --> 00:42:59,280 as I understand goddess started as a 2d 1345 00:42:58,500 --> 00:43:02,099 engine 1346 00:42:59,280 --> 00:43:03,240 and they kind of added 3D features so it 1347 00:43:02,099 --> 00:43:05,520 was an afterthought in terms of the 1348 00:43:03,240 --> 00:43:07,319 architecture it works great it's very 1349 00:43:05,520 --> 00:43:08,520 powerful you can functionally make 1350 00:43:07,319 --> 00:43:10,079 anything in all of these game engines 1351 00:43:08,520 --> 00:43:12,300 now they're all equivalent feature wise 1352 00:43:10,079 --> 00:43:13,980 if you're willing to put the work in but 1353 00:43:12,300 --> 00:43:15,900 goto makes 2D games a lot easier than 1354 00:43:13,980 --> 00:43:17,099 Unity right now in my opinion and it's 1355 00:43:15,900 --> 00:43:18,839 got a better feature set it's also free 1356 00:43:17,099 --> 00:43:20,400 and there's like 100 megabytes of RAM 1357 00:43:18,839 --> 00:43:22,500 and 100 megabytes to download and 1358 00:43:20,400 --> 00:43:24,000 doesn't require licensing servers and 1359 00:43:22,500 --> 00:43:25,920 all sorts of garbage 1360 00:43:24,000 --> 00:43:27,420 practically the only consideration where 1361 00:43:25,920 --> 00:43:28,440 you would want to use Unity over Godot 1362 00:43:27,420 --> 00:43:29,640 for a 2d game that you were starting 1363 00:43:28,440 --> 00:43:32,040 right now is if you have an established 1364 00:43:29,640 --> 00:43:33,540 team with unity knowledge or and this is 1365 00:43:32,040 --> 00:43:34,800 a big or you are deploying to a 1366 00:43:33,540 --> 00:43:37,079 proprietary platform like the switch 1367 00:43:34,800 --> 00:43:39,359 Xbox or Playstation where you currently 1368 00:43:37,079 --> 00:43:41,760 for Myriad Technical and legal reasons 1369 00:43:39,359 --> 00:43:43,319 godo makes it difficult 1370 00:43:41,760 --> 00:43:44,579 because basically those platform holders 1371 00:43:43,319 --> 00:43:45,900 require that you certify the code you're 1372 00:43:44,579 --> 00:43:47,280 running on them the open source thing of 1373 00:43:45,900 --> 00:43:49,079 God oh can never be certified the same 1374 00:43:47,280 --> 00:43:51,359 way as things so you need a proprietary 1375 00:43:49,079 --> 00:43:52,440 Fork of goto which is licensed 1376 00:43:51,359 --> 00:43:54,540 differently to go through the certain 1377 00:43:52,440 --> 00:43:57,000 process of Microsoft Nintendo it's the 1378 00:43:54,540 --> 00:43:58,020 user proprietary problem there are 1379 00:43:57,000 --> 00:43:59,339 companies that have special license 1380 00:43:58,020 --> 00:44:00,480 versions of Grotto will do that porting 1381 00:43:59,339 --> 00:44:01,380 for you so if that is actually a thing 1382 00:44:00,480 --> 00:44:02,579 you can still solve it's not 1383 00:44:01,380 --> 00:44:06,180 insurmountable 1384 00:44:02,579 --> 00:44:11,240 not great yeah are these oh sorry oh 1385 00:44:06,180 --> 00:44:11,240 sorry my bad I broke the rules sorry 1386 00:44:11,760 --> 00:44:15,300 um let's go with this one 1387 00:44:13,380 --> 00:44:17,400 first second 1388 00:44:15,300 --> 00:44:18,780 my fault sorry 1389 00:44:17,400 --> 00:44:21,359 good 1390 00:44:18,780 --> 00:44:22,859 um so I've been following Glo Loosely 1391 00:44:21,359 --> 00:44:25,200 for a long time and 1392 00:44:22,859 --> 00:44:26,700 back in the day there were bindings for 1393 00:44:25,200 --> 00:44:27,540 other languages used with the Godot 1394 00:44:26,700 --> 00:44:29,520 engine but they're always kind of 1395 00:44:27,540 --> 00:44:31,020 cumbersome has that changed with Judy 1396 00:44:29,520 --> 00:44:33,480 native and stuff has it gotten a bit 1397 00:44:31,020 --> 00:44:35,760 better or are you still kind of 1398 00:44:33,480 --> 00:44:38,099 struggling it's a little bit better it's 1399 00:44:35,760 --> 00:44:39,540 more mature in that they've like taken 1400 00:44:38,099 --> 00:44:42,060 the weird janky thing they had for years 1401 00:44:39,540 --> 00:44:44,520 and it's now got an ecosystem 1402 00:44:42,060 --> 00:44:45,660 so it's a kind of a janky ecosystem so 1403 00:44:44,520 --> 00:44:48,180 it's better than it used to be but it's 1404 00:44:45,660 --> 00:44:49,619 still not great uh if you are binding C 1405 00:44:48,180 --> 00:44:51,119 sharp stuff from like the whole 1406 00:44:49,619 --> 00:44:52,440 world.net that's actually really good 1407 00:44:51,119 --> 00:44:53,400 that works great 1408 00:44:52,440 --> 00:44:55,319 but if you're trying to do anything else 1409 00:44:53,400 --> 00:44:57,960 a bit fiddly yes 1410 00:44:55,319 --> 00:45:01,800 I was just wondering if you have run 1411 00:44:57,960 --> 00:45:03,540 this workshop with kids and how it how 1412 00:45:01,800 --> 00:45:05,579 that works or what age groups it works 1413 00:45:03,540 --> 00:45:06,900 with your experience with that look I'm 1414 00:45:05,579 --> 00:45:08,040 on this I haven't run anything we've got 1415 00:45:06,900 --> 00:45:09,480 it for this is the first audience I've 1416 00:45:08,040 --> 00:45:11,339 spoken to God before about just because 1417 00:45:09,480 --> 00:45:12,480 it's so new uh We've taught a lot of 1418 00:45:11,339 --> 00:45:13,859 kids game development with a lot of 1419 00:45:12,480 --> 00:45:15,720 different Technologies kids pick it up 1420 00:45:13,859 --> 00:45:17,940 from like seven years old and eight 1421 00:45:15,720 --> 00:45:19,859 years old and above they're pretty Savvy 1422 00:45:17,940 --> 00:45:21,300 um I would recommend if you're teaching 1423 00:45:19,859 --> 00:45:22,740 kids Godot use GD script just because 1424 00:45:21,300 --> 00:45:24,480 it's one program you'd have to explain 1425 00:45:22,740 --> 00:45:26,579 jumping out to vs code 1426 00:45:24,480 --> 00:45:28,020 and like kids don't care about vs code 1427 00:45:26,579 --> 00:45:30,000 extensions in the marketplace and 1428 00:45:28,020 --> 00:45:31,200 installing the c-sharp it's just kind of 1429 00:45:30,000 --> 00:45:32,880 a nightmare you don't need whereas GD 1430 00:45:31,200 --> 00:45:33,839 script is just like I would show you if 1431 00:45:32,880 --> 00:45:35,040 my computer was actually doing anything 1432 00:45:33,839 --> 00:45:37,380 of use 1433 00:45:35,040 --> 00:45:38,640 GD script is all in the goto editor it 1434 00:45:37,380 --> 00:45:40,500 has a text editor inside the god already 1435 00:45:38,640 --> 00:45:42,540 so when you click the script it opens 1436 00:45:40,500 --> 00:45:43,800 that in in it's got autocomplete it just 1437 00:45:42,540 --> 00:45:45,119 works the documentation is built in 1438 00:45:43,800 --> 00:45:48,720 there's a pane you can open it's great 1439 00:45:45,119 --> 00:45:50,520 but it's a weird propriet 1440 00:45:48,720 --> 00:45:52,319 it's a weird proprietary language that 1441 00:45:50,520 --> 00:45:54,900 doesn't exist anywhere else but it's 1442 00:45:52,319 --> 00:45:57,300 fine for teaching kids 1443 00:45:54,900 --> 00:45:59,640 um has you have you or your team uh 1444 00:45:57,300 --> 00:46:02,640 looked at the uh effort that would be 1445 00:45:59,640 --> 00:46:07,619 going into refactoring a project from 1446 00:46:02,640 --> 00:46:10,200 Unity to uh Godot and uh I guess just 1447 00:46:07,619 --> 00:46:13,140 the interoper operability at the moment 1448 00:46:10,200 --> 00:46:14,460 between the two um look refactoring a 1449 00:46:13,140 --> 00:46:15,599 project is basically a nice way of 1450 00:46:14,460 --> 00:46:17,160 saying you would have to rewrite it from 1451 00:46:15,599 --> 00:46:19,319 scratch so moving between game engines 1452 00:46:17,160 --> 00:46:21,839 it's basically completely right that 1453 00:46:19,319 --> 00:46:22,920 said Unity C sharp got O C sharp of 1454 00:46:21,839 --> 00:46:24,359 course if you have some underlying 1455 00:46:22,920 --> 00:46:27,000 libraries that I'll see Sharp that's 1456 00:46:24,359 --> 00:46:28,319 just code that will work so if you 1457 00:46:27,000 --> 00:46:29,940 abstracted your game to the point where 1458 00:46:28,319 --> 00:46:31,200 you could just call some library to ask 1459 00:46:29,940 --> 00:46:33,180 it what you needed to do then maybe you 1460 00:46:31,200 --> 00:46:34,500 could Port it relatively simply but so 1461 00:46:33,180 --> 00:46:36,060 much of a game engine is assembling 1462 00:46:34,500 --> 00:46:37,020 things in some sort of visual sense in a 1463 00:46:36,060 --> 00:46:39,180 scene that you would still have to do 1464 00:46:37,020 --> 00:46:40,319 all that in Godot and there's no reason 1465 00:46:39,180 --> 00:46:43,440 to automatically translate that because 1466 00:46:40,319 --> 00:46:44,579 that would just be weird so you could do 1467 00:46:43,440 --> 00:46:46,260 it but I wouldn't recommend it it's 1468 00:46:44,579 --> 00:46:48,720 basically a rebuilt from scratch 1469 00:46:46,260 --> 00:46:50,400 um yeah yeah 1470 00:46:48,720 --> 00:46:52,200 um I asked this question as a mobile app 1471 00:46:50,400 --> 00:46:54,540 developer who's never done games yeah 1472 00:46:52,200 --> 00:46:56,220 but I have heard that uh Unity is a bit 1473 00:46:54,540 --> 00:46:58,859 of a pain in terms of Version Control 1474 00:46:56,220 --> 00:47:00,240 and yes version management is goto any 1475 00:46:58,859 --> 00:47:02,460 better on that fantastic with Version 1476 00:47:00,240 --> 00:47:04,920 Control Unity um Unity until recently 1477 00:47:02,460 --> 00:47:06,660 was a pain it created these like big 1478 00:47:04,920 --> 00:47:07,859 weird binary blobs that basically 1479 00:47:06,660 --> 00:47:08,760 required you to use per force if you 1480 00:47:07,859 --> 00:47:10,800 wanted to use any sort of Version 1481 00:47:08,760 --> 00:47:12,300 Control then a few years ago the unity 1482 00:47:10,800 --> 00:47:13,920 remembered that git exists and started 1483 00:47:12,300 --> 00:47:16,319 supporting that in the editor 1484 00:47:13,920 --> 00:47:19,140 um and that's kind of fine now Gotto 1485 00:47:16,319 --> 00:47:20,819 natively supports skit so let's temp 1486 00:47:19,140 --> 00:47:24,660 fate here let's 1487 00:47:20,819 --> 00:47:26,579 when you create a new project in godo it 1488 00:47:24,660 --> 00:47:28,500 asks you 1489 00:47:26,579 --> 00:47:31,079 it relaunches when you create a new 1490 00:47:28,500 --> 00:47:32,880 project in dodo it asks you if you want 1491 00:47:31,079 --> 00:47:34,200 to create Version Control metadata and 1492 00:47:32,880 --> 00:47:35,400 currently only Sports git but I think 1493 00:47:34,200 --> 00:47:37,020 that's a modular system you can plug 1494 00:47:35,400 --> 00:47:38,220 stuff into so it makes it very neat to 1495 00:47:37,020 --> 00:47:40,079 work with Git 1496 00:47:38,220 --> 00:47:41,040 Works fantastically it could be 1497 00:47:40,079 --> 00:47:43,700 different than everything you can diff 1498 00:47:41,040 --> 00:47:43,700 the scene file 1499 00:47:44,420 --> 00:47:49,500 good timing 1500 00:47:46,819 --> 00:47:50,579 I think we could do one or two more I'm 1501 00:47:49,500 --> 00:47:53,880 happy to take a couple of questions I've 1502 00:47:50,579 --> 00:47:55,680 got otherwise uh yeah we will say thanks 1503 00:47:53,880 --> 00:47:56,220 again Paris and another round of 1504 00:47:55,680 --> 00:48:01,890 applause 1505 00:47:56,220 --> 00:48:01,890 [Applause]