1 00:00:00,000 --> 00:00:07,000 Hello, in this video tutorial I'm going to show you how to start making a simple game 2 00:00:07,000 --> 00:00:10,000 in which your character has to go through a maze 3 00:00:10,000 --> 00:00:12,000 so for that I'm going to need a maze 4 00:00:12,000 --> 00:00:16,000 so you just google for some picture and download it 5 00:00:16,000 --> 00:00:18,000 I've already done so 6 00:00:18,000 --> 00:00:21,000 and I'm going to upload it from my computer 7 00:00:21,000 --> 00:00:23,000 this is the picture 8 00:00:23,000 --> 00:00:33,000 now, you see this is too small so I'm going to make it this bigger 9 00:00:33,000 --> 00:00:36,000 I select it 10 00:00:36,000 --> 00:00:38,000 no, I'm sorry 11 00:00:38,000 --> 00:00:42,000 this is... let's undone it 12 00:00:42,000 --> 00:00:45,000 so I have to click here 13 00:00:45,000 --> 00:00:49,000 and then I can select it 14 00:00:50,000 --> 00:00:56,000 and I'm going to drag and drop from the handles there 15 00:00:56,000 --> 00:00:59,000 something like that 16 00:01:01,000 --> 00:01:04,000 maybe even bigger 17 00:01:04,000 --> 00:01:06,000 wow, something like that 18 00:01:06,000 --> 00:01:10,000 so then I'm going to remove this arrow here 19 00:01:10,000 --> 00:01:13,000 because this is the eraser 20 00:01:14,000 --> 00:01:20,000 instead of eraser I'm going to paint it white 21 00:01:20,000 --> 00:01:24,000 I'm going to pick this color from here 22 00:01:24,000 --> 00:01:33,000 and I'm just painting it white 23 00:01:35,000 --> 00:01:37,000 that's it 24 00:01:38,000 --> 00:01:46,000 I will leave the other arrow so I can use this color 25 00:01:46,000 --> 00:01:51,000 as a way to know that I've already finished the maze 26 00:01:51,000 --> 00:01:56,000 so first of all I will place my character at the beginning 27 00:01:56,000 --> 00:01:59,000 and I will make it smaller 28 00:01:59,000 --> 00:02:02,000 so it can fit inside the maze 29 00:02:02,000 --> 00:02:05,000 so at the beginning 30 00:02:05,000 --> 00:02:09,000 I will set size to 31 00:02:09,000 --> 00:02:13,000 let's say, try 50% 32 00:02:16,000 --> 00:02:19,000 it's not enough 33 00:02:19,000 --> 00:02:22,000 so let's say 30% 34 00:02:22,000 --> 00:02:25,000 no, it's still too big 35 00:02:25,000 --> 00:02:28,000 let's say 20% 36 00:02:29,000 --> 00:02:31,000 now it fits 37 00:02:31,000 --> 00:02:34,000 and now I will place it here at the beginning 38 00:02:34,000 --> 00:02:37,000 so I will use a goat 39 00:02:38,000 --> 00:02:41,000 now, as I want to control the motion 40 00:02:41,000 --> 00:02:45,000 we will be doing it with simple blocks 41 00:02:45,000 --> 00:02:49,000 like when right arrow press 42 00:02:49,000 --> 00:02:53,000 point right and move 43 00:02:54,000 --> 00:03:00,000 same thing duplicating for the left motion 44 00:03:00,000 --> 00:03:04,000 like left arrow pointing left 45 00:03:04,000 --> 00:03:07,000 then duplicate again 46 00:03:07,000 --> 00:03:12,000 up arrow pointing upwards 47 00:03:12,000 --> 00:03:16,000 and then down arrow 48 00:03:17,000 --> 00:03:23,000 point downwards 49 00:03:23,000 --> 00:03:30,000 now, as always if we don't want our cat to be upside down when moving left 50 00:03:30,000 --> 00:03:35,000 we have to select the rotation style left right here 51 00:03:35,000 --> 00:03:37,000 ok 52 00:03:37,000 --> 00:03:40,000 so 53 00:03:40,000 --> 00:03:42,000 that's it 54 00:03:42,000 --> 00:03:48,000 and now we can move it up down left and right 55 00:03:48,000 --> 00:03:52,000 now, see what's happening here 56 00:03:52,000 --> 00:03:54,000 well 57 00:03:54,000 --> 00:03:59,000 we want to go through the maze without touching the walls 58 00:03:59,000 --> 00:04:01,000 if touching the walls 59 00:04:01,000 --> 00:04:05,000 we would like it to get back to the starting point 60 00:04:05,000 --> 00:04:09,000 so we are going to use an if 61 00:04:09,000 --> 00:04:13,000 touching color under sensing 62 00:04:15,000 --> 00:04:19,000 and we select the color with the color picker 63 00:04:19,000 --> 00:04:22,000 like this 64 00:04:26,000 --> 00:04:30,000 so if touching the black wall 65 00:04:30,000 --> 00:04:33,000 then go to the beginning 66 00:04:33,000 --> 00:04:36,000 this is the starting position 67 00:04:36,000 --> 00:04:41,000 so we put it like that 68 00:04:41,000 --> 00:04:44,000 that has to be inside forever 69 00:04:44,000 --> 00:04:48,000 so we keep asking if it is touching or not 70 00:04:48,000 --> 00:04:53,000 we can place it under the green block 71 00:04:53,000 --> 00:04:55,000 and now 72 00:04:55,000 --> 00:04:58,000 if we move 73 00:04:58,000 --> 00:05:02,000 let's say we try 74 00:05:02,000 --> 00:05:09,000 to go through that one 75 00:05:09,000 --> 00:05:11,000 it's quite difficult, why? 76 00:05:11,000 --> 00:05:15,000 because our motion is in 10 steps 77 00:05:15,000 --> 00:05:18,000 so every time we hit an arrow 78 00:05:18,000 --> 00:05:23,000 the cat will change position by 10 79 00:05:23,000 --> 00:05:26,000 and so if it is close to a wall 80 00:05:26,000 --> 00:05:29,000 it will jump 10 pixels 81 00:05:29,000 --> 00:05:32,000 and then will go into the wall 82 00:05:32,000 --> 00:05:35,000 so we want more precision 83 00:05:35,000 --> 00:05:40,000 and for that we have to make the motion shorter 84 00:05:40,000 --> 00:05:45,000 so we will change this into 2 steps at a time 85 00:05:45,000 --> 00:05:51,000 so we can make a shorter motion every time 86 00:05:51,000 --> 00:05:54,000 and be more accurate 87 00:05:54,000 --> 00:05:58,000 so that way it's going slower 88 00:05:58,000 --> 00:06:03,000 but we can actually fit inside 89 00:06:03,000 --> 00:06:07,000 now, the animation is missing 90 00:06:07,000 --> 00:06:11,000 so we are going to program the animation 91 00:06:11,000 --> 00:06:14,000 and as we don't want it to interfere with the motion 92 00:06:14,000 --> 00:06:19,000 we will be doing it at a separate thread 93 00:06:19,000 --> 00:06:24,000 there we use the next custom 94 00:06:24,000 --> 00:06:30,000 and wait 95 00:06:30,000 --> 00:06:32,000 not one second, that's too much 96 00:06:32,000 --> 00:06:34,000 let's say 0.1 97 00:06:34,000 --> 00:06:38,000 and then that will be inside our frame 98 00:06:38,000 --> 00:06:41,000 right 99 00:06:41,000 --> 00:06:46,000 now it's animated on time 100 00:06:46,000 --> 00:06:51,000 and we can move it through that maze 101 00:06:51,000 --> 00:06:54,000 if touching the wall it goes back 102 00:06:54,000 --> 00:06:57,000 now if we don't want it to move its legs 103 00:06:57,000 --> 00:07:02,000 when it's not actually changing position 104 00:07:02,000 --> 00:07:08,000 we can make this happen only if 105 00:07:08,000 --> 00:07:13,000 we are hitting a key 106 00:07:14,000 --> 00:07:21,000 so if under ascension key press any 107 00:07:21,000 --> 00:07:25,000 then animate 108 00:07:25,000 --> 00:07:27,000 if we are not hitting any key 109 00:07:27,000 --> 00:07:32,000 it will remain with its legs unmoving 110 00:07:32,000 --> 00:07:35,000 so now we remove it and animate 111 00:07:35,000 --> 00:07:39,000 and that way we can make a simple maze 112 00:07:39,000 --> 00:07:44,000 now, how about knowing when we have already finished 113 00:07:44,000 --> 00:07:48,000 well, we can pick this color 114 00:07:48,000 --> 00:07:52,000 and use another if 115 00:07:52,000 --> 00:07:57,000 I can just duplicate this 116 00:07:57,000 --> 00:08:00,000 remove the go to 117 00:08:00,000 --> 00:08:07,000 pick the right color 118 00:08:07,000 --> 00:08:13,000 and say what's going to happen if we got to the end 119 00:08:13,000 --> 00:08:19,000 well, let's put a you win screen there 120 00:08:19,000 --> 00:08:26,000 so I'm going to create a new backdrop 121 00:08:26,000 --> 00:08:31,000 I've already got a white one from here 122 00:08:31,000 --> 00:08:34,000 so now I can use this 123 00:08:34,000 --> 00:08:43,000 let's fill it with some color 124 00:08:43,000 --> 00:08:46,000 for I to be able to pick some color 125 00:08:46,000 --> 00:08:48,000 I change the bitmap 126 00:08:48,000 --> 00:08:51,000 now let's pick some color 127 00:08:51,000 --> 00:08:53,000 this one 128 00:08:53,000 --> 00:08:56,000 and then fill it 129 00:08:56,000 --> 00:09:00,000 I will fill it with this color 130 00:09:00,000 --> 00:09:05,000 and now I'm going to 131 00:09:05,000 --> 00:09:11,000 type some letters into it with a different color 132 00:09:11,000 --> 00:09:14,000 one, whatever 133 00:09:14,000 --> 00:09:17,000 and then I type here 134 00:09:17,000 --> 00:09:26,000 you win 135 00:09:26,000 --> 00:09:32,000 and then let's make this bigger 136 00:09:32,000 --> 00:09:35,000 so we can select it like this 137 00:09:35,000 --> 00:09:44,000 and then place it somewhere like that 138 00:09:44,000 --> 00:09:46,000 you win 139 00:09:46,000 --> 00:09:52,000 now, this is backdrop number one 140 00:09:52,000 --> 00:09:59,000 I'm going to put it as number two 141 00:09:59,000 --> 00:10:03,000 so, at the beginning 142 00:10:03,000 --> 00:10:07,000 I want the backdrop to be number one 143 00:10:07,000 --> 00:10:16,000 so let's switch backdrop to backdrop one 144 00:10:16,000 --> 00:10:25,000 there it is 145 00:10:25,000 --> 00:10:27,000 you win 146 00:10:27,000 --> 00:10:31,000 this backdrop is backdrop number one 147 00:10:31,000 --> 00:10:33,000 this is number two 148 00:10:33,000 --> 00:10:37,000 so, here 149 00:10:37,000 --> 00:10:45,000 so, at the beginning 150 00:10:45,000 --> 00:10:50,000 ok, backdrop number one is not the same as the name backdrop one 151 00:10:50,000 --> 00:10:53,000 so, to make things clear 152 00:10:53,000 --> 00:10:56,000 we just rename this 153 00:10:56,000 --> 00:10:59,000 because 154 00:10:59,000 --> 00:11:06,000 this is not the name 155 00:11:06,000 --> 00:11:12,000 we cannot rename it 156 00:11:12,000 --> 00:11:14,000 I'm going to rename it here 157 00:11:14,000 --> 00:11:17,000 and say win 158 00:11:17,000 --> 00:11:19,000 that's it 159 00:11:19,000 --> 00:11:21,000 right 160 00:11:21,000 --> 00:11:23,000 so, now 161 00:11:23,000 --> 00:11:25,000 this is square maze 162 00:11:25,000 --> 00:11:27,000 good 163 00:11:27,000 --> 00:11:30,000 so, at the beginning 164 00:11:30,000 --> 00:11:33,000 switch backdrop to square maze 165 00:11:33,000 --> 00:11:35,000 and if touching color 166 00:11:35,000 --> 00:11:38,000 switch backdrop to win 167 00:11:38,000 --> 00:11:42,000 and then I would like to make the character disappear 168 00:11:42,000 --> 00:11:47,000 so, I will use a hide 169 00:11:47,000 --> 00:11:51,000 and, as always, if I use a hide 170 00:11:51,000 --> 00:11:56,000 I have to use a show for it to restart at the beginning 171 00:11:56,000 --> 00:12:00,000 so, now, when we start 172 00:12:00,000 --> 00:12:02,000 that goes like that 173 00:12:02,000 --> 00:12:08,000 and, once you get to the end 174 00:12:08,000 --> 00:12:11,000 if it touching walls, go back 175 00:12:11,000 --> 00:12:13,000 I'm going to cheat 176 00:12:13,000 --> 00:12:16,000 I cannot cheat the drawing here 177 00:12:16,000 --> 00:12:21,000 I'm going to cheat in this other window 178 00:12:21,000 --> 00:12:23,000 like that 179 00:12:23,000 --> 00:12:28,000 so, I check that if I get to the end 180 00:12:28,000 --> 00:12:32,000 now 181 00:12:32,000 --> 00:12:35,000 ok, it's not 182 00:12:35,000 --> 00:12:38,000 notice on that car 183 00:12:38,000 --> 00:12:41,000 probably that's because I haven't clicked the green flag 184 00:12:41,000 --> 00:12:43,000 now the green flag is clicked 185 00:12:43,000 --> 00:12:45,000 now I'm here 186 00:12:45,000 --> 00:12:47,000 and then I go there 187 00:12:47,000 --> 00:12:49,000 and you win 188 00:12:49,000 --> 00:12:51,000 good 189 00:12:51,000 --> 00:12:54,000 so 190 00:12:54,000 --> 00:12:57,000 that's the beginning of a maze game 191 00:12:57,000 --> 00:13:02,000 now we can improve it by including some other elements 192 00:13:02,000 --> 00:13:05,000 that will go in the next video tutorial