Transcripts
1. Introduction: Interested in creating your
own video game that feel intimidated by the idea of
coding? Well, don't worry. With flow lab, you can bring your game ideas to life without writing a single line of code all from the
comfort of your browser. In this class, we'll dive into
the world of flow lab and explore why it's a perfect game engine for
beginners like you? Instead of coding, we'll
use visual elements called nodes to build
and customize our game. Throughout the class, each
video will break down the game making process in a way that's easy to understand? By the end, you'll have
all the knowledge you'll need to create your very
own simple clicker game. You will also be encouraged
to get creative and expand on your game using the skills you've
learned in class. If you're ready to
embark on your game making journey without
the hassle of coding, jump in and start building your first simple
game with flow lab.
2. What is Flowlab / Class overview / Getting started: Welcome to your first
flow lab class, and this is building
your first simple game. Why choose flow lab compared to maybe other game
engines out there. But before I answer that, maybe let's see the
process of where you are. Let's imagine this is
your journey of gaming. You probably have
a game interest. You enjoy playing
games or you want to learn more about video
games in general. You then go to an online class or you might go to
college or university. You might gain a qualifications. It's entirely up to you. Then once you've done that,
you'll probably want to continue your hobby or maybe actually get a career
in video gaming. It's entirely up to you how
you want to go on this. You might I don't know
what point you are, you're probably at this
point here, I imagine. But some of you might already be having this hobby and you want to know a
little bit about flow labs. What I suggest that flow lab
does is it does a little bit of an introduction before education because
it's very visual. For myself, I'm a
very visual person, I'm a graphic designer. While I would love to
learn how to do code, and I'm sure I will
at some point, flow lab is a really
good introduction because it uses nodes, blocks to connect the code and the functionality together. Important to note that other
game engines like unity, unreal and condo
also have those. They're also able to add
these blocks together. But compared to flow lab, simple, it's very simple
compared to the other ones. Also, it can be a
little bit daunting. What I suggest is
that people who actually want to get into the gaming world
and actually make games to use flow lab
first because well, if you're not too sure where
to start as a great step. Let's go through
the class overview of what you're going to
be learning because I think it's very important
that when you take a class that you know what the steps are going to be
for your end goal. This is a simple click again. What we want to do is once
we click these targets. It's going to start a timer. Then once it all goes down to zero, we want to play again. First, we're going to
create the targets. Once you click them, they're
going to get destroyed. We're going to have some
instructions for the player. Here it says instructions
to play that turns into a timer This counts
the amount of target. We're going to have to make sure that it accounts automatically. So if you want to
do other levels, it'll do it for you, so you don't have
to do it manually. This little thing out here is the brain or the
functions of the game. This little box here little blue box is the
game being window, and then everything
outside where it's gray is still in the game, but the player can't see it. Then here, play again, we want this to appear and
have the option for the person to play again afterwards so they can keep on playing the games if they
can beat their time. We're going to be
adding some features to the game once we've
done all of this. We might want to add some lost conditions or we want to maybe add a different level or
anything like that, quite happy for you to start
experimenting at this stage. Then once we've done that, I definitely want
you to experiment. After we've done the
features on this bit, I want you to definitely
start to expand and add some own
features and then share it for the rest of other
people to see what you've done. Let's get started. I recommend that you use the
free account on flow lab. You can, if you want
get a student account, there will be a link in
the class description, and that will take you to
a website and it'll just have a bit more of a
rundown on how that works. But if you're completely honest, you could just create a
free account on flow lab. Again, just click on the link to see how to actually do that. Um, we're going to be
creating four objects. You get a maximum of 50,
if you get a free account, we're going to be
creating three levels, you get a maximum of five
on the free account. Because it's a single game, the first game, it's
going to be one. For a free account, you
already get a maximum of free. You can delete them, and then
obviously that goes down. Levels and objects don't
transfer into different games. You can have a maximum
of 50 for each game. Again, for levels, you can have a maximum of five for each game. But the game is the only one where obviously if you
create free games, that's it, you can't
create them more. You have to delete one. So with that being said,
let's get started.
3. Setting Up Targets: I. So when you log
into flow lab, you will see your
profile and stuff. Just click on my games. It's not going to look
exactly like this, especially if you don't
have the student account. Click on my games, and you
come to something like this. We have new game
green button there, and you'll see our
sample clicker game. We're going to have a
quick look at that and see how that functions
and then we're going to go and start making it. Let's click on it. There you
go. You click the targets. This is going to
change to a timer, and that's the amount of targets that we've got there,
which is nine. Then we're going to play and see how it
repeats. Click on it. The sound plays. Tim
goes down. There you go. And then play again. Click
on that. Play again. Was it one 60 I got, let's try to see if
I could beat one 60. The got 80 for
really simple game. It's always better to
start off slow and then obviously we build up and then we can add more complexity. Let's go to my games. Click on new game. You'll come up to a
screen like this. You want to click
on empty projects. Sometimes you'll get another
screen that comes up here, that tells you the flow lab
updates and everything. But you all that for now, if
it comes up to the press. Empty project, go.
This is your window. This is your window of what you're the player
is going to see. Every cpside the player is not going to see because
we're going to be putting some brains or the functions into
the actual game, and then some stuff in
the actual window itself. So if we go to game levels here, you'll see it's level one. You also maybe if you've got a free counter is
like four out of five or some number here because you're only
limited to how many levels. But we're only going
to only be making say two or three levels
in this game, so we don't have to
worry about that. Click on the white square. What I want you to do
is select a color. Select any color on the outside first and
then the inside. This is your color
previously and what it's currently at.
The moment it's white. We're going to click on, say, let's do a purple one or
pinky one, click on there. See how it's current and then what it's
going to change to. Click. There you go. We've got that thing there. And if you click on play here, this is actually how you
would play the game. There's a little test
feature with inflow lab, which I'm going to
show you in a moment. But if you actually
want to play the game as other people will play it,
and you can click on that. You've got details fb and cover. We're not going to be
worried about that. This time, we'll probably be focused on the other lessons. But for now, let's
go back into editor. And let's go to settings. We can change the game
title to whatever you want. We're just going to call it clicker and call it
whatever you want. You've got your gravity and
you drag and everything else, age, let's ignore that. You also got the
width and height. Again, like I said, this is your window of what the
player is going to see. We can actually drag that or decrease it depending on
the type of game you want. Again, just put
it back to 16 12. It's obviously just
useful to know when you start making
experimenting. Click. Let's actually
add some elements. We're going to be adding
some boxes or some targets. Left click, you'll see create or cancel. Let's click create. You come up to this
little box here. Now, this box is very important. You've got some
parents display order, that's going to be important for potentially other classes. For this one, we don't
have to worry about that. Multiplayer obviously, we
don't have to worry about it. Physics. We don't
need to worry about, and this is just
restart on level, so the objects won't persist throughout
the different levels. These are the two most
important figures that we're going to be focused
on at the moment now. Object one is how many times
this object is in the world. We can clone objects, and it will have the same
type, but this will change, so it will be object one,
two, and three and four, and so on every
time you clone it. It's really important to
always name your type. So we're going to
call this target, Um, there's no need to chase
the dame of the object, but you can for
more complex games. But for now, we're just
going to worry about type. You must change the
type because honestly, you'll just get really confused. Even on a simple game like this, you go like, why is
my game not working? It's because it's selecting
something else or whatnot. Okay. So anyway, once
you've done that, you want to click
on Edit sprite. Come to a box like this. This is where you can actually start designing your
sprite and stuff. If I click a color
up here or whatever, let's do a red, I could do a little smiley
phase if I want to. That will be the
actual sprite itself. You can see on the top
left hand corner here, that's what the sprites
going to look like. Again, we're not going to
focus too much on this, but you can upload, you can download the
images, undo, whatever. I encourage you to
experiment after this class. For now, we're going to
click on Browse these are all the different sprites that
are in your current game. We're going to click on menu. Again, because I've got
the teacher account, I'm going to have a
lot more options. But we're going to
go with everything that accounts will have, which is the flow of b sprites. We're going to click on objects. Then we're going to
click on topic here. It's entirely you,
what you want to click on. I'm going
to go for a box. Click on box, it
will come up there. Once you've done
that, click Okay. Click again. There
you've got your box and you can click and drag that around. If I click on play. You'll see doesn't
really do anything, especially for click
on because I haven't add any cold or any
behaviors to it. It's also very nice with the purple and pinky
purple with the box. I'm going to change that
make it a little bit better. Let's go back into that.
Go to say a nice blue. If that stands out there that
stands out a bit better. Well, let's put some
functionality into this game. We're going to
click on your box. You're going to click on edit. Go to behaviors. Then this is where all
our functionality is. We've got triggers,
we've got logic and math, components,
properties, Text lists, GY, game flow, mobile data, multiplayer
and behavior bundles. Behavior bundles is
really useful for very simple code that the developers or
the people who've made this website have done, so you don't have to red stuff. It's always best, especially
when you started out to do your own and you don't
really know what's in here. But for now, we're going to be doing everything from scratch. What do we want to do?
Let's think about it. We want to click the box and
we want it to disappear. The first thing is going to
be a trigger. Mouse click. Click on there. You'll see these you go down up over and
out and the little nodes, the little dots
connecting to it. What you can do is once you connect two different
dots together, you can just click and drag. You can't connect
it to yourself. Sometimes you can and there'll
be times when we do that, but for this instance you can't you can't accidentally do that. What? Mouse click down.
That's when it activates. Mouse click up as in when you release the click
on over the object. The mouse is over the object and the mouse goes
outside of the object. Each one of these will activate the lines when we connect them. What did I say? When
mouse click down, we want to delete this object. We want to delete the box. Let's go to components, go to destroyer because we
want it to be destroyed. Okay. Like I said, node to node, dot to dot. Down, goes to destroy, goes green, there you
go. You'll see it there. If you make a mistake,
accidentally, you can hover over the line, and click on it, goes red, blue goes green, there you go. We can actually see this
work, which is really nice. Instead of going out of the
game into that play area, we can actually
do it right here. If you go down here to
the left hand corner, click on play, see how it all becomes a little bit
brightest not graded out. Click on the box
and you'll see this activate The mouse was down, destroy and it destroyed it. Press stop, there go. You've got the first
element of our game sorted. Let's press okay. Let's make it a
little bit exciting because we've only
got one object there. We want to clone this. We don't have to then make the code for each object because we're
going to be clothing. Click on it, click on clone. We're going to do eight
objects altogether. We want two sets of four, one, two, three, four, and now we do 12p4. Again. Done clothing. Remember, if you
accidentally click twice, I'm going to click on
twice here for you. Just an example, it
doesn't really show. You have to be careful
if you do that. You're going to actually
just click out, click the object,
and click Delete. Just make sure you don't
overlap because you'll go, why is my box not disappearing? It has disappeared. It's just that it's layered
so the bottom boxes show it. We can actually
play our game now, click on play. There you go. We've got our boxes that delete, because we've done the
code, and we've coned it. What else do we need to do? We needed to put some sound
to it. Let's do that. Glo onto the object, go to edit, go
back to behaviors. We need to go to put some sound. Let's go to components. Click the sound option. A little node appears. Then let's put that under there. Go down to play, so it goes green, and
then that's connected. Now, it's important. If I click on this box and I drag
it, I'll drag everything. If I click on this one, it'll
already drag this p here. It already drags
everything that's connected to it from
the left hand side. If I want to click on this and I want to just
move it myself, I hold down shift, and then I can drag
this independently. I hold it down shift currently. Release shift, and then I can drag it if I want
to drag everything. Make sure you do this neat. Again, because it's
all node base, as well it's nice, it can get a little bit messy,
just like normal code. Just try to position
things that go like, it's not going to confuse
me further down the line. Anyway, sound effects. We've connected that up so
it hits play down to play. We can also have down to
stop but we want it to stop certain music volume is
obviously speaks for itself, if you want it to be
lighter and lower. Also, you've got
outputs as well. Once this plays, stuff
will come out here. Again, we don't have to worry about this for this session. Let's click on the
actual box itself. We can upload our own music, but we're going to
be choosing sounds, so we're going to choose sounds. We're going to go to effects. Again, depending on the
account that you have, you might not have
these many options, you definitely won't be
able to go into a premium. But I think a simple click
one is really simple. It's entirely up to you,
which one you want. All I would say is don't pick
something that's too long. Let's have something
that's going to be potentially annoying just so I can show you. That one. I can imagine even though it's, you click on that a few times, that's potentially
going to be a line. Especially if you do something
too long like music, there's little music here. What's it fantasy.
Yeah. You don't want that every time
when you click a box. Short and simple. Let's go back into click and
I'm going to click on that. Actually, that
sounds pretty good. That sounds like a
box collapse in. Click on, and there you go. You've got that there. Now,
just drag this across. I'm just clicking anywhere that space and then I can
just drag and move it around. I could also use the scroll reel to go in and out. I'm
just doing that there. Hang going to click on play. Now, bit annoying, but again, it's up to you. For
me, that's fine.
4. Adding a Timer: I. We've got the
boxes or set up. Let's actually set up a timer. Like I said before,
anything within this box here is going to be the player's view and
everything outside isn't. We're going to start
doing some functionality to make the game work
the way that we want. We're going to be
putting the brain in the game so to speak. We're going to click
somewhere here. We're going to click on create we're going to
call this control. Now, you don't need to do the spsens because no one's
ever going to see it. But I always think
it's quite nice just because well, Okay. It would you want to
go back into the game? I always f is quite nice. If you want to go
back into the game and do some changes or edits, you go, well, what's
this square here? But if you make it something
a bit more obvious, then you'll roughly
know what it is. Let's go back into sprites. You can go into objects
and then you can choose it here like a lock,
I think it's quite nice. But if you do have
a paid account, if you click on this one here, you can click on what it
maps, see what's there. You've got a little question
marks and stuff like that. Explanation mark, some symbols, which is quite nice.
Let's use a symbol. Again, it doesn't
really really matter. You can choose whatever
item you want, you can upload your round. Let's click. We call
this one control. Again, this is going to be controlling elements
of our game. Let's go into behaviors. Let's start putting
some stuff in. Let's start doing a timer because that's really important. Let's go to GUY, and
let's put label. Let's click on that label. There you go. Let's
have that label there. Then let's call
this. What's this? Click box to start. You can choose whatever
font you want. Again, it really depends on the color that you've
chosen and stuff like that. But I always recommend, especially for this
game, click on center, so it's center lines. When it starts to change, you can offer you
change the font sign, the font, and the color. Let's I'm going to make
my one black here. I'm going to click, click. Now anytime when you click on the label when you
create to do label, it's going to put the
text in this corner here. In order to change that, go
back out into your main area. Click on the box
to see highlights. I want you to Move
the box over here. Move the text over here, I mean, you've got
that bit there. Let's go back to your control. Let's start putting
some things together. We want when the
player clicks on a block or a box or
whatever you've got, we want it to start the timer. We want mouse click down. Then we want a tier
to start ticket over, don't we? Let's do that. Mouse down to start, I'll do manual start then, and then it's just
going to add to value. Let's see what happens here. We also want it to capture clicks anywhere
because if we don't, it's going to only
activate when we click on control because it's
outside of the window, player is never
going to be do we need to capture clicks anywhere. Also, if you click on this
little ton node here, we want to make sure that
this repeats forever. We don't want it to stop, we
want it to continue play. Also the time is a
little bit too long. Let's make that 0.1. Lesli and then out goes to value because we
want to change the value. Now we could play.
It only does one, it's only outputting
one because it's only activating once. We
need to change that. We want that to keep
on counting up. We need to put something
else in between there. Let's delete this line, and
then let's put tican maps. Let's put a number in. This time, we want
to add that one each time into
itself continuously. We do that by putting a
plus sign. O goes to plus. Now it's going to be
adding that one each time, and it's going to be
adding one to value. Now if we do it, click on play. See how the time goes on. But there's no way to stop it and that's what we're
going to be doing next.
5. Stopping Timer: Okay. Once all the
boxes are clicked, we want it to stop the timer. We need to weigh for the boxes to communicate
to control. Let's do that. Let's go back into
your main area here and click on the box. A box will do because
it's remember they're clones of each other, so
they're all the same. Click on box, click on edit, click on behaviors,
where it destroys, we want it to send
something to control. We want to send it a
message and we're going to scroll in so it's a
little bit easier to see. Then it's going to
count it in control. Let's go to components. We want it to send a message. Let's click on message. Click on that, it says, Hello. I'm just going to go out
to send, so it's already. I'm going to drag like that. I'm going to click
on this. Now, you can have any message you want. It is case sensitive, so it's important
that if you put a capital at the
front or anything, it duplicates at the over end. But this one, I'm just
going to target die. You could have
anything you want. It really doesn't
matter, to make it easy, maybe just have die, it just
dies because it's destroyed. Or you can put destroy.
It's entirely up to you. Now you have a bunch
of options here. You can set it to
yourself, send it to last contacted objects
and stuff like that. We're going to ignore all of those apart from this one here. Choose objects to send it to. Click on that, you can
probably see where we're going from here.
Select the type. Remember, it's important to name things because if
you click on this, we've only got two, but if you can imagine if you're
making a more complex game, you're going to have
a long list here. You want to make sure
you name it correctly. We want to send it to control. Then any object, obviously, we already got one of the
objects here, it's object 11. We don't have to do that,
so we just do any object, and then that's it there. If I click on now, if I click on play
actually, I can show you. Do you see activated?
I clicked on down, destroyed itself and also sent the message die to control. Let's actually have
a way to receive it. Let's go back into
your main area here and go into edit for
your controller behaviors. Then we want a in
triggers, we want mailbox. It's got hello. What do we
put put die or I put die. You can put whatever
you want, lower case D, I've got that there.
That comes in. Basically, we want to do a set of things where we've got the number of
boxes, we've got eight. Once we want it to get rid of that number to zero.
Let's do that. Let's do two numbers one, two. Let's put them in
sequence of each other. This one is going to
be a number of boxes. We're going to have it detect the number of boxes so that you can dynamically change it for extra levels
that you want to do, but for now, we're just
going to do it manually. So there's eight, so
let's click on eight. For this one, we
want a minus one. Because remember, we
want to get rid of this number until it's
zero for it to stop. O because we want
to get minus one. We don't want to add
to it. If we do plus, it's going to add
to this number, so we don't want to do that. We want to do minus one. And then out gets two plus. It's minus one to
this number here, and then that's going to output. I can show you how that works. If I just move this up here. Now I have a click on play, you should see eight
disappear, or go down. Seven, six, five. Okay. There we go. We've got a way for it
to go down to zero, but there's no way
for it to reset yet. We need to have
some if statement, a filter as it were. When this goes to zero, we want it to stop the timer. Because we're on logic
at bash already, there's a filter thing here. Let's put this in. Value will be the number here and then just goes into
the actual box. We don't have to
worry about value, we just have to worry about in. Eight goes to in, this out goes to in here. I'm going to move this down here just so it's a
little bit easier. Then I'm going to
click on the filter. Then it's already got zero there, so we'd have
to change that. Then we're going to have
equal to zero equal to zero. When this is zero, it's going
to pass this little test, and then it's going
to pass it and then I'm going to go reset. I'll just stop the timer. Start reset as it resets
it back to nothing and then delay is if you want to stop the
timer for whatever reason, and then it'll start up again. But we're going to just do that. Hopefully, you can
see the path there. Again, if I moved
to the side here, we can see it working.
Goes in seven. It hasn't passed yet to zero. Now the minute it goes to zero, this should activate and it
will stop. There you go. See how activated and
everything stopped, which is really
good. There you go. We've got a way to stop our little timer and if you
clip on the main thing, there you can see it play, you can see it started
to take shape.
6. Counting Targets / Fixing a Bug: Okay. So we've got the
basics of our game, but we want to add some
extra little things here. Now, I did say at the
start that we're going to be able to count these boxes, but we just put this
manually, didn't we? We put that in there as eight. Let's have a way for
it to count itself. Let's go back into the
behaviors of control, we're going to do this
backwards this time. We're going to go to mailbox. And we're going to
have a bell box. We're going to count that to the number here that says plus. But this time, we're
going to have this as zero, going to
have it like that. You could have a number in between and then
have it to set, but just for making things easier, we're
going to do it like this. For the bell box, we're
going to have this as count, counter K C, and then that's
what's going to happen. We're going to put
the triggers or those besages for these boxes, and each one of those is
going to send a number, which is one to this mailbox, and then it will come out
and that will be eight. We're also going to have a
way to count this as well. Let's do that. Let's go to GUY. Let's do another label. I'm going to put that over here. Out goes to value, so we can actually track it. That can go to zero because it doesn't really
matter because it's going to count it automatically. Let's do center. Let's
make this, I don't know, a red I go, let's position it nicely here, then moved up a
little bit like that. Then let's do the
triggers for the boxes. Again, any box it
doesn't matter. Remember, it's going to happen for each one of these boxes. We don't have to do
it for each one, it's going to be it's going to happen eight times
because they're cones. They still exists in
the game in world. Inter triggers, we're going to click on the thing
that says once, once do Once each time that this sprite object is created in the game when
the game load that level. There's obviously other
things like always, this is always activated
in every frame, if you have over it activates once. What we want it to do? On the game loads, we
want to count itself and send that count to
control. Let's do that. Let's go to messages to send
call out to send like that. Call this count, that's
what we did before. Objects send it
to click control. An object is fine. Then if I move this over here, click on play, see it
says eight because this sent to count to control
and it counted eight. I actually show you in control here, work a
little bit better. It happens instantly. This is still going
to have a one, but just keep in mind that
it does happen eight times. Click on play that activates
counts it each time to one and then we can actually play because we still
got this equal to zero. We can do that. There you go.
We've got that bit there. Now we've got a bit of an
issue because if we click again starts a Tra again,
we don't really want that. We want that to be able to stop. We want this to break its line after we've
clicked it once. Let's do that. Mouse click to T. We want to get rid
of this line for now. Move this back a little bit, and we're going
to have a switch. Just like a switch
in your house, Okay. Electricity is always come into your switch for your
room or whatever. But the light only
turns on when we actually turn it
on. Let's do that. Out goes to in, down goes to in. Down goes to in and
then out goes to start, like what we had
before, the switch is currently turned off because it's on the little
light is not on. Let's make sure it's on because we want it to be
on at the start. Then what we want it to do is we want it to turn itself off. O goes right round to off
and you'll see it there. What happens? Lin comes in, clicks down, goes out, but then it's also going to turn itself off
at the same time. If I just show you play, see eight activates that way. Click on it, and you'll see this turnoff turns itself off. Okay. Click on
each one of these, you'll see it's trying to go in to start the time each time, but it won't let you.
Then click on that. This is going to activate stop
the timer. Stop the timer. As much as I click it can't
turn itself back on because there's nothing on
the node little dot here that says on,
we can't do that. Again, depending on
the type of game that you make or whatnot, you might want to have that
feature for your game. For this one, we
don't want that. So we're going to
leave that one there. Then we can actually
play the game disappear. Hey. Co. And I can't
stop the time now.
7. Adding a Replay Button: So we've got all the elements
of our clicking game there. What we can do is we can
move these about a bit. We can add more blocks if we want to make it a little bit more
difficult for the player. Move that like that. Let's
add a few more there. Remember, because we've done coning, we've done
all the coding. It's going to add
that number there, so we don't have to
keep on doing each bit. Let's move these like that. So I've got 12 this time. We just want to
have a little thing where that makes it
a little bit neater. Let's have a little thing
where once you've done, we're going to have a thing
where it can play again. The bottom down here,
we've in the box. We need to click Create, I just want you to call
this type play again. Okay. Again, it doesn't matter
what sprites you do. You can upload your own,
you can create your own. But for argument's sake, there's a really nice
feature on the students one and the teacher one because
they're exactly the same. I'm going to click on arrows. I'm going to click
on where is it? Little replay button. But I can change whatever want. If I want to, I can go back
into the sprites here, I can click on objects and
I can have a key or what. It really doesn't matter.
I'm going to click on that. I'm going to put that
I want that to appear maybe in the corner
here like that. So be quite nice. And
then have edit behaviors. Go to GY, label, and have play to P play. Again, going to
have that centered. I'm going to make
this make it black. We make it maybe a blue dark blue. See
how that looks like. Again, I have to go out. It's probably going to
be a little bit too big. Let's make that
little bit smaller. Let's go back into behaviors. Let's change the font size to I don't know,
seven quite nice. Position it correctly. Go into the actual play
to see if you're happy. Yeah, with that, that's fine. We don't want this to be
activated all the time. We want it to only appear
when it goes down to zero. Let's do some of
the elements first. First, we want to
be able to click on the arrow and it
restarts the game. Let's do that
first. Click on it. Play again, behaviors. We've just got the label here. We just want mouse down
and restart this game, restart this level. Game flow. You've got pause game, load game, restart
game, or what? We're going to go load level. Click on down to go. I'm just going to
go restart current. The reason I do restart
current instead of level one is because if I want to make new levels on this and I want to make
it a little bit difficult. Again, this will
be dynamic enough. D will only reset
that current level. Let's do that restart current. Click Now if I click
somewhere and I go, I made a mistake, I can click on this and restart the current. But again, we don't
want this to appear. We only want this to appear
when this goes to zero, once we've got When
that goes to zero, and it starts a timer. What
do we want to do here? Go back into its behaviors. We want to have a once
note. A few things here. Put that up here. We also want to
go to properties. Now, Alpha is how
transparent something is. 100 visible and zero it's not. Let's go to logic and
mass, and gets a number. What are we going to do?
Once the game is created, it's going to get zero is
going to put the Alpha for the text and also Alpha
for this percentage here. I could play, see
how it disappears. It's still there, but
players don't know that. That's a little bug
and maybe you can try to work out a way
how to solve that. But for now, let's just leave it there because we'll have to
spawn things in and whatnot. We've got that there. We
also want to have a message Where this is now 100 and then out goes to Alpha
and out goes to percent. But we don't have
anything coming in. Again, we just need a
mailbox, do it back to front. Let's go to get. Let's call this visible or show. Maybe it's a little bit
easier. It shows the text. Click on. You can probably guess how we're going to be
doing this because we've repeated it a few times now. We're going to go back
into edit behaviors. We've already got a filter that does the
calculation for us. We don't really need
to make another one. All we have to do is go
to components message. Pass goes to send. We're going to move that over
there. What do we call it? Show? We're going to send
the object to play again. We'll take hit zero. It's
going to stop the timer, and it's also going to send the message show
to the play again. We click on this bit here just
to show you how it works. Play deactivates,
gets number one, put Alpha for the text and Alpha for the actual
object to sprite. If I didn't have
this bit connected, the objects would disappear, but the text would appear here. That would disappear. This
would still be appear. Let's make this zero
now and then you'll see deactivate to show it. Okay. And, you've got play again. And then the final thing we
want to do, Let's some sound. Let's some music.
Again, how we did it. Filter, we've already
got it activated. Let's go to components and
sound. Put that over here. Pass goes to play. Choose
the sound. Go to effects. Go to should we have? That's good. Success. That's good. That's fine. Let's have that one. Click Okay. Once it passes, it's going to
do success. Let's try that. Actually. Let's do
it in the main thing because we've got the main
basics of our game here. You go 155 and zero. Now, you don't have to
have that zero there. You don't have to have
that number there, you can have that outside, but it's just a good indication to show you how many
boxes you have to click. Click on play again.
You can do that. You can start to think how to add these elements together to make it a little
bit more interesting. Maybe when the game, you want it to play a
sound. We can do that. You can put that into control. Once the game starts once
this is created here, we can go to components. We can have it play. Let's
have it play some music, for example. Let's go to loops. Again, depending on the
type of account you have, you might not have
some of these. You should have, but again, I've just had the
teacher one for a while, so you should be fine. You can upload your own. Okay. Let's have that.
It's a bit loud, so I'm going to reduce
the volume down to say, I don't know. Here. Maybe two. Okay, let's do that. Now when I hit play,
play the sound. Okay. And then they'll restart because it's
restarting that current game.
8. Expanding the Game: Okay. Questions
that I get ask is, how do I make multiple levels? Okay? So let's do that. So we've got here play again. But let's change this. Let's
change this to next level. So s play again, we got next level. Then restart current, we haven't actually made yet, so
we need to go back out. Go to game levels, click on new level. It's going to have
a new level here. I'm just going to
call this level two. Again, we can choose
the color for this. We can make this one red,
for example, if we want to. To load the actual level,
we need to click on load. But before we do
that, we're just going to make sure
that next level, is chosen here in
this low level. We've got restart current. We can have go to next
one, previous one. Use input value,
level one, level two. That's the one that
we want level two. Click. Also, the sprice isn't
probably that suitable. Let's change that as well. Let's go to menu. Again, you can change this to whatever
which one you want. Let's do that one
there like that. Next level. Move that like that. When it goes to zero, it's
going to go to the next level, which is this one here. There's nothing
here at the moment, but we've got a
little library here. We haven't actually gone through this one, click on Library, and all the elements, all the objects that you have for that game
will appear here. For a free account, you will have you have
I think up to 50, but for this one, it'd be absolutely fine. Unlimited for students
and teachers, and also if you get an d one. What we want the target.
Click on Target. Click on Add to level, and it will already
do the clothing. Make sure you don't
double click. Let's do free objects here. Once you've done,
you've done clothing. Click on Library again,
click on Control. Click on Add level. Let's
put it outside the box here. You'll see the box to start and stuff like that.
Click box to start. The box and the color
isn't very good, so maybe we'll change this
color to something else. Let's try yellow, see
what that's like. That's okay. Click Okay. I click play and you'll
see the sound play, see how it's already done. We don't have to do anything
because we've already done the code for it,
which is really good. Again, we can play
again for next level. Click on that, put that
there, for example. Instead of choosing level two, we can just do next
level, for example, and it will just continuously
go to the next level and be dynamic enough to
go to the next level. Click on play. Okay. Won't click because there's
nothing to go around, because there's no more
next level after this. If I do this one, you'll
see how it's next level. It will go to level two. Next level. Then
that one next level, but obviously we
haven't created it. So you just have to
think of each stage. Remember to have some sort of plan when you create
more complex games. Let's make a ol level now, but we're going to
have this one called. So we got new level, and we're going to call
this ones or died. We're definitely going
to make this one red. Let's make that one red there. Click on. Load level. Again, create a sprite. We're going to call
this one because we used to have a play again, but we're just going to have
this one restart, start. This is going to be the
restart game. Restart game. Go to edit sprites. Again, it doesn't matter
which one you choose. I'm going to click
on these arrows because it's there, why not? And then we're going to put
some behaviors in this. Click on down, and then we want this one game flow to
now restart the game. It's going to restart the
entire game if you lose. It's not going to just
restart the current one, it's going to restart
the whole thing. We don't want the players or the player doesn't want
to get to this level, so down goes to go. Click on that. Of
restart the whole game. We could put a bit of text Well, what we want to do is we want the timer to get
to a certain point, if it's too high, the player will lose because there's
no loss condition, we're going to have
some too slow. Let's go to GUI labels then
you are slow like that. Let's make that white.
Again, Center's entirely up to you
how you do it. How fell like that.
Here are too slow. Click on that, will change it. Let's actually set that up. If we actually play this game, What number do I get? I get 177. Let's say if I do 200 or more, I've gone too slow and
I need to change it. I need to go to that loss
level. Let's go here. Go to edit, go to behaviors. As we've got a filter here, we're going to have
a filter down here. I'll go down here
and then activate. Logic and to filter.
Put that down here. Out is going to go to in move that a cross over
here, hold down shift. Move individual ones, if I want to or if I want
to do the whole thing, I don't hold down
shift. What did I say? 200? Let's make this
200 for start, 200. There we could have greater
than 200 equal to 200, I would say greater than 200
or greater or equal to 400. If it's 200 or more,
this will activate. This will pass the test and
it will go to this level. Go to game flow load
level. Quick on goal. That, just like we did before
pick level and this one, we definitely want to do loss. Click. Now if I go back to
the game, click on the box, and I'm too slow
clicking on these boxes, the minute it goes
to 200, too slow. I have to restart the game. That means I have to be click quicker to go to the next level.
9. Your Project: Yes. Well done, you've done all the videos and you've completed the class. This bit here is just
a very quick video on what you can do beyond
and for your project. The first thing I want you
to do is if you remember, when we did the replay button, even though we
made it invisible, so it would only appear when all the boxes are clicked
and the timer stops, You can still click the
button in that corner. Even though it's invisible,
it's still clickable. What I want you to do without me actually telling you
by step by step, I want you to try and fix
that problem for yourself. I've given you a
little hint here. It uses one of these nodes. It either uses a number node, a switch node or a ter node. Each one of those nodes you've used throughout this class, but I want you to
work out which node you need to use in order
so that the button is not clickable
even though it's invisible and is only
clickable when it is visible. Invisible can't be clicked, visible, can be clicked.
I want you to fix that. The next thing I'd
like you to do for your project and for you
to expound in the game is I want you to add some
functionality that hasn't been covered
in this lesson. Given you two examples here, but by all means, come up
with something yourself. The example that I've come here is clicking the wrong box. Maybe one of the box
is like a red herring. What happens maybe when
you click that box, maybe it restarts the game
or it goes to a loss level or goes to something
else. That's one example. Then the other example
is next box appears. Maybe you can only
click the next box in a sequence when the
previous block is clicked. It appears and then it
needs to be clicked. Those two functionalities
that I've given an example, but by all means,
come up with your own if you'd like to
do that. All right. The last thing is
I'd really like to see your projects and your own game being quite nice and I'd like
you to be creative. We all need to cover
this for not very long. I tend to do these workshops just over an hour in person
because I'm going back and forth with the
individual students sometimes every single time, they want to make
their game look nice. This is the chance
where I want you to be able to spend
some time and do that. If you need some restriction
for this request, only use sprites available
to you or edit them. If you don't want
to, don't upload loose sprites because we haven't really covered that
this lesson yet, but I would like you
to do different boxes, maybe for each different level, put some background
stuff in and see if you could add some
functionality in as well. Well done for
completing this class, for the next one, hopefully
you will enjoy as well. See you soon.