Transcripts
1. Introduction: In this class, we'll dive
into the exciting world of creating your very own top
down space maze shooter game. By completing this class, you'll understand how
some elements from popular games work like Hotline, Miami, Gallagher,
and Geometry Wars. We'll go through how to tackle play of movement
and ship creation. You'll also be able to design your own spaceship
and navigate for a space maze that can be as complex or as
simple as you want. We will add some sound effects, smooth animations,
and some tricky trap to keep the players
on their toes. Plus, we'll throw in
some special features so that you can make your
level as tricky as you want. Right at the end,
you'll be giving some challenges and
some bugs to fix. These are things that
you'll be able to conquer once you've
mastered the class. By the end of it all,
you'll be zooming through space with a very own
custom space game, feeling like a game
development pro.
2. Level / Character: Right. So here's our game. This is just a little example of what we're
going to be making. But as you can see,
our little spaceship, we can move around,
fly around in space, background moves, put
some mines there, and we can treat the
mine and explodes. Okay? So we're
going to be making this, let's get started. Right. Go to my games.
Go to new game. Then when you get to here,
just click on Empty Project. Let's get started. Right. So the first thing
we want to do is we want to create a wall
around the player, where we want it to go, where
we don't want them to go. Okay? So let's do that. Let's click on here, create. Do. Go to Edit sprites.
Let's go to brows. Go to fob sprites. This is still within the
free one, by the way, and I think it's in terrain.
Yes, it is terrain. We're going to click on
this top right one here. And so you got that. Remember,
you can create your own, you can draw on this
and stuff like that. You can draw whatever, if you look in the corner
there we see or you can upload your own
sprite and stuff. I was going to control Z just because I quite
like that one. Remember you can pick
different ones if you want, but I pick this
one because well, it looks a little bit more like space rock. Let's do that. D we go. The rock is there. For the properties and stuff, we want to keep this all solid. We don't really need to
change anything here because it's not going to really going to be
doing anything. It's just going to be containing the player. You
can call it wall. You can call it space rock. It's entirely up to you.
Let's just keep it to wall. But just remember to always type what the actual thing is. Type here, name it what it is, and the object, you
don't need to do that. Let's start off here.
Let's start doing this. I can zoom out with
the scroll wheel. And let's start making a level. I'm just going to make a
very simple one so far. I clicked on that if
you didn't notice. Click on it. You've got all
these different options. I click clone then this bit here says De cloneing
I'm just going to make a little
space here like that. So I want the player
to go up there. So you up a little bit. Maybe I want a slight corridor where the player can come in. Maybe they come in like that. Coming that way. Then the
player goes like that. I can use move to here, so that's the arrow,
that's select at Zoom. I'm just going to do the
mount the hand one here. Move that up. Let's
do this like that. Maybe we do another
thing here like that. Then we've got thing
here like this. There, I've made an x. Remember, you can make
whatever space you want. Maybe you're going to have
something in this corner here. Maybe we'll have a
a thing in here, and then maybe we'll
have something here. Remember, if you want
to add some more, you can just hover over a place and then hit delete
and it deletes it for you. Could do that, just
holding down delete there. I can click on
something else again. Click on Cl now I can do something like that. They come around
there, come there, and then they come around. So there go. We'll
have something here, so they have to navigate. Remember this is only
the first level, so we want it to be
relatively easy. De coning. Once you're happy
with your shape, it can be whatever you want. If you're not too
sure, then maybe it down on a piece of paper
and then copy of that. I'm going to go back here. We hit play. Obviously, this is a space. It doesn't
really do anything. We can't even move hit the controls because we need
to create our character. So we're going to do
that. So we're going to click anywhere, click Create. We're going to hit player, call it player because that's what we're
going to be doing. For physics, now we're going
to be making a spaceship, so we need to be
doing a few things. We need it to move, so we're
going to click on Movable, because it's in space,
we want to click click, should I say, fected by gravity. Because if I did do that, it would just fall down to the bottom when we don't
want to do that. We also want to have
the direction as up. So forward direction is up, and you'll see y in a minute. Default wise flow lab always
does it to the right. So we just want
to have it as up. So let's go back to Sprites. Now, this is the bit
where if you do not have a student or India account, you will have to upload your own sprites or
create your own. But as you'll see here,
it's very, very simple. So I'm going to continue as if you did have a student
or India account, but remember, you can just
create or upload your own. I'm going to go to
the sprites here, go to ships I'm going to
click on what's a nice ship. Let's click on that one. So I'm going to click on
that ship there. Obviously, there's a few
here that you could have, but for this one,
I'm going to click on that one there. Click on. There go. There's our
ship hit on play. Now it happens because, well, it's not doing anything. We have to put any logic onto
it, so we need to do that. So click on your ship, go to edit, go to behaviors. Go to behavior bundles. And these are a set
of bundles that the flow lab kind of provide you to sort of make
it a little bit easier. So what we want is ship
control, we click on that. Ship control comes on, and
it's already included. If we want to have
a look inside, so we click on the actual
bundle, click on pen. And then you'll see
what's happening here. And remember, if you did
the previous lesson, you'll notice that you've got
the play button down here, which actually plays
within this window, so you don't have to go out. So a few new nodes here
from our previous class. So left and right, when
you press these round, these are going to get
these buttons here, and it's going to
rotate this sprite. So that's what this node does. It rotates the sprite. Then when you press
up, it's going to get six, so it's
always a number, and it's going to push forward motor forward.
It's going to push it up. That's because if you
remember, in the physics, we had motion forward
direction up, didn't we? If we had it as right
and we pressed up, it would go right, so we
want to have it forward. Click on that. Now
if I press up as we move up and see
we move around, see our ship moves around. Still a bit float at the
moment, but we're fixed that. But as you can see, do that, we can actually
go to the side of the walls, and it
should stop us. There you go. It's
not very good. We're going to have to
add a few little bits in, and also the camera doesn't
actually follow us, but we're going to be doing
all that bit in a moment. Hopefully, you've got something like that working
on your screen. Okay.
3. Camera / Background: Okay. Right. So you've got your player and
you can move around. Now we're going to add
some camera movement and some background to make it look a little bit
more like space. So let's sort out
the camera first. So go into your spaceship. Click on Edit,
click on behaviors. And anywhere here, let's have a look and see
where camera is. I always get this bit messed
up components. There you go. It's in components in camera. Click on that node,
so it pops up, move that over there, so
it's a little bit easier. So if you click on camera, You'll see if I can move this across a little bit,
move that across. You'll see it lights
up a little bit, so you can see and you'll
see this little blue box. What we want to do is we want to make sure that to scroll and to y are selected because that's going to look
into the actual player, and you'll see all these numbers left top, right, and bottom. I want you to adjust your box, it completely covers
the entire level. Where is the yew we've
got about that there. That goes to about
there. Let's do that. Over there, and finally,
we do the bottom. Now obviously, it's going
to be different for each person. But
yeah, that's fine. Now, that's where the
camera is going to track everywhere in
this game, okay? So if we had it,
say, for example, let's say, dispit
here like this. Now, this is depending on your game mechanics on how
you want your game to play. Your ship will go all the way around here and stuff like that. But when it got to dispit here, the camera wouldn't
track, it would stop. And all the dispit here, the camera wouldn't
track, and then it would appear again here. Now, for this class, I want you to make sure that
you encompass everything in. Remember, when you
experiment at the end, you can start
playing around with maybe some hidden
bits in the game. Once you've done
that, click Okay. You can hit play down here. You can actually go
back into the main bit, but I'm going to hit play
down here and just show you. As I go around, the player can actually start going
around. There now. The ships a bit too fast, I think for what we want, we might need to adjust a speed, I think, because for me, that's a little bit too quick. Let's do that. Click
stop. Go a bundle. Let's change the rust
to I don't know, say four speed let's do, and let's do free there.
See how that feels. Remember, this is all
entirely up to you. Yeah, I quite like that.
That's quite nice speed. Obviously the more you hold it, the more it adds to the motor. But if we want to just
do a smite thing, it still moving,
I can see there. Obviously, when we
add more things, you are going to be able to notice that you actually
move in free space. But yeah, that's quite nice. I like that. That's fine. Now, if you noticed in this bit here, if
I can do it again, as I'm moving across, you only really know
that you're moving when you see the sides of the
wall. Let's try to fix that. Let's add some more
space elements. So go back into your
main screen here. Now, in layers at
the bottom here, I want you to click on that and I want you to click background. So at the moment, we've only
got the white background. We want to change that.
Let's do a few things first. Let's go to game levels. Now, we've done this
in the previous level in the previous class, sorry. It's white at the moment,
so let's change that. Click on the little white box. Remember, if you want
a different color, you click on the circle first and then the box inside,
but we just want black. So it doesn't matter
where you click on the outside bit because we
want to go straight to black. If you want it slightly blue, I guess you can
click on the blue bit and have it like that, but something quite dark. I'm going to go with a dark blue just because I mentioned it. So you've got that as
the deepness of space, but we still have
the same problem. If we hit play, obviously, we can now it looks a
little bit more like space, but we still don't know
that we're moving. I'm still hitting
play forward, sorry, and you don't know if
you're moving across. Only when we hear the
sides of the wall, do we know that we
are moving across, or we need to see them.
So let's change that. Right. So like I said, make sure you're in background, click anywhere in the space, click on Create where
it says new type, I want you to go start, go to Edit Sprite. Go back to the sprites
here, let's see. Let's go to background,
where is it? I think it's in projectiles. Sometimes it takes
a while to load, especially if you're
getting one thing here. That looks quite nice. That looks like a
little star there. It's in projectiles, but it looks pretty
much like a star. You see it slightly off
center going to move that in. Now, remember, you
can just do that by using this tool here, move the sprites,
put that in there. If I want to have maybe, I don't know, make it slightly white here and stuff
like that, and do that. Okay. I don't know how that works. Maybe have it all white there. It's like a white little star. You know. It's very easy
for you to draw that. If if you don't like it, then you can just click
on this and it goes back. I'm going to put
that in the center. Click Okay. You've got your little star there,
which is really cool. Let's put the star
in this corner here. Then I've got to click
I'm just going to put some random
stars everywhere. Try not to make it too
much of a pattern. Remember, don't put it outside. Just put it within this square here because that's what we're going to be repeating
in a moment. So have it like that. Like that. If you
don't like that, that seems too much of
a pattern down here. You can just after
you've done coning, you can move them a bit. Put that there, that goes
there. I don't like that one. I'm going to delete that
one. Put that one there. I got to delete that one. Maybe that goes over there. Delete that go in there. There you go. You can
really have some fun with how you're going
to do these stars. Looks more like a circle now. Let's have that there. Then I'm going to do
one more of it here. You've got your stars.
If you hit play, you got your stars,
which is pretty cool. They do move around. But the minute I go
out of the area, I said, don't put in. Obviously, the stuff in there,
so we need to fix that. Go back into your layers, go to game weld so that your
ship is all highlighted, all this is all highlighted. Now you can't actually highlight the stars because you're not
on the background layer. Go into your ship, go to where your camera is. And hit repeat background. And what you want is you also
want to change this power x to about, let's say 60. Let's just try 60. You can
play around with that. What PowerEx does is, well, I'll show you. I'll
show you what it does. 100% is basically what we've been showing you
before, and hit play. And the stars do repeat. But they just seem a bit
static, you know what I mean? Again, this is completely
artistic choice. It is entirely up
to you. But for me, it doesn't seem like there's
too much depth there. Okay? So Paralx makes the background move
slightly different, slightly different speed
to what the player is. Obviously, the more that
you put your parax down, the more extreme is. I'd say say 50 is
fine. Let's try 50. Now when we hit play, do you see how slightly it looks like it's
further away, doesn't it? And that's what we
want for stars because stars are very far
away. There you go. Now as you move around,
and you can start to see certain patterns like maybe
that bit repeats too much, so you might want to
reduce your stars. But as you can see, even if you're in a bit
of an open space, you know that the
spaceship is still moving. We're still going to populate
it with other things. But just like that bit there, if you don't hit the edge, you don't see the edge, you know that your player
is still moving. Then all you do is you get the player to go around here or and you can make them to navigate the maze
that you're doing. Remember, if you don't like
the speed, then obviously, you can change that. All right. Well, there you go. Parax
and camera movement.
4. Health / UI (user Interface): All right, so let's carry on
with other little bits now. So the first thing I want to
do is where I play the game, even though we change the speed, it kind of still seems
a little bit floaty. So let's change that, okay? So in your settings down here, you can obviously call your
game whatever you want, a space game or whatever. It's entirely up to you.
Where it says drag, I want you to put that
number to 20, I'll hit. Now, drag, as you
can imagine, K, opposite force on the player, okay? On the spaceship. Now I have a hit play, That's
the right type of drag, but because I reduced the frost, it's not so powerful now, so
I'm going to change that. So go back into bundle and change the frost to or I
don't know, let's say ten. Change that to ten. Let's
see what that looks like. That's not too bad. Maybe a little bit more. And it's very much
a It's very much a playing around game
where you kind of like how much trust you want to put in and how
much drag you want to do. Okay, that's quite nice. 20 makes a ship
still float a little bit. I can move around. I can whizz around the
level quite nicely, but I stop pretty soon. If you want your space ship
to be float, obviously, all you've got to do is reduce
that drag to I don't know, maybe 18, see what that's like. You might need to adjust
a frust bit more float. Okay? So it's entirely up
to you. So there you go. There's the physics drag
and adjusting the frost. And when you want to go
on to go out that bundle, just click on that
little green tick there. Excuse me, I clipped
on that by mistake. Let's do this thing where we actually get the players
health and stuff. Let's do that.
Need a few things. Right. First, in triggers,
we need a collision. Okay? You need a collision. We need two numbers in
logic and maths, one, two, I want you to position
them just like this, and this one is
going to be damaged. So you don't have to label
things for your nodes, but I highly recommend that you do as things get
more complicated. So these beginner like classes, maybe intermediate ones, you won't have to
worry too much, but certainly when you get into more complex flow lab tutorials or even really any game
engine that you're using, you really should start
labeling stuff because you get someone else in or you go back to a game after a while, you've gone back on holiday, you're going, what does this
do, or what does that do? This one here, if
you hit on label, we can just call it this damage. And then this one
here is going to be HP. Help hit points. So move that across
a little bit. So what we're going to do is damage is going to be minus one, and HP your total HPs
going to be free. And then collision, you click on collision and it says, any type, we want wall of
rock, space rock, or whatever you call
it. So what happens? Okay. Put that
across over there. Collision gets number one
minus one, should I say, it gets minus one
and it adds it, which is going to minus
to your total HP, and you can see that work here. If I hit on play here, if I hit the wall, see how HP is now two
and stuff, we want that. Obviously, we can
have it so that the spaceship can
actually go minus one, which we don't want. Right. Let's change a few
little things as well. So go to GUY, and go to bar, we're going
to put that in here, we're going to put out to bar. Then current level is free, and then maximum level
is free as well. Basically you start
off with free health, but you can never go
beyond free health, should I say, if you want
to add something where you can get more health,
the bar won't show. All right. And then
for the color, you can just choose
whatever color. I like to do maybe
a light green. Let's do the inside green as
a lighter green like that, and then the outside bar can
be a slightly darker green, so they're going to go. You see the bar is just there. If you go outside, go to your user interface,
you'll see the bar here. You can just move that
across move that down and somewhere in the bottom
there maybe in the middle. You can play that and
you can see it work. Move moves around. We hit it. Our bar goes down. That's I hit it twice there. Let me do it show you again. If you hit it again, if
you hit it too much. One back. To Okay. Free. Yeah.
Cool. That works. But we don't want
you just to have a zero bar like zero health bar. We want the game to reload,
we want it to reset. Let's do that. Make sure
you're into game weld. Go back into your ship. You've got your little bit here. We want to add some
filters and stuff. We want to do some things. We want to go to logic
and mas, go to filter. We also want a timer. We want a time here like
that per time of there, and then we want game
flow. Game flow. So filter, timer, and game flow. Well, we want load level,
but it's in game flow. So what happens, out goes to in and we want this
to be less than one. If it's less than one, it's going to pass this little test. It's going to pass it and it's going to start
this little timer. Ten is fine. We just
keep that at the moment. And then once that
timer is done, it's going to go to the level, and we're just going
to do restart current. Now, I'll show you how it works, if I hit play because
that's all good there. Player hits that. Health goes to two, one. Timer starts and resets.
You'll see it working there. So when in there,
time will reset, and then after ten
was it 10 seconds, I think, or ten
frames, it resets. Right. It's a little bit. Well, there's not
too much excitement there because we want it to
have a little bit of sound. So let's do that. So let's
go about doing some sound. So we need to go to
components, go to sound. And put that up here. Every time we get
damage, hits damage, we're just going to
play this sound here. So go to sound effects, choose a sound, go to effects. We're not going to be using the premium thing at the moment. We're just going to be going to impact and just look at a sound. That's quite nice. That sounds like don't sound very
good on your spaceship, but you can pick any
sound that you want. Okay. So I'm going to clue four. And I'm just going to
reduce that sound to maybe, I don't know, 55%, yes,
it's a little bit. So there you go. And now, as I fly around and I hit
a wall. There you go. See? And then resets
the game. There you go. We've done all of
that there. You can play your game properly, see if you can get to
the bits where you want the players to get to and see how
hard or easy it is. Remember, we're
going to be adding some extra little bits
into this game. Okay.
5. Traps / Animations: All right. So as you go around
your little level here, it's okay, but let's
actually add some traps, make it a little
bit interesting. But before we do that, I want to just address
something before. As we did in the previous
video when you hit a wall makes a little
sound and stuff like that, but it still seems quite
static, doesn't it? It seems like, you know,
it just kind of stops. So let's change that. We can
change that very easily. So if we click on your
spaceship, click on edits, go to physics, it says
bounce, make that 100%. Now, when we hit the wall, see how we bounce off. It's a little bit
easier, isn't it? It's a little bit
nicer. There you go. And then we reset. It just
makes it a little bit better. If you don't want to have
that much of a bounce, you can obviously reduce it, but I quite like 100%,
so it's quite good. Plus with the drag
that we've got, which is 18, it
works quite well. Right. Let's add a little
trap. Let's add a little mine. Let's move our ship down there. Anywhere where there's
a little bit of a gap, which is well, anywhere. Let's click on Create
and let's click on mine. I mean, I'm going
to put it here, but you can just
call this a trap. It's entirely up to you, we're just going to have this mine. Then we're going to go to
Edit Sprite and we're just going to again, mines. We're going to go
to the ones that's in the student or Indie ones. But remember, you
can just create your realm that's not
very complicated, so you can probably just stop the video and just duplicate it, and we're going to
click on this one here. That's what that
mine one looks like. So that's what we want
the mine to look like. Okay. So we need to
do a few things. We need to do a bit of
animation into this one. Into this bottom bit here
it says animation editor. We're going to click
on Pick animation, and we're going to do create, and we're going to call
this active, active, right? So if you've ever done
animation before, maybe you've done some
other video tutorials or you watch stuff on YouTube. Animation is just
a set of frames, set of frames very
close together to make things look like
they're going to move. That's what we're going
to be doing here, but we're only going to
be doing really two. We've only got one frame here. I hit play doesn't do anything, so we're going to
add another frame. Click on this plus sign.
Now we've got two frames. Now, if a hit plus, again, you can see it scroll through, but nothing's happening here because they're
exactly the same. I want you to click on
the second one here, And then I just
want you to recolor bits into this sprite here. I'm going to click on the
little tool box here, and I'm just going to make
these bits a bit more red. Maybe that's going to make
this slightly lighter. And then I'm going to make
this bit here. Like that. This is when the mine is active. I click on that, I actually want the middle bit as
well to be active. What do they have there? I
have that bit there I'll have alternate that'd be
quite nice. Like that. Your mine is like that.
But it's a bit too quick, so we're just going
to add a few more. Click on the first frame again, click on this plus and it will dupliclate that first frame. Then click on the second
frame and then hit plus. Now we've got a set of four
frames like this. Heck, four. Let's change that to delay
a free. There you go. We increase that to
five goes a bit slower. I think five is quite nice. Maybe six six is fine. You've got active. There you go. Because what we're
going to have to do is we want it to play the
full set of animations, which is basically just
one two free four frame, and then I want it to
do something else. So up, we're going to
do another animation. Click on Active. Click on created and explode. Explode. For this one,
we just want one frame. We're going to go to brows. Go back to projectiles. We're going to click
on this thing here, that's all we're going
to have for that one. We just want one
frame with that. So click. Right now we want to have this
all active together. I'm going to put
the ship down here because we're going to
be doing some stuff. I'm going to be doing a few
things here to make sure that and then we're going
to put them all together. So I'm going to put
them all together, and then I explain each bit. We want always, which
is in triggers. We want we want it. We want a proximity. I have proximity here. We then want a switch, which we have here. Then we need a number. We have a number number there. Then that's the main bit, but then we still want to have the animations
and everything. Let's have that. Let's go to the animations that
animation properties. So we want two animations. We have one animation
there, one animation there. Put this all in a
line like this. We want sounds to happen for
each of those animations. We want sounds in each one. Okay. Where are you sound? I always I had areas
in components. They go, have another
one, sound, and sound. Let's just do this first. We'll do the other bits
afterwards, right? We want to connect all
of these things up. For the always, we want
to go out to check, because we're always want to be checking what's happening here. Click on proximity and you'll
see a little circle a here. Do you see that little circle appeal when you click on it? What we want is we
want it to select player because we want it to trigger when the
player gets too close. We want that to be
about, I don't know, let's say 65, let's have that. Let's do 65. When the players, if
I hit play, actually, you can see this, it's always checking to see if the player comes in and that's
what we want it to do. So once it checks in, we want it to get the x axis. X is left and right,
y up and down, but it doesn't really
matter which one you pick, but just for argument's sake, we're just going to
pick x for here. And we're going to have
this switch to on. Now, what switches
do is just like your switch at home is
if the switches on, you're able to pass
things through it like electricity is able
to pass through it. But if it's off, then
obviously it won't. So that's what we want to do because we don't want
this to always trigger, we want it to be able
to turn itself off. So that's exactly
what you can do. So out goes to off, so it's going to
turn itself off. But also, it's going to
get this number here, and this number is
just going to be one. And if you noticed
here, it's got animation active and it's
got animation active. We don't want both of
them to be active. This one active is
fine, but this one, I want this to be explode, we're going to have loop
animation for that one. So loop the animation
for this one, and this one here
is absolutely fine. So this one goes to start, it's going to act, it's going
to do those four frames. And then sorry, that's wrong. Once you've done a mistake,
by the way, again, if you haven't done
a previous class, go over a line, it goes red. Click on it and
you can delete it. So it's play, done or go to. But what we want is
once it's done playing, we want it to start
the animation, we want it to explode, okay? And what we also
want it to do is play these sets of sounds here, which we haven't done yet. So first sets of
animation, right? So what do we want? So we
click on the first one here, which is going to
be the active one. So go choose sounds, go to effects, go
to where is it? We want alert. So
That's quite nice. Let's have that, so
we have the alert. So it's like it
alerts the sound. Move that down to say, I don't know. 50. Then for the second one for
explode, let's go to here. Let's go to impact. Have that five. So what's going to happen is when the
player gets too close, it's going to keep on checking to see if the player
is near there. If it is near there, it's going to turn
this switch off, but also let it go through so it can't
be activated again. It's going to play that
little flashing animation, and it's also going
to play this sound. Yeah, I put this
volume down to 50. And then once it's
done, it's going to play the explode animation, which we're going to loop,
but it's only one frame, but we're going to animate
that a slightly different way. And again, I'm just going
to put that down to about 65 is five. Okay. So there's a few
little things that we need to do before we
finish up with this. When I go to logic and maps, and I want you to do s then
for the final little bit, we need to have a size and
we need to have a destroyer. Let's do that. Let's go to
properties and have size. Then we want a
destroyer Destroyer. Remember, destroyer
destroys the sprite. What do we do? This one starts. What does an do? Eases one number
to another number. We're going to click
on a little box here, we want it to ease
from 100 to about 600. Where it says quadric, we just want that to be back. Okay. And then seconds
is how long that actually takes to play out. What we want is it to
be relatively quick. So one is fine, but I'm going to put that as
10.5, that's way too quick. 0.5. That's going to
go out to the size, and that's going to be
the size of the sprite, which is now the explosion. Yeah. And then once it's done, we're just going to
hit destroy, okay? It does we haven't affected the mine to affect the play yet, so we can actually see
this all play out. If I move this all up here
and you can see all of this work. It's
going to trigger. Go. See how it does that. But what we can do is we can have this ease out a little bit, so this is easy. Again, it's an animation term, so it eases into the animation
and then plays normally, or you can have it ease out of the elevation so it
slows down at the end, or you can have easy ease out. So we're going to have
ease out. That's fine. I think for the proximity, I think that's a b's do it as, I don't know, 85, see if that's a little bit
better for the player. Yeah. Nice. See how
that's a bit better. Now again, if I want the
animation to be slower. Like I said, how we
had it as one before, this means the animation of
the Ease will be slower. But I think 0.5 works a bit better because it is
supposed to be an explosion. If you notice, the ship does get pushed back slightly
a small amount, see? It gets pushed back slightly, and we want that
because we want it to trigger the player's health. One final thing before we do
that, we just go to physics. We're not going
to make it solid, but we are going to
enable collisions. So it play. There you go. Now it's a push the player back. It's entirely up to
you what you want, but I recommend
that you do not hit solid and enable collisions
because for future things, we want it to sometimes
flow can be a bit funny, so you need to st things a certain way in
order things to work. Once you've done with that,
let's start populating them. Let's do a law and
let's have a min. Let's have maybe
a few minds here. Let's move up this bit here
have a mind like that. The there and up here. Done Click play. Now you can actually
go through it again. So if you get too close. Obviously, we haven't
done the damage yet, but we're going to be
doing that in a minute. But you can see you can navigate through your maze and you can make it as
complicated as you want. Maybe make the things
a little bit narrower. There you go. You can
play your little game. Try to avoid the traps. Obviously, we got hit there. But it doesn't actually take
anything from our health, so we can actually fix that. Let's do that, click on
here, click on behaviors. Where this collision. We're just going to have another collision. And we're just
going to have mine. And then that gets that. Now, I move that up. See, this is where you can have the corridors to be a little
bit closer we got here. There you go. You can
make your game start to get a little bit
more complicated, y?
6. Projectiles / Music : S. Right. Let's make things a little bit more
exciting, shall we? But we need to clear a few
little things up first. First, go into your spaceship. Go into your behaviors. Let's do put some
things in the bundle. Just like a bundle up here. I'm going to move this up here. I want you to select
this tool here, the height of the
selecting tool. I want you to click on
it, and then select ep here where it says bundle, want you to hit
on bundle, and it puts everything here in the
thing that says custom. I want to click on custom
and I just want you to call this health slash loss. Now, everything's
there. If you click on open bundle, it's
everything's there, it just makes things
a little bit neater, because we're going to be adding something else for the next bit. Let's go out and let's
create the laser first. Anywhere here, click on
create, call it laser. Yeah. Go to physics, we need to make it movable, we don't want it to be
affected by gravity. But we also want the
forward direction to be up because it's going to be always facing up because the way that the sprite
we're going to be using. Have that like that.
Go to edit sprite. Again, I'm just going to
be using one from the paid to the teacher one
student one, or the Indie one. Projectiles. But again, you can choose whatever,
which one you want. I'm going to click
on this one here. It's very easy to do. Going to center it up a little
bit like that. Very easy to make. Again, just pause the video, you
can make it yourself. There's no problem. We've
got the little laser here. We don't actually want
this in the world. We only need to create it, and then we can actually
delete it. Delete it. Remember, it's still
in our library here. It's still there. We actually need a way to trigger this now. Let's go to edit
for your ship now, we're going to go to behaviors. We're going to do a new bundle. Create a new bundle for us. We're going to call
this laser, and we're going to open the bundle. We need a few things
for this bundle, which I'm going to go
through with you now. What do we need? We need a,
we need to have a trigger, so we're going to have
a keyboard down because we're going to have the
space bar to be our trigger. Then we need something called an emit we're
going to emit something. We're going to emit that
laser which we just created, and we also need
the sound as well. Down goes to emit. And then out goes to play. Keyboard is going
to be space bar, Emit is going to be the laser, which we've just created. In terms of the actual settings, we just want it to expire
after 15 and emit force of 12. Expire after 15 and
emit force of 12. You can emit the origin there. I think the middle
there is actually fine. But what we want it
to do is rotate with objects. We've got that. We've got the laser. Then for the actual laser sound,
let's just go here. Let's see what we've
got, that's good. Let's have a look,
see what's there. Let's go to eight bit sounds. Let's go to weapons. Let's go to laser. There you go. I think
the number is good. Number phrase is good.
Then let's make that 50. If we go there, play, Now, if you notice the laser doesn't really doesn't really disappear
when it hits something. So we need that to happen
that way because then you can just basically
shooting a projectile instead of a laser,
so we can fix that. Let's go to our library. Go to laser, go to behaviors, and just do a simple thing, collision with anything
Destroys itself. Hits anything, destroys
itself. Now when we do it. All we need to do now is
have the mine trigger. Go to your mine. Go to
edit, go to behavior. We've already got this
already set up to be honest. But all we need is
go to collisions, go to hit laser,
that should work. We go up here. Okay. Boom. And now we
have a way to actually get through our level without
BN destroyed mines. Was an air mine stand. Too low. Now, when you hit the wall, it's still little bits like static, I think
we should fix that. Let's do that
easily. Let's create a little sprite, do create. Let's call war hit. For physics, I just want
to change all of this off because we just want it
to be a bit cosmetic really. Go to edit sprite, go to browse. Go to something that
looks like a bang. It's hit in something.
I think we used. Let's just use that that. We've got that there,
and then hit delete. Then just like we
did with the lasers, we're just going to go to health and loss. I'm going to do a m. But we're not going
to have any force. Object to emit is
going to be war hit. Let's see how that works. A, Okay. Let's have that. Change that to and then let's have
rotate and scale of object. Make sure you click the
middle of the button there. Make sure when you
do you hit a origin. It was already there before, but you need to make sure
that you click on the middle there so that it actually
goes in the middle. It's important to
do. There you go. Now, it looks like a bank. There are. S. We've got a
way to shoot the mines, and we've also got a way to hit a little bit of the
spaceship as well, which is pretty cool. Let's have a way now to add some sound because
at the moment, it's a little bit, a little
bit static, isn't it? So let's do that. Let's
have a once node here. Let's have a sound. Let's have a as well. So We're going to have it like this and
a little bit triangle. So once plays the sound, but it also starts this little thing here,
it's going to do a volume. Now, all of the things
are different here, but we're going to have stein just because it goes
back and forth, and we're going to ease in. From zero to about 20% volume,
I think, would be good. Then we're going to
have some sound, and we're going to pick
a nice little sound, which is just going to be
themes and stuff like that. Let's do that. Let's
go into sounds. I think a good one
would be exploration. Nice. So as you do that, what we're going to see
is it's going to play. Do you see how the
sound slowly went up? Yeah. There you go. So you've got all of that
there, which I think is quite nice progression for
the sound and everything. Right. And now we can
sort to play a game. Again, Sans there. Again, and see if you
can get together bit. Spaceship is got hit there. Do close. It's okay. We're done for that video.
7. Next Level: A All right. So we pretty much got
our space game there. We need to do the next level
really, let's do that. Let's go to game level, go to new level here. Now if we load this
up, obviously, it's going to be
exactly the same, so we need to change that. Let's make the
background, I don't know. Let's make it slightly
red, stuff like that. Go back to your thing here. You first level, level one, level two level two. Let's go to background, and I'm just going to
highlight all the stars here. Click on stars, click Copy. Go to level two, go to background, paste. There you go. You've got
all the stars there. Let's move them into position. They're similar position there. Make sure that we
go to game world. Make sure that our
player is here. So there's add to
level. There you go. Then make sure that we add
some things to the wall. Just click on Library,
add the wall. That level, sorry. And
again, just do that. Now, just keep in mind
that you've still got the boundary of your camera. Okay? So this is
your boundary of you're going to be
your levels, okay? In future lessons, I will
show you how that be dynamic. But just for as it's only the second class
really for flow lab. We're just going to have
it static for each one. So yeah, just make
sure that you don't go beyond d box here when you're
creating your second level. Can make this one
slightly different. You can make this one longer, for example, if you
want to have that. You can have it all the
way up to here like that. What you can have is it's almost like you going
into a U shape, so you have to go into U shape here. So it's a bit like that. The player has to go
right round and that. Again, just make sure
that you click on your camera and you're
not out of bounds. I'm slightly out
of bounds there. I'd have to adjust that. I would move some of
this around like that. Maybe I do that here I do that, maybe here like that. Let's delete's holding down back space for these like that. Like I said, you're doing a lot when you do
your level designs. So we've got that
bit there, so just really from that
bit down we need. So is it from there,
so let's put all that. Probably do it like
that if you wanted to. That's a bit there. That should be fine. Let's see. Behaviors.
There you go. Is it within slightly out, but it's still going to
track the player because it's still within
the border because I can't actually go
onto that block. Okay. So there you go. So you've got the second level, but let's actually progress
to that second level. So let's go back
to the first one. And I would recommend maybe putting we're going to do a
portal to the next level. We're going to put that over
here somewhere. That there. But when you're
doing game testing, you don't always want to put it right at the
end of the level. Only at the end, you
want to do that. So when you're doing
testing, you kind of want stuff where the
player is going to spawn. So when you're doing play
testing and testing an element, just put it close to
the player, okay? So we're going to be
doing that. So I'm going to put this portal here, so I'm going to create. I'm going to call this portal. We're going to have it movable because
it's going to move. It's not going to be
effected by gravity, but we are going to have
ennoble collisions. So it's going to
move. It's going to have ennoble collisions, but we don't want it solid
or effective by gravity. Let's go to the sprites and let's have a look at
what we can do for a portal. What is good for a portal?
Yeah, let's have that one. Again, if you've got the
student or the Indie one, it's just in MIS C. I just have that there. So we've got that there.
That's the portal. We've got that there,
which is pretty cool. We want some things
to do with a portal. We want it to do a little bit. We need a once a number. And a size. And then we want always
a number and a rotation. Once only happens once during
the game when the sprite is created and it's
always ticking along. It's always sending out the number when the
sprites gets created. We're going to get this number here, which is going to be 200, so we're going to have 200% of the size of the portal,
so it's a bit bigger. You can actually see that grow. I move that a little bit
down that you can actually see see how the portal is a bit bigger as you
play. It's a bit bigger. We also want to get
this number and add this here, we're going
to have this here. If you want to
again, you want to lower this can be like size, and then this is just like add. This is going to add to
the rotation every frame, every second, it's going
to add to the rotation. You can see how it rotates. That's what we want to do. Okay. Okay. So you've got your portal there,
which is pretty good. Then we want a few other things. We let's have a little
think about it. But basically, we want it
to collide with the player, and then we want it to
go to the next level. Let's start doing
that collision. Let's have that there.
We need a number. I'm going to show you something
about this in a minute. We need GY label. It's going to be there.
Then we need a timer. Okay. And there we
need a game flow. Excuse me. And there
we just need sound. Those are all the different
elements that we need so far, and we're going to
connect them all up. Collision with player. It's going to start
this time again, just ten is fine, and it's
going to go to next level. Next level level
two or whatever. It depends on how
you want to do this. It's also going to play
success sound. Let's have. What would be a good one
for success success. Thank you, 11. I quit
nice quite spacey. So that, let's put that
down to again, around 50. And then for this
one here, for label, what we we want this to be level complete,
mission complete. For your game, we'll
just have that there. I can bring that down, bring that down like that. It's there. If you remember in
the first class, we experiment with
labels as well, always puts it in the
top left hand corner. So make sure you have
that in the center. Let's make this white,
so we're in space. It makes it a little bit easier, we need to make
that go back there, go to layers, use interface, and just have that
in the middle. We want to make sure
that's in the middle. But if you can imagine if we're going to hit
play, it's already there. We don't want it to be
right there at the start, so we want to change that. Hit gets 100 hits to Alpha, it hits it to alta. But once we also want it to get a thing where
it's zero, okay? I know we've got
advance up here, but just to make things a
little bit easier there. Once the game starts,
it gets zero, so it makes it invisible. When when this hits the player, it's going to start
the still time play the little sound and also get 100 to make the mission complete and it's going to
go to the next level, okay? S mission complete. Now one thing, if you've noticed is when you
hit this portal, you can still move
around. Let me show you. Still move around. We
don't really want that. We want a way to be
able to do that. We want to disable that. All we want to do is go into
your spaceship, spaceship. Go to behaviors, go to
collisions, go to portal, and we want where is it
enable enable what that does is it enables or disables the physics of an
object, disables it. If it has enable, it will enable all
these bits here that we've put on
all these bits here. If we disable that,
it's not going to move, it's not going to be solid, it's not going to have
any of these things. It's going to turn them all off. So when it collides
with the portal, it's going to be false, so we can't have any more input, won't be able to move and it'll be good actually
be moving around. We're still level two.
Let's change that. Now, gloves I can't move around. I can still rotate,
but I can't move, so I can't actually
hurt myself anymore. So let's go back to level one. Another thing, what happens
is when you get hit, even on the side here or
whatever or hit by line. You just kind of like reset, which is a little bit boring I want to add a bit Pazaz to that. So let's do that.
Let's go to edit. Let's go into the sprite, and we're going to have
this ship explode. So we're going to click new
animation for the ship. Click. Explode. Again, we're going to be using some sprites that are
on the paid version. But it's not very hard
so you can change them. You can probably guess which
one we're going to pick. We're going to pick this
one for the first one. Again, if you want to pause the video and draw it doesn't
really take too long. The second one, we're
just going to have that one, going to have that. It just goes and then maybe a little bit slow
like that like that. And then for the third one, you could have or I
don't know. Smoke here. And then It's going to see which one works. So that. Okay. All we're going to do is we're going to put that into
our health and loss bundle. We want it for this filter here. So when the HP reaches
less than one, we want to. We just go here, go to
properties the properties? Yes, it's always properties. I don't know. I've done
this for so many times and I still get lost. So go here, explode, mix where it's on explode
and stuff like that. Now when we hit the
side, one, two, see. Then what we want
is if you notice the ship sort of peered again, what we want is start
last frame when done. So I'll just start the loss
frame before we reset. There you are. There you go. You've animated the
ship exploding. You can obviously now move
the portal somewhere, which is maybe a little
bit more difficult, maybe up here and see if you can get to the portal
for the next level. About actually dying.
Even prey to do on game. And then it'll go on
to the next level. And then you can do multiple
levels like that, okay? And then obviously, you can
put the mines into this one. And then the next video,
we're going to be adding a little bit more piza
to the mines, okay?
8. Moving traps: Okay. All right, so we've got our
spaceship that flows around. We've got the lasers,
we've got everything else, but to be honest,
the minds are a little bit well,
static, aren't they? So let's change that, okay? So Now, we're actually
going to move these minds, but I still don't want
the physics to be movable because we don't want
it to be affected by drag. Now we can obviously put the friction down and
everything like that. But just for argument's sake, we're just going to leave
it as movable ticked off. We need to go into behaviors,
move all of this up. We need a timer. We want a once node. We need some numbers. We
need a total switch, sorry. T need some numbers. Okay. Then we need what do
we need velocity. We're going to make
these minus two and two because that's the speed that we're going
to get and we're just going to go left and right. We're just going to make
them go left and right. For this one, we're
going to repeat forever, and we're going to
change this in. Then basically as you can
imagine, toggle loops in. What we want to do to
connect all of these up is out goes to in and then out goes to get for this one
and gets for that one. We also want to do next. So we want next
for each one here. So when it goes in, it's
going to go next and next. So it's going to keep
on toggling these two. So if I hit play, I move this thing here, so it's a little bit
easier, do that. That. See how it starts to move. Okay, I have actually connected it out because I have connected the
second one out, sorry. That's an example
for doing it wrong. O one was connected
to minus two and two. We don't one that. We want to have them connected
to separately. Sorry. Out one goes to minus
two and out two goes to two. Now if you do it, so it goes
left and it goes right. If you want a bit more
time between each one, obviously, you
just increase this so you can have that
to 20 if you want. That when it starts a
little bit longer to? But if you notice, it
takes a little bit time before it starts before
it goes to the next one. First one is going to
be triggered first, this one is going
to be triggered first and then this 1 second. So let's go this once, so it just automatically goes either to the
left or right, depending which one you one, and then it will start to trigger. As the game starts, now it gets triggered and then it
goes left and right. And that will happen
for all the mines. They will still blow up. Now, things are a little
bit more trigger. I think we had some lines down here, I think, here we are. Yeah. There we are. And then you can quickly see how building your minds level. Could be a bit more tricky. There you go. You've
got your full game. Now, what I recommend doing is what you can do is you
obviously could do more levels. Obviously, just keep in mind that if you do have
the free version, you've only got a
certain amount. If you go to level two and
you put the portal in, let's add that to
put that there. Complete. Nothing will happen. Because it can't go to the
next level, okay? Because it won't reset because there's no other level to go to. So keep that in mind. There is a way to get
around that if you want. If you want it to be
a continuous loop is you can do new level. And then here, you can have
something on the outside. Just do create, next level. I then basically, you don't need to do
anything for the sprite. Probably know what I'm
going to do. Just do once. Game flow level and then
have this as level one. Now, when you go to level two. It'll go to that one. I'll go to that one and
then it will reset. Because it went to level three. It loaded that sprite, which just said once it loads, go to level one and then you've got a proper
full game loop, but you've got a game loop
that you can play forever. So all I'd say is experiments, and for the next video, we're going to be going
through some bugs, some addition things
that I want you to be doing and a bit
more functionality.
9. Your project: C. Well done. You've done all the
videos in this class. We're just going to be
going through a few steps now to see if all the
information you've taken in, you can do these other
little bits, okay? So the first thing I want to do is I want you to fix a bug. So if you've noticed when the player's health reaches
zero after it hits a mine, just before it
resets that level, the player can still move. So I want you to be able to not be able to
move the player, okay? So how would you do that? And I've given you
a little hint here. And all I've said
is add a node that disables physics in one of
the following bundles, okay? So ship controls, health
and loss or lasers, okay? So add a node that disables physics in one of the bundles, ship controls, health
and loss or lasers. The next thing I
want you to do is add these elements in
with what you've learned. I haven't directly
shown you these, but you should be able to
add them in with no problem. Make it so a mine explode
nearby mines also explode. When a mine explodes, nearby mines that are too close to that mine also explode. You need to have a way
to have that triggered. But I don't want far
away mines to explode. Only when they're close together and one explodes,
all of them explode. The next thing I want
to do is I want you to create a new mine that
goes up and down, so the y axes. So we did one for the x axes,
which is left and right. I want you to do a new one
for up and down the y axes. And lastly, I want you to add some functionality
of your own, okay? That's not been covered
in this lesson. I've given you two examples here. You don't have to do them. So the first one is a portal only appears when all
traps are destroyed. If you're not sure
how to do that, then I recommend
you watch flow 001. If you watch that class, you should be able to implement that example with no problem. And the second example is a mine that appears when the
player gets too close. So maybe it's only
slightly visible far away so the player can
kind of see it and when it gets too close,
it's totally visible. Now, with that example, you should be able
to implement it with little to no problem from the videos that
you've watched here. However, one of the
little bits there, and I don't want
to give away too much because I don't
want to give any answer. So if you watch flow
001 and also flow 002, which is this video,
you should be able to implement that
example with no problem. With that being said, thank you so much for
completing this task. Hopefully, you've enjoyed them, and I will see you in
future flow lab classes.