what's up world welcome back to another
tutorial today we're gonna be discussing
how to create a basic window that's
right just a window we'd want to get
this project started and I want to refer
people back to this episode so we got to
make it not gonna be too much code just
straightforward layout a storyboard and
have a window show up that's it so let's
get started so the first thing you're
gonna want to do is go download Xcode if
you don't know how to download Xcode
well you probably ask your mom she'll
know how to download Xcode it's not hard
to download applications but once you
have Xcode and maybe you've done all the
updates on it we're gonna simply create
a new Xcode project now you'll see
there's these different options up here
at the top we have iOS watch OS TV OS
for this series we're only going to be
using Mac OS because I don't want to
have to deal with having a phone on me
at all times and letting that thing boot
up and all that jazz so we're just gonna
do mac OS maybe we'll port it to iOS in
the future because that's totally
possible metals breakout a bowl I guess
you could say but we're just gonna
create this basic cocoa app I know
you're looking at the button game I know
it you look at like we're gonna click
that game button you're not we're that
game button uses sprite kit and things
that are not low level you're gonna be
creating top level objects like you
would with unity but in a little bit
more code based environment so we want
to do is you want to start from scratch
so we're gonna create your generic cocoa
app for the product name I'm just gonna
go ahead and put game engine I'm not
very clever and that sounds pretty
awesome to me so game engine it is and
I'm gonna use core data because maybe in
the future we may need to store some
stuff just right on our local machine
all this looks fantastic let's move on
I'm gonna I've already created a
location for it you can save it wherever
the heck you want you can save it in
your user folder in your library file I
don't care you can save it on a flash
drive ship it off to Europe and keep it
there for all
care but we're gonna create our project
yes look at this oh man is this what a
game engine looks like it says game
engine no not yet we have some
organization to do so if you're not
familiar with Xcode I'm just gonna do a
brief rundown of it on what each thing
actually is so over here you have your
files over here you have your inspectors
here you'll have your objects that you
can drag onto the story boards you'll
see we have different views that we can
apply so if I want to get rid of this
side view on the left hand side I just
click that button get rid of the right
view if I want to this is the output
window right here so if I want the
output window I'll do that I'm actually
gonna drag that over create a bigger
output window for now and yeah this is
the assistant editor we're gonna be
using that quite often right here we
have our just one file format and yeah
let's let's get into it so the first
thing I want to do is show you the main
storyboard the main storyboard is gonna
be the layout of what your application
just kind of pops up as okay so it's
it's the storyboard it's the it's the
comic book of your application if I
click here I go here I click here I go
there but for us we just we don't need
any of that stuff we just need a simple
view you know and so this right here is
our view controller this is like the
window this is the view controller
that's in the window we need to make
some modifications this isn't gonna do
because what we need to use is we need
to use an empty cave you but that's no
I'll hold your horses I'll get to that
all right so next thing we want to do is
let's resize this thing because this is
way too tiny over here I'm the
attributes inspector well this is the
size inspector you will want to make the
width of this so click on the view go to
width let's make it 1080 by 720 because
those sound like pretty good sixteen by
nine dimensions huh all right so there
we go there's our basic window this
doesn't need to be resized since the
view controller is already resized
but we do need to add some settings to
this window so in order for us to so if
I click the window right here and I go
over to the at the I think this is the
attributes inspector and it is so we
need to change the title probably call
it game engine because that's clever
down here you'll see we have all these
options we want to select restorable
undo that because when we close our
application and/or reopen in the exact
same size that it was before but if we
disable it it won't do that we want all
these that'll be fine
shadow sure this is all this stuff
doesn't really matter all we really
wanted to do was get rid of restorable
because that's driven me nuts in the
past and yes so that's our view
controller I'm gonna go ahead and just
run this project real quick let's see
what it comes out to look like and it's
gonna be so spectacular I go man that's
a weird noise I'm not gonna make that
noise anymore boom game engine this is
our window and you see we can resize it
whatever make a full screen fantastic
alright so now let's do a little bit
organization so now that our main views
set up you'll see right here we have our
window controller our game engine window
and then down here we have our view
controller scene with our view
controller and then inside is a view now
we don't really need this view so what
I'm gonna do is I'm gonna go like this
view is good and we can use this view
and this view uses the view controller
class so over here you'll see we have
view controller right well this view
controller corresponds with the
storyboards view controller so it's like
kind of like the back end code right and
so if we click on our view controller
the class is view controller which is
tied to this view controller and you can
change this so if I were to call this
views controller and save that I can go
to the main storyboard click on the view
controller and rename it to views
controller and now it's using that
back-end code for the views controller
and yeah basically this is the back end
so let's go to the main storyboard I
want to go away
yeah and let's just delete the
viewcontroller we don't need this view
controller we'll make our own class
that's why not yet delegate will keep
assets will keep main storyboard all
this stuff's cool but it's ugly because
in our main game engine file the
structure is just not readable even if
we if we just add files to this all
willy-nilly it's gonna get a little out
of hand
to solve this problem I'm going to
create a new group called other files
I'll get their files oh man this is
terrible
so in this other files I'm going to just
select all and drag every one of these
guys up into other files except main
storyboard which I'll keep on the
outside yeah perfect
so now if we try to build you can do
that by pressing command B you'll see we
have build failed and the reason being
that we don't have it doesn't know where
our code sign entitlements are but we
drag that right here also it probably
has this problem with the info.plist
we've put these files in here and it
doesn't automatically dynamically update
so we need to go update that real quick
and then we should be fine so here and
go ahead and click on the solution the
game engine solution up there go to
general if it's not already on in
general it probably is on general choose
your plist file go to your plist file
right there now you get repeat list file
okay now we need to select our
entitlements so that's gonna be located
in build settings go to the filter just
type in title mints you'll see it comes
up right here and then simply type our
other files right there same name make
sure this is the same name as that and
we should be good so if i go to build
all the linking works all the compiling
works is copying the standard libraries
etc etc and boom build succeeded and
that's it for the basic setup of our
projects so see you next time I can't
yet
[Music]