38 Developing Cross platform 2D Games in C# and CocosSharp [w/ subs]



00:00:00 – hi welcome visual studio toolbox i'm
00:00:10 – your host robert greene and joining me
00:00:11 – today is james martin magno hey James
00:00:14 – Robert was going good
00:00:15 – James is from xamarin and this is now
00:00:18 – your seventh time on the show I can with
00:00:20 – 78 on the actual math but it's got to
00:00:22 – put you way in the lead as the most this
00:00:25 – is the guest has been here the most well
00:00:28 – when you talk about cross-platform
00:00:29 – mobile development you can hit so many
00:00:31 – different you know areas i think we
00:00:33 – started with just introduction and then
00:00:35 – as your support offline and and now
00:00:38 – there's just a whole world now we're
00:00:39 – gonna talk about games that's great
00:00:41 – which is cool so we are in the second
00:00:43 – half of the second marathon this episode
00:00:47 – three of the four we did German forms we
00:00:51 – did the iOS designer inside Visual
00:00:52 – Studio today we're going to switch gears
00:00:54 – a little bit and talk about games every
00:00:57 – time I cocoa sharp which is a brand new
00:00:59 – library and game engine that were
00:01:00 – introducing and we introduced already to
00:01:03 – build 2d games on C sharp and dinette
00:01:06 – that run across any platform really cool
00:01:09 – so you'll give us a little bit of a lay
00:01:11 – of the land
00:01:12 – what is Coco is that is it may be a
00:01:15 – high-level kind of compare contrast it
00:01:18 – to some of the other engines kind of get
00:01:21 – a sense of where what you can do because
00:01:24 – there are a number of game engines
00:01:26 – yeah and and a lot of different game
00:01:28 – engines your writing in different
00:01:29 – languages better out there could be c++
00:01:32 – could be objective c could be a whole
00:01:33 – lot of different things out there and
00:01:35 – obviously c sharp as well but we try to
00:01:37 – focus on a few different key factors
00:01:41 – when building cocoa sharp and we'll talk
00:01:42 – about the history of cocos2d cuz you
00:01:45 – people might have heard of Coco's TD
00:01:47 – it's a very large game engines open
00:01:49 – source and that's kind of where cocoa
00:01:50 – sharp came from
00:01:51 – ok so let's talk about it so there's
00:01:54 – actually a few ways to build games with
00:01:55 – xamarin the first one that people may
00:01:58 – have heard of his mono game is actually
00:01:59 – an open-source implementation of XNA
00:02:02 – which i'm sure you've heard of to build
00:02:04 – games on Mac that's top on linux on iOS
00:02:08 – on android on C sharp these are powerful
00:02:11 – 2d and 3d game
00:02:13 – it's a it's a very big engine as well so
00:02:16 – games like towerfall were built with it
00:02:18 – which is an awesome game of the get on
00:02:20 – steam good friend of those guys bastion
00:02:22 – for instance was also made with it
00:02:24 – transistor a lot of different awesome
00:02:26 – games you go to mono game i think that
00:02:27 – Borg and and find all the awesome things
00:02:30 – that's really it's it's a larger engine
00:02:32 – lots of things that big barrier of entry
00:02:34 – but really powerful
00:02:36 – ok so you gotta be a serial what you
00:02:38 – need to be a serious gamer basically
00:02:40 – building games for a living essentially
00:02:43 – to to do that right that's not the kind
00:02:45 – of thing that you'd play around with on
00:02:46 – the weekend you could definitely play
00:02:47 – around with it
00:02:48 – yeah okay okay if you like to XNA too
00:02:50 – especially here in XNA developer can
00:02:52 – imagine taking your XNA game and
00:02:54 – importing it to other systems as well so
00:02:56 – you're familiar with XNA want to get up
00:02:57 – and running model game is a good way to
00:02:59 – transition to cross platform ok but
00:03:01 – little bit bigger now model for unreal
00:03:04 – is the brand new library that we
00:03:06 – introduced so I'm sure familiar with
00:03:08 – unreal also motto for unreal works on on
00:03:12 – pc and on a mac and it's an open source
00:03:16 – project you can learn more about it so
00:03:17 – it's obviously Unreal Engine & and
00:03:20 – that's pretty close on mobile though
00:03:22 – ok there's a few engines built into core
00:03:25 – iOS that are extremely popular that kind
00:03:27 – of lead into the cocoa sharp for 2d and
00:03:29 – 3d gaming so sprite kit is just built in
00:03:32 – Iowa
00:03:33 – so when we talk about mono game like
00:03:35 – that's very much cross-platform sprite
00:03:37 – kit is an iOS only 2d powerful games and
00:03:40 – you get so that requires objective-c
00:03:41 – objective c or c sharp was a marin ok so
00:03:45 – again you know either way you're
00:03:46 – building with iOS and then also like
00:03:49 – really when you look at iOS there's like
00:03:51 – lots of things built into the core
00:03:52 – framework such as spray co just another
00:03:55 – library built in for building
00:03:57 – sprite-based games and their seen kit so
00:04:00 – these two kids here are actually really
00:04:03 – intense game and rendering engines built
00:04:06 – right into iOS so these the problem with
00:04:08 – these obviously is that it's only island
00:04:11 – right i was only ok so that's what kind
00:04:13 – of cocoa sharp comes from so we kind of
00:04:15 – see different images along the way in
00:04:16 – cocoa sharp really think the gala kinda
00:04:18 – says that the best before we talk about
00:04:20 – the history is that Miguel said that
00:04:22 – cocoa sharpen blends everything that
00:04:24 – people love about cooking
00:04:25 – 2d programming model with C sharp and
00:04:29 – the.net framework and then of course
00:04:31 – that API that you're developing against
00:04:33 – is always sharpen dotnet idioms
00:04:36 – ok so the cocos2d for every rumor came
00:04:39 – first
00:04:40 – yes a Coastie is an open source project
00:04:41 – you can find it at cocos2d dot org and
00:04:44 – what that is originally is forward just
00:04:47 – OS acts and iphone and and and desktop
00:04:52 – really and I was all an objective-c
00:04:54 – there's a lot of flavors that have been
00:04:57 – spun off since then so there's cocos2dx
00:04:59 – which is actually cross platform in c++
00:05:03 – and that was brought over to multiple
00:05:05 – platforms then there was cocos2d sprite
00:05:09 – builder which is more for objective-c
00:05:12 – based but for iOS and for mac and for
00:05:15 – Android a little bit as well again
00:05:18 – objective-c ok and then there was
00:05:20 – cocos2d XNA which was kind of built on
00:05:23 – top of mono game and took the cocos2d
00:05:26 – programming model and brought it on top
00:05:30 – of mono game with C sharp
00:05:33 – ok so when we say Koko sharp blend
00:05:36 – everything that developers maybe know
00:05:38 – about cocos2d I was sharpened dotnet the
00:05:41 – problem that kind of occurs at all these
00:05:44 – cocos2d and just kind of took the
00:05:45 – objective c library with delegates and
00:05:47 – all these weird callbacks and whatnot
00:05:49 – but didn't apply all those c-sharp and
00:05:51 – Donna idiom right so we didn't we
00:05:54 – if you already know objective-c that's
00:05:55 – great but if you're csharp developer
00:05:57 – kinda doesn't help you much
00:05:58 – yeah so when you go to like read through
00:06:00 – the API is like this doesn't make any
00:06:02 – sense so when you're developing this
00:06:03 – normal ios and android apps was a
00:06:05 – mergency sharp and give a click handler
00:06:06 – is equals and then all of those normal
00:06:09 – idioms that we know and love the naming
00:06:11 – all makes sense
00:06:12 – ok what we did is we took a fork and
00:06:15 – completely which open sources also Co
00:06:17 – sharp is open-source against MIT license
00:06:20 – and we added all these sharp Donna
00:06:23 – idioms we cleaned up a lot of the api's
00:06:25 – for.net developers that are coming in
00:06:28 – that will understand it and we'll see
00:06:30 – that as we walk through some code is
00:06:32 – very simple with simple callbacks and
00:06:34 – events in there as well and we cleaned
00:06:37 – up on one thing
00:06:38 – which is you kind of have these scenes
00:06:40 – so the nice thing about Coco sharpens
00:06:42 – it's a node-based so everything's nodes
00:06:44 – with with the scene with layers and with
00:06:47 – nodes which are going sprites or layers
00:06:49 – or fonts that you're putting down so we
00:06:51 – cleaned up some other things to make it
00:06:53 – more mobile-friendly such as the
00:06:55 – director that's directing scenes like I
00:06:57 – want to go to this this this level or
00:07:01 – that level of the game over screen we
00:07:03 – really made it
00:07:05 – it used to be a single 10 now it's no
00:07:07 – longer single 10 so that opens up a
00:07:09 – whole series of things that you can do
00:07:13 – especially when you're on desktop you
00:07:14 – might have multiple screens open as well
00:07:15 – multiple HUDs things like that so that's
00:07:18 – Coco sharp right yeah
00:07:20 – now there's course a lot of other game
00:07:22 – engines out there and you can roll your
00:07:23 – own game engine there's unity there's a
00:07:25 – lot of other things with builders and
00:07:28 – you know level editors as well just then
00:07:31 – quick overview elevator pitch when i use
00:07:35 – cocos2d when I think about using unity
00:07:37 – so cocos coast city and Coco sharp is if
00:07:41 – you want to get in and build out a great
00:07:44 – cross-platform a 2-d game
00:07:47 – ok let's really focus on to be there is
00:07:49 – some 3d aspect to it as well but it may
00:07:51 – not be the most complex game in the
00:07:53 – entire world you can make some fun games
00:07:55 – really short get them up and running and
00:07:57 – then automatically just inside Visual
00:08:00 – Studio is shared projects or file
00:08:01 – linking portable class libraries just
00:08:03 – bring all that code over okay
00:08:05 – inside there you don't not really
00:08:06 – worrying about building this huge 3d
00:08:08 – scene out and leveling it's just you
00:08:11 – know very to the point of what i want to
00:08:13 – do ok it's always a good choice for
00:08:15 – somebody that just wants to start
00:08:16 – playing around with games oh absolutely
00:08:18 – yeah I'm not gonna quit my day job and
00:08:21 – build games for a living
00:08:22 – that might be kind of fun to bang out a
00:08:24 – couple games just for the heck of it
00:08:25 – totally and and people there are
00:08:27 – actually people that have really
00:08:28 – successful cocos2d games that that's
00:08:30 – actually what they do so and I mobile
00:08:33 – sometimes obviously 3d isn't exactly
00:08:36 – what you need a great 2-d game can do
00:08:38 – being extremely successful ok as well so
00:08:41 – it's just kind of a fun c or c sharp
00:08:43 – developer want to get into games a
00:08:45 – little bit play around
00:08:46 – I was at a game jam
00:08:47 – in Arizona last year and i was able to
00:08:49 – make a really awesome game called
00:08:51 – nibbles was like these this game that
00:08:54 – was like these balls got bigger need to
00:08:55 – connect them to pop them for instance
00:08:57 – and he had 60 seconds and I built that
00:08:59 – game in under 20 hours across you know
00:09:03 – three platforms which is pretty cool
00:09:05 – yeah and I made games i used to work on
00:09:06 – xbox 360 games back when I was so I went
00:09:09 – to school for originally actually so
00:09:11 – it's really different working on this
00:09:12 – huge 3d you know xbox 360 game to like
00:09:15 – focus on mobile because the different
00:09:17 – different idea to a lot of larger 3d
00:09:19 – game engines are based on the controller
00:09:21 – input you know when we're actually on
00:09:22 – our phones and we're worried about touch
00:09:24 – input right
00:09:25 – soco sharp has a touch-based event-based
00:09:27 – first API okay yeah cool
00:09:32 – so before we get into code we're going
00:09:34 – to build a simple game but I wanted to
00:09:35 – kind of break down the API and the
00:09:37 – structure of a garret so it's all based
00:09:41 – on the point of an application so an
00:09:43 – application is your iOS application your
00:09:45 – Android application Windows Phone
00:09:47 – Windows Store doesn't matter and inside
00:09:49 – that's an application dell desktop as
00:09:51 – well
00:09:52 – desktop as well yeah it could be we'll
00:09:54 – see there's like multiple so it doesn't
00:09:56 – have to be a mobile game doesn't have to
00:09:58 – be no it could be this desktop as well
00:10:00 – it could run on mac as well it doesn't
00:10:03 – matter you can run this game anywhere
00:10:04 – okay well the application handles
00:10:07 – application things right so starting the
00:10:10 – game pausing the game and you can put in
00:10:12 – a like your application lifecycle events
00:10:14 – in here as well and also handles
00:10:16 – building the game engine on each so that
00:10:20 – the different device drivers that need
00:10:22 – to be loaded because obviously that's
00:10:24 – very different from iOS to Android to
00:10:27 – Windows but we handle that for you right
00:10:28 – don't and then there's this thing called
00:10:31 – director and I mentioned this a little
00:10:32 – bit the directors kinda like it's almost
00:10:34 – like the puppet master those the fancy
00:10:35 – transitions you were telling me about
00:10:37 – earlier those are the fancy fade in
00:10:39 – transition is already asked them I said
00:10:41 – I put a lot of work stop waiting for
00:10:43 – them with bated breath like I put in for
00:10:46 – robbers output in tons of fancy
00:10:48 – powerpoint animation here actually the
00:10:51 – hardest part is just like getting arrows
00:10:52 – to look correct
00:10:53 – yeah powerpoint master you think after a
00:10:56 – year-and-a-half would be amazing and
00:10:58 – whizzing around all over the place so
00:11:00 – the directors like a puppet master right
00:11:02 – its kind of directing all the scenes of
00:11:04 – your application so it points and
00:11:05 – directing where to go so if the game
00:11:08 – ends you tell the director to move to
00:11:11 – the next scene okay so that's where the
00:11:13 – scene comes in so we're kinda now going
00:11:15 – down the chart and the scene has layers
00:11:18 – so each scene kind you can think of it
00:11:19 – as a level of your game or the start of
00:11:23 – your game the meal credits of your game
00:11:26 – those are scenes got it
00:11:27 – I need each scene has layers so there's
00:11:31 – multiple layers which contain nodes so
00:11:33 – friends I might have a layer that has
00:11:35 – labels a layer that has sprites or menus
00:11:37 – on top of it so seen can have multiple
00:11:39 – layers you can layer things on top of
00:11:41 – each other you could adapt to them for
00:11:42 – instance and then obviously layer has
00:11:45 – nodes in this instance are my sprite
00:11:47 – layer has some sprites but everything is
00:11:49 – no base so if i have a node i can apply
00:11:52 – actions to specific note to all the
00:11:54 – layer to the specific sprite that's why
00:11:57 – it's a new today's that makes sense
00:11:59 – yeah but this is what our game looks
00:12:00 – like in general and there's a lot more
00:12:01 – layers as well like sounds and things
00:12:03 – right and particle effects yeah so if
00:12:07 – you've never really looked at the looked
00:12:10 – at a a game engine before usually like a
00:12:12 – game rendering loop as well so you're
00:12:14 – rendering out those layers over and over
00:12:15 – again that's kind of what's happening
00:12:17 – here
00:12:17 – ok so cool there we go there's a lot
00:12:21 – more to sew things that will we can also
00:12:23 – talk into as well we'll demo a little
00:12:25 – bit there's cross-platform accelerometer
00:12:27 – support audio support primitives if you
00:12:30 – just want to draw lines around and you
00:12:33 – know vector-based basically you can do
00:12:35 – that with scales really nice
00:12:37 – we have particle effects you can have
00:12:39 – explosions will see some of that as well
00:12:40 – today and there's some built-in there's
00:12:44 – also tools there's a lot of
00:12:45 – cross-platform particle particle
00:12:47 – generators that people are used to and
00:12:50 – and they all export to a familiar eight
00:12:53 – API that will just come right into the
00:12:55 – game
00:12:56 – ok we also parallax which is kind of
00:12:59 – cool to see like a little monkey move
00:13:00 – the the clouds move up and down this is
00:13:02 – one of our sample games that we ship is
00:13:05 – a little parallax which is this is
00:13:07 – actually relative
00:13:07 – the hard you would say like have this
00:13:09 – monkey so I go back and forth you
00:13:11 – normally it's a program this and say
00:13:12 – move the clouds up and down based on the
00:13:15 – scale but there's just a parallax node
00:13:17 – that automatically does it for is like
00:13:19 – one line of code automatically scale
00:13:20 – things which is cool and we have a fact
00:13:23 – such as like wobbly and all this
00:13:24 – craziness going on there's a lot built
00:13:26 – into it as well as physics so there is a
00:13:28 – complex physics engine here as well
00:13:30 – that's going on is this goes up and down
00:13:32 – this box you can see like the physics
00:13:34 – engine going in and we have an amazing
00:13:35 – samples library that breaks on every
00:13:38 – little thing that you can do google was
00:13:41 – not built in so it's not just simple i
00:13:43 – guess we're gonna show a simple example
00:13:44 – but will really go in depth so let's
00:13:47 – build the games will a game so i told
00:13:50 – you the game that we're going to build
00:13:51 – is something very simple it's going to
00:13:53 – be this little ball that bounces down
00:13:55 – and we can knock it up and kind of keep
00:13:56 – it up as long as we can okay that'll be
00:13:58 – the idea i also want to mention that you
00:14:01 – can actively contribute and open issues
00:14:04 – and see the entire progress of
00:14:05 – everything how this was built on get up
00:14:07 – get up dot com / mono / coco sharp okay
00:14:11 – you can see everything that's in here
00:14:13 – from our Wikipedia page with samples all
00:14:16 – of everything in here it's our Wikipedia
00:14:18 – page is really fantastic for going
00:14:20 – through an API improvements key
00:14:22 – differences nuget packages everything is
00:14:25 – distributed on you get which is really
00:14:26 – cool and also how to get the project
00:14:30 – templates which is where we're going to
00:14:31 – start this game so the project templates
00:14:33 – I've gone and I've installed the visual
00:14:35 – studio templates here so it's a very
00:14:37 – first thing so when you install xamarin
00:14:39 – you're not just going to see these
00:14:40 – magical you're gonna have to install
00:14:42 – these they just come from the the
00:14:44 – gallery
00:14:45 – ok as well so that's kind of the purpose
00:14:47 – of where we're about to go so when we do
00:14:51 – that we say new project will see a new
00:14:55 – entry called Coco sharp and inside here
00:14:57 – we'll see Android iOS and windows
00:15:00 – ok I notice when you go to windows
00:15:02 – there's windows phone store windows
00:15:04 – stores amal and windows GL or Windows
00:15:07 – drag tax you kind of depend and debate
00:15:10 – what you want to go with but all your
00:15:12 – code will be shared so it's kind of core
00:15:13 – game engine is what you're picking ok so
00:15:16 – I'm going to start here on Android empty
00:15:18 – game and we'll call this
00:15:20 – bouncy see Android and will clean up the
00:15:25 – solution name there and create it so
00:15:29 – this is going to do is going to set up
00:15:30 – our core game and download all our new
00:15:32 – gets automatically for us which is very
00:15:34 – convenient
00:15:35 – you know actually set up like a little
00:15:37 – default game seen that we can actually
00:15:40 – run and actually see what it looks like
00:15:42 – here so we can see down to the very
00:15:44 – bottom it's actually installing our
00:15:45 – cocos2d stuff and we're good to go
00:15:48 – let's take a look here and see what we
00:15:49 – have so awesome atuli by default we're
00:15:53 – going to get a a program which is the
00:15:58 – base of our application now this is
00:16:00 – going to control if you want landscape
00:16:02 – or portrait mode and this is going to
00:16:04 – set up our applications this our main
00:16:06 – activity of our application we're kind
00:16:08 – of good to go so i'm going to change one
00:16:10 – thing
00:16:10 – this game is going to be all portrait
00:16:12 – we're going to change it to poor trip so
00:16:14 – we'll see screen orientation we're going
00:16:16 – to change that to portrait just so it
00:16:18 – kind of stays correct and you can you
00:16:21 – can obviously adjust for that as well
00:16:23 – one other thing going to do is we're
00:16:25 – gonna make a few modifications here to
00:16:27 – our compile so if you have you seen some
00:16:31 – of our other videos you've seen like
00:16:33 – what kind of do we want to support so
00:16:36 – i'm going to do is come into properties
00:16:37 – and i'm going to say that i would like
00:16:38 – to run this on a few older devices but
00:16:41 – not all older devices right great
00:16:45 – ok so very simple just a little bit of
00:16:47 – modification and then we'll see this app
00:16:50 – delegate delegate here is what's going
00:16:54 – to control our life cycle so it's going
00:16:57 – to set a few things for us is going to
00:16:58 – set a content directory that's going to
00:17:02 – set up our default window for us and
00:17:03 – it's actually going to start our game
00:17:05 – down here we are creating a new scene
00:17:07 – and we're adding a layer to it and we're
00:17:10 – going to run the game with the scene
00:17:12 – controller class that exists ok
00:17:16 – yep it's a class that exists and that's
00:17:17 – we're going to write all of our game
00:17:18 – logic so it's going to be one layer of
00:17:20 – an application you to imagine a multiple
00:17:22 – layers with multiple scenes for instance
00:17:24 – or a scene might have multiple layers
00:17:26 – that you're transitioning through ok and
00:17:29 – then you can see here we get some
00:17:30 – application events like did enter
00:17:31 – background
00:17:32 – you will enter foreground things like
00:17:34 – that which are pretty convenient so
00:17:36 – since this is a landscape we're going to
00:17:38 – go ahead and change the desired width
00:17:40 – from here so the with we want 768 and
00:17:44 – we'll changes to 1024 now Coco sharp
00:17:47 – will automatically fit the screen
00:17:50 – resolution as best as it can so we can
00:17:52 – see here that it's set design resolution
00:17:54 – and these are just desired width so it's
00:17:57 – going to do its best to fit on the
00:17:58 – screen size as best as i can based on
00:18:01 – aspect ratio you can always modify that
00:18:04 – and you could always have platform
00:18:05 – specific code in there as well
00:18:07 – ok so let's go into our intro layer and
00:18:11 – see what that looks like
00:18:13 – so this is where all of our sprites are
00:18:14 – going to learn to start building out our
00:18:16 – nodes so by default here we have a layer
00:18:19 – of a color and down here it's actually
00:18:21 – color blue which kind of the background
00:18:24 – color and it adds a label this is a cc
00:18:27 – label so everything is prefaced with CC
00:18:29 – which is cocos right there
00:18:32 – soco's labels if you're actually reading
00:18:33 – the cocoa char cocos2d documentation it
00:18:36 – follows those idiom so it's not quite a
00:18:39 – hundred percent c-sharp idiom but we
00:18:40 – didn't want to lose the cocos part of
00:18:42 – that because just naming conflicts
00:18:45 – let's take a look here and we can
00:18:48 – actually go ahead and run this game is
00:18:49 – going to build it here we can also take
00:18:52 – a look at the references the seed and
00:18:54 – actually added tons of different
00:18:55 – references here we have cocoa sharp and
00:18:58 – mono game and open TK and a bunch of
00:19:00 – other stuff in there as well as that
00:19:01 – handled it all for us as well so if we
00:19:04 – run this game that we have so far before
00:19:07 – we start adding objects on here watching
00:19:11 – to see hopefully a blue background with
00:19:13 – a label that says hello Coco sharp so go
00:19:17 – ahead and build it up and deploy it
00:19:18 – right onto our android device here
00:19:25 – there we go so maybe not the prettiest
00:19:28 – thing in the world so let's go ahead and
00:19:29 – change this level it is at the moment
00:19:31 – absolutely the world's worst game ever
00:19:33 – worst game ever do anything doesn't do
00:19:36 – any point it works but it totally works
00:19:38 – yeah if you actually ran this on iOS and
00:19:40 – building that project was really work as
00:19:41 – well yes
00:19:42 – so that's cool that's going to do some
00:19:44 – stuff so let's add in some see so we get
00:19:47 – Cece and then everything for Coco's
00:19:49 – comes up so let's add some sprites and
00:19:54 – we're going to add a paddle sprite and a
00:19:58 – ball sprite
00:20:00 – there we go and then we'll go ahead and
00:20:03 – do those up here so we'll say paddle
00:20:05 – spray equals new sprite and it is going
00:20:10 – to want a file name so we can actually
00:20:11 – pass in a default file name of what this
00:20:14 – file will be so i actually have them
00:20:16 – here already so I have a little folder
00:20:19 – and have a ball in a paddle weekend if I
00:20:21 – open that up we can see what it looks
00:20:22 – like the ball was going to copy those in
00:20:26 – and we're going to put those inside here
00:20:28 – so all of our assets and everything live
00:20:30 – inside of our assets content folder drag
00:20:33 – those in now we can say this will be our
00:20:36 – paddle and then we will say addchild and
00:20:42 – then we will go ahead and say paddle
00:20:44 – sprite perfect so does that paddle
00:20:48 – literally refer to paddle that PNG in
00:20:51 – the content folder gas or this is more a
00:20:54 – virtual it's a sprite called paddle but
00:20:57 – it's not associated with literally the
00:20:58 – paddle
00:20:59 – so you can out you can do spreadsheets
00:21:00 – as well where you can actually go ahead
00:21:02 – and and pull items out of a sprite sheet
00:21:05 – what this is doing is is pulling its
00:21:08 – looking for the first file that has
00:21:11 – paddled dot and this allows you to
00:21:13 – actually named it a little bit different
00:21:14 – when you go to Windows Phone will see
00:21:15 – why
00:21:16 – ok I'm as well so there's paddle in
00:21:18 – there and the reason that this works and
00:21:20 – it knows it's in content because up here
00:21:22 – I said my content root directory is
00:21:24 – contacting so that's what it's looking
00:21:26 – for under my assets and then you can put
00:21:29 – sounds and sounds and you can have high
00:21:30 – definition files as well in different
00:21:33 – fonts was going to do ball sprite those
00:21:38 – new sea spray
00:21:39 – ball and child and we'll go ahead and
00:21:44 – say ball sprite perfect
00:21:46 – we've added two new items to the scene
00:21:48 – but we haven't given them any contacts
00:21:50 – yet so we can actually see let's make
00:21:52 – this black as well so that's a black
00:21:55 – background
00:21:56 – perfect all right now we want to do is
00:21:59 – we want to go ahead and do two things we
00:22:05 – want to go ahead and first put down the
00:22:08 – ball like and the paddle on the screen
00:22:10 – give us some default x and y position
00:22:12 – then we're going to add some like some
00:22:14 – logic to actually have the ball fall
00:22:15 – we're going to do some interaction with
00:22:18 – the paddle as well so after this
00:22:20 – constructor got called where we added
00:22:22 – those items to the scene we're doing an
00:22:24 – event called added 2 scene kinda makes
00:22:26 – sounds kinda like getting ready and here
00:22:28 – we can see that the position of the
00:22:29 – labels been added to the center of the
00:22:32 – screen we can also go ahead and say
00:22:35 – paddle spray dot position you get the
00:22:41 – position acts in the position Y so let's
00:22:43 – go ahead and set the paddle spread is
00:22:45 – equal to a hundred and paddle spray
00:22:48 – position
00:22:49 – y equal to a hundred was kind of hard
00:22:51 – coating them here but these are just
00:22:53 – pixel-based then we'll say the ball
00:22:56 – sorry about position X will set that
00:23:00 – equal to us to put in the middle 320
00:23:03 – inbal sprite position
00:23:06 – y equal to 6 40 so this is all kind of
00:23:09 – down on the bottom lower left is our
00:23:11 – tractor or origin ok that makes them so
00:23:14 – we're hoping that the ball the ball in
00:23:16 – the paddle or our paddles on the bottom
00:23:19 – left and the ball is kinda in the middle
00:23:21 – of the screen
00:23:22 – let's go ahead and just move this here
00:23:24 – this position will say position equals
00:23:27 – say y equals found since our bounds are
00:23:34 – virtual visible world bounds against a
00:23:36 – minimum Y is 30 that should work we'll
00:23:42 – see if the label shows up we kinda want
00:23:45 – to set it to a little bit lower on the
00:23:48 – screen you'll see if that's correct
00:23:49 – logic off the top my memory
00:24:05 – so again it's going to recompile up the
00:24:06 – application and then read a plate here
00:24:08 – on the android phone
00:24:14 – okay so it looks like my my labels gone
00:24:17 – so we can try to find where that goes
00:24:18 – well as we see with a paddle and we have
00:24:19 – a ball
00:24:20 – yeah totally happen and we almost have a
00:24:22 – game oh ho mouse
00:24:24 – alright let's um let me just put the
00:24:27 – score back in the middle just to see
00:24:29 – where it's supposed to be i have a full
00:24:30 – working example might get help of
00:24:32 – exactly where it should be
00:24:33 – yeah so not my memories should be there
00:24:35 – let's check this out when i move so now
00:24:40 – we want to do is we want to move the
00:24:41 – paddle so wherever I touch on the screen
00:24:43 – if I tap here i want to move the paddle
00:24:45 – their your imagine going to get a touch
00:24:47 – event and then I want to move it
00:24:48 – somewhere so we can do one of two things
00:24:50 – the first thing that we actually get
00:24:52 – this template is the CC eventlistener
00:24:54 – touch all at once so saying anywhere i
00:24:57 – touch on the screen
00:24:58 – let me just get a touch event so there's
00:25:01 – a few different touch events that we can
00:25:02 – get we can say on touches ended moved
00:25:06 – began on here so we can just say on
00:25:10 – began to every time I touchdown will get
00:25:12 – a touch event so sure enough it's
00:25:16 – already set up for me it's kinda nice
00:25:17 – the default template kind of knows what
00:25:18 – we're going to do right so let's go
00:25:23 – ahead and say whenever I move and i have
00:25:27 – a touch i actually have a touch let's
00:25:29 – move that paddle sprite now we don't
00:25:32 – move the entire position what we could
00:25:34 – do is we could say position equals our
00:25:36 – first touch here we can index and on the
00:25:39 – first touch and you can do multi-touch
00:25:41 – dot location now this seems like a good
00:25:43 – idea that I just move the position to
00:25:46 – wherever I touch on the screen but if we
00:25:48 – run this again we're going to see this
00:25:49 – is probably not the desired effect that
00:25:51 – we want to do because we'll find out
00:25:56 – let's touch on the screen is kind of fun
00:26:00 – so now you can see I'm kind of moving
00:26:04 – the paddle everywhere
00:26:05 – that's not really what we want what we
00:26:07 – really want is it's a slide left and
00:26:09 – right back in 4k right so let's go ahead
00:26:11 – and change this logic so we will say we
00:26:14 – could we could come in the same position
00:26:16 – X and then touches you know it's
00:26:19 – sub-zero dot location dot X like we
00:26:23 – could do that but we can do something a
00:26:25 – little bit better
00:26:26 – we could actually add a action on to
00:26:30 – this so we're going to call this thing
00:26:32 – can run multiple you can run multiple
00:26:33 – actions on a sprite at the same time in
00:26:36 – action is multiple things those action
00:26:39 – in here which is look at action so
00:26:44 – there's a lot of different actions like
00:26:45 – easing in different states and tweening
00:26:48 – and all this stuff what we actually want
00:26:50 – to do is do a move action or move to
00:26:54 – so what we can say is we can move to a
00:26:57 – position over a time and it will
00:26:59 – automatically interpolate that for us
00:27:00 – automatically so we move that over point
00:27:03 – one to a new position is a new a point
00:27:08 – and pass in an X&Y so we want the paddle
00:27:12 – dot y that position Y and then up sorry
00:27:19 – that's the why do we want to pass the X
00:27:22 – first and the ex that we want is the
00:27:23 – touches sub 0 dot location dot X ok
00:27:27 – there we go
00:27:28 – so we're going to move it to this new
00:27:30 – position on the x and the y and it'll go
00:27:32 – ahead and figure that all out for us
00:27:34 – automatically and you can run multiple
00:27:36 – actions so these will actually change
00:27:38 – things together so if you actually run
00:27:40 – multiple actions that will go ahead and
00:27:42 – manage that for you automatically its
00:27:43 – new in this API you have to worry about
00:27:45 – managing the actually i'll make sure
00:27:47 – that this actions finish before starting
00:27:48 – a new action we handle that for you
00:27:50 – automatically
00:27:56 – so now we can see that it automatically
00:27:59 – is nice little smooth transition
00:28:01 – whenever I tap on it tonight
00:28:03 – not bad cool that does not let you drag
00:28:07 – it yourself right it doesn't so
00:28:09 – everytime we touch down
00:28:10 – got it on it here now we could do a
00:28:13 – little bit more logic in here such as on
00:28:16 – moved because every time we move it then
00:28:19 – we actually get it
00:28:21 – so ideally we want to do is every time i
00:28:23 – do moved and also when I begin touch
00:28:28 – that makes sense when i touchdown move
00:28:33 – it and also when i move it touch it is
00:28:35 – moving as well and will get the same
00:28:37 – action here
00:28:38 – that's a good point because obviously
00:28:39 – you want to actually be able to drag
00:28:41 – this around right is the idea we don't
00:28:44 – want to be jerky but is that going to be
00:28:45 – when you touch it or when you touch a
00:28:49 – good question
00:28:50 – so this what we're applying it to here
00:28:52 – is we're touching it on the entire
00:28:55 – screen
00:28:56 – ok now what you could do at this point
00:28:59 – that's only have 45 minutes or so to do
00:29:02 – this well you could do is you could
00:29:03 – actually do some bounding boxing
00:29:05 – bounding box logic because they did the
00:29:07 – user actually press and actually touch
00:29:10 – the paddle right if they didn't then
00:29:12 – don't allow them to do it but remember
00:29:13 – you're on a mobile device
00:29:15 – yeah the paddles only so big yes so you
00:29:17 – might just want to allow them to touch
00:29:18 – it here so so now as we can see as we
00:29:22 – dragged across ok we're actually getting
00:29:24 – more updates in real-time as well which
00:29:26 – is kinda cool right
00:29:28 – no answer for soft problem solved
00:29:30 – alright so to speed up a little bit of
00:29:32 – time what we want to do now is we want
00:29:33 – to drop the ball down to the bottom I
00:29:35 – would code snippet little game logic
00:29:38 – here so but i'm going to walk through it
00:29:40 – just kinda want to write an entire game
00:29:42 – logic here from scratch but this that
00:29:46 – this year is called run game logic and
00:29:49 – this is kind of just a default method
00:29:51 – that will get called every single frame
00:29:52 – that I need to update you can have it
00:29:54 – update on intervals because not only
00:29:56 – does this layer handle the sprites but
00:29:59 – it also has its own game loop so it can
00:30:00 – just handle logic as well so we want to
00:30:03 – do is we want to have some default
00:30:04 – gravity here that says at in a velocity
00:30:08 – X&Y
00:30:08 – so this ball is going to move X&Y down
00:30:11 – is going to certain gravity that pulls
00:30:12 – it down so we'll do is every single
00:30:15 – frame that needs to update we're going
00:30:17 – to pull in a little bit of logic to
00:30:19 – actually move the ball down or up based
00:30:22 – on its velocity because you might be
00:30:23 – launching it up once it hits the paddle
00:30:25 – around launch it up right so the
00:30:27 – velocity is what's controlling that and
00:30:29 – then there's a little bit of game logic
00:30:31 – here to actually handle it
00:30:32 – little linear approximation and then to
00:30:37 – actually see if the ball has such the
00:30:39 – paddle we're going to actually use this
00:30:41 – method called bounding box transformed
00:30:43 – apparent which is pretty cool so it puts
00:30:45 – a bounding box around that sprite in it
00:30:48 – with this one method will tell us if
00:30:49 – it's overlapped so one method to put a
00:30:52 – bounding box around it which is a pretty
00:30:54 – good approximation it's not like a
00:30:56 – circle around it but right for all
00:30:58 – intensive purposes you can build
00:31:00 – multiple bounding boxes as well and of
00:31:03 – course we want to make sure here if the
00:31:04 – ball is moving down so is our velocity
00:31:06 – on the y less than zero because we don't
00:31:08 – want to actually do any of the bounding
00:31:10 – box stop it and bounce it back up but
00:31:12 – it's not moving down okay right because
00:31:15 – this is one issue that a lot of people
00:31:16 – will run into right away is that they
00:31:18 – say okay it hits the paddle and then I
00:31:20 – want to launch a backup but on the next
00:31:22 – frame they're probably still touching
00:31:25 – right because you only switch the
00:31:27 – velocity haven't actually moved it up
00:31:29 – off the paddle you always want to make
00:31:31 – sure that not only is it colliding with
00:31:33 – the paddle but also are you moving down
00:31:36 – you actually want to perform another
00:31:37 – action to reverse the velocity so when
00:31:40 – when that's the case where I'm
00:31:42 – overlapping and I'm moving down simply
00:31:44 – flip the bit here ok flip the velocity
00:31:46 – I'm resetting some defaults here and i'm
00:31:49 – creating a random velocity so that way
00:31:51 – every single time on the axe i can push
00:31:54 – it in a different direction left or
00:31:55 – right as well and at that point what
00:32:00 – we're going to do is check to see if the
00:32:05 – ball we want to make sure that it just
00:32:07 – doesn't fly off the left or right side
00:32:08 – of the screen
00:32:09 – ok so how ok so just about that you have
00:32:14 – to check that yourself it's not built in
00:32:18 – that it knows when it's at the edge of
00:32:19 – the screen
00:32:20 – yeah correct I mean
00:32:21 – because the whole the whole idea is you
00:32:22 – mean you might be scrolling an entire
00:32:24 – layer up right you might be scrolling
00:32:26 – might be moving up a crazy acts and
00:32:28 – y-axes this the it's almost like a world
00:32:31 – landscape it's like a spacelander it was
00:32:32 – Infinite area to move on
00:32:35 – ok you have your game bounds which is
00:32:37 – what we're seeing here we have this
00:32:38 – visible world bounds and that will
00:32:41 – automatically tell you you're Max and
00:32:43 – you're max why so here we're just going
00:32:45 – to check our min and Max x better here
00:32:47 – and then we're going to see if we should
00:32:50 – reflect backwards so we actually you
00:32:53 – know detective if we need to bounce off
00:32:54 – the paddle or now at this point if we
00:32:56 – need to switch RX velocity left and
00:32:58 – right so it will just check to make sure
00:33:00 – that if our our ball after ball right to
00:33:03 – make sure they're on the screen and
00:33:05 – that's it so it's a little bit of game
00:33:07 – logic and so we want to do a few things
00:33:09 – up here so now that we're back into are
00:33:11 – added to scene we can go ahead and say
00:33:14 – run game logic i'm sorry schedule
00:33:20 – schedule schedule schedule so we're
00:33:23 – going to schedule on an interval and
00:33:25 – it's going to automatically just do it
00:33:26 – every frame we can have it you can
00:33:28 – perform multiple scheduled of actions to
00:33:31 – occur so you can you might have some
00:33:33 – particle exploding like every five
00:33:35 – seconds over here multiple enemies
00:33:36 – spawning in so for instance in my game
00:33:39 – that i created i had had these little
00:33:41 – balls like um coming and schedule them
00:33:44 – like every five seconds to pop up in the
00:33:46 – games you can have these random events
00:33:47 – person so we're going to schedule and
00:33:51 – what this is going to take in is in
00:33:54 – action and we see it's a float action
00:33:56 – here which is going to be our run game
00:33:58 – logic method so now every single frame
00:34:01 – of our game we can we obviously optimize
00:34:03 – this to be every frame per se but it's
00:34:05 – going to run this game logic here then
00:34:07 – so let's do a few one other thing here
00:34:09 – is we know that if the ball is
00:34:12 – overlapped and we're moving down that we
00:34:16 – are going to reflect it back up so we
00:34:19 – want to increase the score so I've gone
00:34:22 – ahead and put a little score equals 0 up
00:34:24 – top here so it's just a score plus plus
00:34:27 – and then of course we have our label
00:34:29 – that we created it was that the text
00:34:32 – equal to
00:34:34 – format and we can say score and we'll
00:34:43 – just put the score in there so we are
00:34:45 – increasing the score so we know what's
00:34:46 – going on
00:34:47 – alright it's going to run this again so
00:34:52 – now our balls going to drop
00:34:53 – automatically so we've scheduled this to
00:34:54 – run and I will be pretty quick to make
00:34:56 – sure that i can do this and all right
00:34:59 – there we go we see our score increase
00:35:06 – their it's bouncing off the walls
00:35:08 – automatically my back and forth all
00:35:12 – right so we're gonna run into one issue
00:35:14 – of course I just like don't move
00:35:17 – let's say I go here which is what you're
00:35:19 – gonna die boredom before you finish boom
00:35:21 – in our balls off the screen right so
00:35:24 – it's completely gone
00:35:25 – well good you lost lost but we didn't
00:35:27 – tell our user that at all
00:35:28 – so we can come down here and say is we
00:35:30 – could say if our ball was it a tarball
00:35:37 – sprite top position Y is less than are
00:35:44 – visible world's based on max max why
00:35:51 – it's greater than that's what i want to
00:35:54 – do let's see if that's the logic
00:35:56 – well we can do is we can go ahead and
00:35:57 – reset our ball so if we go ahead and
00:35:59 – grab our logic here and just like reset
00:36:01 – our ball sprite here pretty generous
00:36:04 – yeah we're going to grab this here gonna
00:36:06 – put it back up and will actually go
00:36:08 – ahead and say ball why and we'll go
00:36:11 – ahead and multiply that we want to it's
00:36:13 – moving down so we want to move it back
00:36:14 – up and then we'll say score equals 0 and
00:36:18 – will say label that text equals score 0
00:36:24 – now but should be
00:36:30 – got men why it should be less we'll see
00:36:34 – if that works or not give it a go
00:36:35 – you alright so as we want to reset the
00:36:39 – game least we'll have something that's
00:36:40 – recurring we can obviously add a lot
00:36:42 – more features to this game very simple
00:36:44 – to actually build something out in just
00:36:46 – a few minutes
00:36:53 – we can also see if it my logic here is
00:36:55 – gonna fix and obviously now you can
00:36:57 – adjust all the different gravity's and
00:36:58 – things like that
00:36:59 – there you go up now of course I've
00:37:01 – launched it up because I didn't I didn't
00:37:04 – I guess I modified and garages bland
00:37:06 – there we go boom so we have a few
00:37:08 – different issues in there as well so for
00:37:11 – instance our main issues that we didn't
00:37:14 – reset our ball velocity here so that's
00:37:16 – what kind of occurring at this point so
00:37:19 – we could go ahead and grab our
00:37:20 – velocities here and reset them as well
00:37:25 – I'm just gonna put them at that I think
00:37:32 – it reset it 2-0 that way that way it
00:37:34 – automatically does it based off the time
00:37:36 – so reset our velocities that's why I
00:37:38 – shot up because we have already going
00:37:39 – down
00:37:40 – perfect ok so the simplest of games that
00:37:43 – we could think of to to dominate your
00:37:45 – right its kind of setting it off alright
00:37:47 – so how do we get this on Windows Phone
00:37:49 – you might be asking well my first
00:37:51 – question is where do i go and learn
00:37:53 – about all of this code you're writing is
00:37:55 – a good documentation that typically is
00:37:57 – good documentation on the Salmon site
00:37:58 – and assume that you continue with that
00:38:01 – that's correct so what we're inside
00:38:03 – inside of the cocoa sharp templates here
00:38:07 – there's actually complete walkthrough of
00:38:09 – doing everything so we give you multiple
00:38:12 – things we have the cocoa sharp wiki and
00:38:16 – there's also a resident at all the
00:38:20 – samples we have samples and walk you
00:38:22 – through as well so our samples at coco
00:38:24 – sharp samples
00:38:26 – there's actually about nine games in
00:38:27 – here that you can actually download and
00:38:30 – automatically get started with some air
00:38:31 – hockey angry ninjas common as much a
00:38:34 – different type of games on there as well
00:38:37 – and the one that also on api reference
00:38:40 – though some yeah so we do have an API
00:38:43 – reference as well so we have a full
00:38:45 – walkthrough so this and this one is
00:38:47 – really good this will to walk you
00:38:48 – through adding everything through an
00:38:50 – entire game to build this game one at a
00:38:53 – time it's really nice cool little more
00:38:55 – in this episode we'll take you maybe
00:38:56 – like an hour to go through about the end
00:38:59 – of it you get this entire man
00:39:00 – in a game with parallax and everything
00:39:02 – crazy as well and all these monkeys it's
00:39:05 – really great and when you go to
00:39:07 – developer.samsung.com we're going to
00:39:13 – find some documentation in there so we
00:39:16 – just go ahead and tap on the cross
00:39:18 – platform where is that when you tap on
00:39:24 – cross-platform up here you go down to
00:39:26 – game development you'll see Coco shows
00:39:28 – ok it will be full introduction
00:39:30 – walkthrough contact pipeline handling
00:39:33 – everything that you can think of and api
00:39:35 – reference as well
00:39:36 – cool really big right that's where you
00:39:38 – get going and the whole cocoa sharp get
00:39:42 – how people walk you through all of that
00:39:43 – so so you want to take all this logic
00:39:47 – and I put it on another platform yup
00:39:49 – all you have to do is add another
00:39:50 – project let's add a Windows Phone
00:39:52 – project for instance there's windows
00:39:54 – phone and we'll call this bouncy
00:39:57 – winphone so this will handle all the
00:40:03 – windows phone specific intricacies there
00:40:06 – so all we have to do now at this point
00:40:09 – we can see it added a new app delegate
00:40:11 – and then added new intro layer now we
00:40:13 – don't want we don't you could put those
00:40:15 – in a portable class library couldn't you
00:40:17 – you could absolutely yeah so you could
00:40:19 – you could come in and add a new portable
00:40:21 – class library add cocoa sharpen your
00:40:23 – good to go
00:40:24 – ok you can also do this you could just
00:40:26 – say add a new project and let's just add
00:40:30 – a shared projects project and why not
00:40:33 – right
00:40:34 – you can do either one yes let's add like
00:40:36 – a bouncy dot shared in there
00:40:44 – so now we can do is we can just move we
00:40:47 – know that we want to share a hundred
00:40:48 – percent the app delegate and the intro
00:40:52 – layers we're going to move those into
00:40:54 – our shared we can now delete these out
00:40:57 – of the android project delete these out
00:41:00 – of the windows phone project and then
00:41:04 – simply add those as a shared project to
00:41:07 – who
00:41:07 – so this is great because now all that
00:41:09 – logic so imagine this is a very more
00:41:11 – complex scheme right right not just the
00:41:13 – little ball bouncing in here for
00:41:15 – instance but we can go ahead and add
00:41:16 – this shared project and that there and
00:41:21 – now we're basically almost good because
00:41:23 – the only thing we need to do here is add
00:41:24 – some the content here and Windows Phone
00:41:27 – handle some things automatically for you
00:41:31 – PNG's work really great out-of-the-box
00:41:33 – on iOS and Android but not so much on
00:41:35 – windows phone so this tool that you'll
00:41:37 – find in the documentation called the
00:41:39 – pipeline tool which will take any of
00:41:41 – your resources whether they be mp3 wav
00:41:43 – files PNG JPEGs and it will convert them
00:41:47 – to a cross-platform file format
00:41:50 – automatically for you
00:41:51 – that's what I've done here and this one
00:41:52 – I could added to android originally but
00:41:55 – i'm just gonna drag in these xnb files
00:41:57 – they're called into here i put this on
00:42:01 – Windows Phone let's make sure that
00:42:04 – everything is set to build looks good
00:42:08 – spin up the windows phone emulator here
00:42:13 – oh alright we got to do one other thing
00:42:17 – resolved that namespace of course you
00:42:21 – want to clean it up you probably want to
00:42:22 – call bouncy android per se but that's
00:42:25 – one I think is here is that the phone
00:42:27 – application page so it's just one line
00:42:29 – of code here in the Windows Phone
00:42:30 – project ok to start it up
00:42:45 – recommit add a reference to the android
00:42:49 – project inside the phone project
00:42:51 – yeah so here's what happened there is we
00:42:53 – created these abdelhak although I'm
00:42:55 – behind ya
00:42:58 – namespaces right but you can change
00:43:00 – these namespaces we can see one big
00:43:03 – issue here is that we didn't change it
00:43:04 – to portrait so let's go ahead into our
00:43:06 – game page and change that the portrait
00:43:08 – here so again it's just actually using a
00:43:10 – phone application page so everything if
00:43:12 – you're done Windows Phone developments
00:43:14 – here so we have supported poor trip in
00:43:22 – our orientation was going to try that
00:43:25 – one more time there
00:43:29 – yeah so ideally here you probably start
00:43:31 – with a shared project and these would
00:43:33 – just be named bound to you have shared
00:43:34 – in your namespace that's what happened
00:43:36 – there and when you look at my final
00:43:38 – project that's on my github called
00:43:40 – bouncy game on my getup / Monsta magno
00:43:43 – you'll see the game there as well
00:43:45 – ideally our paddle is somewhere we're
00:43:50 – going to go let's double-check to make
00:43:56 – sure that our properties are set to
00:43:59 – content be helpful everytime there we go
00:44:03 – let's try this one more time so it
00:44:04 – didn't crash which is interesting which
00:44:06 – is good i guess maybe it should of but I
00:44:08 – try to think it should crash it's
00:44:10 – probably good try to load the resources
00:44:12 – but didn't so it's good so now here we
00:44:13 – go
00:44:14 – no it's supposed to storm game right
00:44:17 – sweet and I didn't change any lines of
00:44:19 – comas putting it into portrait
00:44:21 – automatically for me and we can see that
00:44:22 – it's going to move automatically and all
00:44:25 – the game logic there is shared across
00:44:26 – corm yeah yeah not bad now and and i
00:44:31 – want to show you the sample that you can
00:44:32 – walk through as well that's the balance
00:44:34 – again now you can do it on iOS you can
00:44:36 – do it on all the other ones you're going
00:44:38 – to actually walk there when you go
00:44:39 – through this project called gone bananas
00:44:41 – which is really cool as it shows up
00:44:44 – almost all the different features in
00:44:47 – cocoa sharp from particle systems to
00:44:50 – parallax to just about everything
00:44:53 – it's really fun and it shows you how to
00:44:56 – do scene transitions and everything like
00:44:57 – that little bit more comfort
00:44:59 – box but we can see it has a Windows
00:45:01 – Phone Android and iOS and a big shared
00:45:03 – project right there's multiple physics
00:45:05 – brights overlays here's one uses sprite
00:45:08 – sheets as well which we talked about
00:45:10 – which is really cool so let's go ahead
00:45:12 – and take a look at this here we're going
00:45:17 – to tap to go bananas a little banana got
00:45:19 – in here and the whole idea is to catch
00:45:21 – all the bananas before it before you
00:45:23 – actually had a ball
00:45:25 – it's actually really difficult we made
00:45:26 – it extremely difficult here because he
00:45:29 – liked the clouds are moving and
00:45:30 – different particle effects are going on
00:45:32 – as well see if i can get any bananas
00:45:37 – there's multiple game modes as well that
00:45:39 – you can put on this one which is kind of
00:45:40 – cool kind of shows up different features
00:45:42 – but that's not bad that's my high score
00:45:44 – actually yeah that right now music and
00:45:46 – this is of course cross-platform this is
00:45:48 – showing a little bit more i'm on there
00:45:50 – as well and how to load backgrounds more
00:45:51 – than just a little bouncy ball and we
00:45:53 – have a lot more complex games as well
00:45:55 – just so you can get up and running i
00:45:57 – just want to show you the basics of
00:45:58 – let's add some cross-platform sprites on
00:46:01 – there and actions and get going
00:46:04 – excellent home
00:46:07 – yeah that's about it of course you want
00:46:09 – to you know go to github com / mono /
00:46:13 – coco sharp the powerpoint presentation
00:46:16 – eyes started with gonna be a little bit
00:46:17 – more involved will have links in the
00:46:19 – show notes as well with how to get
00:46:20 – started on everything with all the
00:46:22 – references of course that's awesome yeah
00:46:24 – that's a great way to get started with
00:46:27 – gaming yeah that you know it you're not
00:46:29 – gonna you could potentially build a
00:46:31 – really complex game but here's looking
00:46:34 – for the first time ya to get into gaming
00:46:36 – something fun for the kids or for
00:46:38 – yourself you know exactly and it's it's
00:46:40 – it's all node-based it's kind of really
00:46:42 – easy to understand even just in the code
00:46:44 – which is what i really like a non-kosher
00:46:46 – sharp
00:46:47 – yeah and that follows the same paradigm
00:46:48 – it's shared projects for pc L's and you
00:46:51 – know all in one place and then easy way
00:46:55 – to do cross-platform yeah absolutely
00:46:56 – awesome
00:46:57 – yeah alright that's one now alright
00:47:01 – we'll see you next time on visual studio
00:47:03 – toolbox
00:47:11 – [Music]


Video Url:
http://youtu.be/sM9ULQYAmfU

(Visited 282 times, 170 visits today)

Comments

comments