Tip:
Highlight text to annotate it
X
I know you want it.
You know you want it.
Updated FlashPunk tutorial, working with the newest version of FlashPunk,
and the newest version of Ogmo Editor.
Let's get started.
Get to the repo in the link, download the
tag for the tutorial start.
Now before we start messin' with stuff let's go ahead and see what we have currently.
So I made a a little game but i don't have levels for it. I want to use Ogmo to create levels.
Right now all I have is this crazy little plane. He flies around and you can
rotate the screen so it's like an dodgy thang and when you hit a wall, it blows up.
So it's good to first take a look at the source code
I made sure to put links in the source code for both the
exact commit of FlashPunk that I use so people don't have an issue with it,
and where to get Ogmo.
So I started out making new game world.
A is where I hold all my assets. So you can see I've got an asset for the player currently,
and an asset for the background currently.
So, two pictures right now.
C is my constants. I set the width and height of the game window. I use that for
the rotating and positioning and whatnot.
The game world is where all the world logic happens, and you can see that
game world takes a MapData.
So, it's all fleshed out. All we have to do all the way down at the bottom
is add the map creation code right here.
so that's what we're gonna be doing without milan flashpoint
and player of course handles all the pool player stuff mix and put the fly
around
blows up on things
so he started
let's open up on them
minister this is the newest version two point one point zero point two september
nineteenth twenty twelve
so
we may see you make a brand new project here
so this is not an exciting project yet we're gonna spice it up
the first that we need you
this project at a project
take that back partida neutral rendu his work in a close this project
this is a cruise they opened project but i
cleverly name new project to pull myself in the future which it worked past me
where to go
make a brand new project
classes where we want to say that
so we've got thing in here somewhere
art modell hstna fine wherever your reply was stored
and were in a store the project and a fulbright to i've named levels
and we'll just name a dot one dash
for consistency state now
both ends of that we
can read in the sidebar so we don't
think that it's a br a new projects
and we'll go ahead and set up what looks good dot so
i mean i start with the background recall ur
probably not
although it lacked was co
some cool like that
now these all of the day
so
by the fall
was to ten twenty four
now this will change based on your project
minimum will be
five twelve oh yes
the maximum will do
throats
foreigners
rights that's going to get our
level size in them over and apply them
now we start the more properties that we have a chance that
give us a bit old
blank world
so's the better project
now layers is uh...
didi ki party to diablo
so will create a new layer will call this collision
or walls are greater whatever you'd like to request an immigrant
then
i reworked on thirty july thirty two
mission of the titans grid
will do what you
now here's the different export mulford we working with bit strings in this
tutorial so just leave it there
so i have read
so won't get
so we go in here
with a rectangle tool
withdrawal bunching
tiles come out
uh...
this just entered
graphic
editing
so that's free
the spurs we world we got there really
fangs or something i don't know
thus parts tricky for the play through there
so now how do we had our players are where's the player again
what we're gonna have to add are proud of you know stuff for us
ronan said yet at the project
so
yell stop at it we don't care we didn't make any changes that are really the
same
so we want to indicate it is and what happened to it
sole name it
player start
and we wanna limited to one that means that we can only ever have one of these
in the map
with lasers
sosa precisely thirty-two by thirty-two
the origin since our players considered in the middle will go ahead and set his
origin to be in the middle
and he is not resize will but he is regrettable
and we feel irritated increments of ninety degrees
now by the fog roll just draw a muscle rectangle their but we actually have
that image file
solar and find it
is in our
assets folder
their skittish
we don't tyler it's just picture did
well that apply their no we don't want to have so we have our players are
created
snuggle reckon the layers we create a brand new layer of the city for our
entities
so limited cities
grandfather like that now we go on a smaller grade by so we have more money
positioning of art entities in our world
so for our
greer that's just standard
collision and our entities are going to be actually
you know we can position those
more granular layer
tight you guessed it tireless no that's wrong it's a disease
and this should do it for the setup of
this so hope line
may see a over here we have two different options we agree that we have
kids teens
so go ahead and
make a lovely and when i think border so player can get outside of the world
now this level will start in
come out of the little shoot here
he's in this room you've gotta get out
right once it's out of the world in
you've got the different paths to get to
those obviously more challenging that loan
he finishes up right here
solely to place our player
through player start
select him
we consume in here for more precise control
but you'll notice degree got smaller last switch entities
so now we can place a player anymore so it's been sumner
or for one second burst art remember how we septal delivered to one
group that place another one yourself
it disappears from last place was
now also we set our play to be rotatable
so we can change the angle here
not keep in mind that
the players position is from the center of
wherever you place in here so even if you take the nineties
it doesn't quite wrote it properly
and this version of our quote
editor is a known issue
but it will spon from the center of that yellow thing this is just shown you
which way he's committed
but we don't want him to be facing down over the laundry facing right there
within zero
so that's that's priesthood level
my opinion
on are made of some kind of bias
so wouldn't say that level
as
but oh you know
bazaar mo editor level
so now we have
global dot
those pretty tense right yes
now let's go in and implement this in flash
keep my now we're just working with the basic grid later here
we are going into any comments or anything like that
mail noticing game world were actually doing some weird stuff with the
in-game will really weird stuff with the
you know so we don't have any kind of
imager tile sets
we just have
an entity for the map right here
and you'll notice that we are creating a map image based on the data
of our map returns just or is a bit not there
no we scale it up to thirty two so all we're seeing is the robin map data
of our bread
grids are masks and they are used for collision only
so were counted
trickier
so we go ahead game world expects a map data
so the first now we need to do is actually add that map into our assets
will create a new
in our project browser
levels
tutorial utterly out bazaar local file
in flash developers diseases right-click generate embed code
if you not advice develop just technician
like the spotlight
static constant
we want your chances with a lot
estimate
let's go n commented
for to practice
also so we know what it is later
now in the entry
classified my badge
you see that work on a new game world
threat now we want a pass at our level
a dot level
sewing game world
expects
if we don't have not data
then it
discreet to debug map he saw that previously but if we do have map data
riddle of matt
seles check that out
to the bottom this class
to do admire creation code
let's do that
the first thing we want
keep in mind that it how he el file inaugural editor level file
is basically distraught xml
your oven open for you
so that's beatiful right pc
that level
grid was the name that we named her grid layer in the big old polka mass here
entities within that second player
into teas in one of our incision mplayer start so it's all contained within here
mike game world
so the first thing we needed to is get an external representation of the bitmap
therapy binary string that we import into our assets
we can do this by far
map xa mallard whatever you'd like to many map
estimate x an object
now flashpoint has great built-in xml parsing slowly effete
dot jackson up
was a stick
was the files maximal object
we have a file
right at that things out
somatic
give that the business
now
x_ amount xml representation of our map it
we do now
puts a secret that great
so if you've
mess with it
exim allen axis retreat is the four x i'm not going to go into that very much
but i will show you the syntax here
soaring to great agreed like a great integrity
map grid
it's a new bridge
so the with
boulevards that from our xmas
so you enter
and ill be map xml
dot
the property with
you sure
in the rude noted
which is level
their property with
renounces trang we'd turn into a unit
and another trip
another unit
natalie map x_ amount
the property of that route tag
began with a verified
looking good
move into this often put this here so we can
have better visibility
so now we expect the taiwan style height and then the ex-wife location
so we know that our piles of thirty or thirty two
we will be good to be if there's room
done and uh...
so now that we create our bread
how do we get all these ones in zeros
into the spirit
well again the flesh promises
stupidly easy film after it
dot
load from strength
loads the grid infamous travel turns out that we have a bit string
given us twelve mt thanks matt forces
so the strength
what's going to be
we don't miss it would have to cast as a string here since already has a string
but
contradicting
map xml
by brett
sanskrit is the
note itself is going to give us a call the data
within these brackets
so that's our strength
what separates each column absolutely nothing
blank string
and what separates are rose well that would be a new line police gave a new
line
theoretically that *** load of our happen
remember
we have to supper player
grosses on refiners p matt
which cant claim it's done
wine making dumb level game sorghum fixes it
crew player
uh... the players are
ballplayer thirty have him here
and create new player
so we want exultation
student-teacher
let's check this boggle father looks like our player stars that entities
player start
so map x_ amount
entities
player start
lallera unpopular securities in the future
we will be value
he's busy cabs easy
i'd know what that means
so it now only the while a patient reverting cover this uh... dot
as paces away had company those who use it again
now we need
the angle
it just happens that restoring angle here
since we checked is rotatable for our player start entity
so in case
we set a different angle we want to be able to represent that here
dot angle
and we are in a mass of the speech right now speedily to fall two hundred
you'd you did it
he doesn't
four lines of actual kotha
looks to be that we've import is properly let's go and check it out
do declare that we are planned this level thus love looks familiar ideas the
tricky bataoo there we go
you made it through now gotta figure out how to get at this place
before go over this way up around as of this late notice we put it over here
n_e_a_ we win but there's no way condition so we lose and uh...
that's life
they can never win
so that's the basics of
working with automotive mind that we only work with chris
grades are
masks types in flash funk and they are made to handle collision
we cover how to make a grid
we cover how to make entities dogma
how to place them
how to set properties on
so next time look in the tile sets and more cosmetic things 'cause
although this has a cool style it's it's man
this is an inspection
so can feel free download the source code on zekryan lewis
and uh...
happy parking l