Developing Cross-platform 2D Games in C# and CocosSharp

Sign in to queue

Description

This is the third of another four part series on building cross-platform apps using Xamarin and C#. In this episode Robert is joined by James Montemagno, a developer evangelist at Xamarin. James takes us for a tour of CocosSharp, a Xamarin library for building 2D Windows, iOS and Android games from a shared C# code base. CocosSharp blends the power of the Cocos2D programming model with C# and the .NET Framework. James walks us through getting started with the Visual Studio templates and creating your first game.

Resources:

Embed

Download

The Discussion

  • User profile image
    Exim

    Or you could develop in C++ and Cocos2D-x and not pay for Xamarin ridiculous license...

  • User profile image
    rogreen

    @Exim: I want to write a game and I am a C# developer. I don't know C++. What are my options?

    1. Learn C++
    2. Hire a C++ dev to write my game
    3. Not write the game
    4. License Xamarin and get the game written

    You have to look at the cost of Xamarin in the context of all of your options and then decide if it makes sense.

    Robert

  • User profile image
    ASP

    @rogreen

    you could use Unity game engine and code in C#. you can create 2D and 3D games its really powerful.

    Xamarin is crazily expensive for a indie developer I would rather learn c++ and use cocos2dx

  • User profile image
    geeyef

    @rogreen: I was under the impression that CocosSharp is open source, and thus free. Clearly I missed something, or is there a free version and an enhanced version?

  • User profile image
    James​Montemagno

    @geeyef: @ASP: @Exim:

    Using CococsSharp builds on top of MonoGame, Cocos2dx, Cocos2dx-xna, etc, CocosSharp blends the power of the Cocos2D programming model with C# and the .NET Framework. It is easily distributed via NuGet so it can be easily updated and has great templates to get started in VS or XS. Be sure to read about the improvements and https://github.com/mono/CocosSharp/wiki/Key-Differences">differences here.

    CocosSharp is open source at: https://github.com/mono/CocosSharp and is under MIT license. You can https://github.com/mono/CocosSharp/blob/master/LicenseAndCredit.txt">read the license here.

    You can use and develop with CocosSharp for the Windows platforms and deploy with your Developer Account from Microsoft. When you want to deploy your game to iOS, Android, or Mac you would need an active subscription to Xamarin to build up that package to deploy to the stores. Xamarin Indie Subscription would work perfect with CocosSharp or any other mobile development in C#, which is $25 per month per platform for iOS and Android.

    If you are a student you are eligible for a complimentary Xamarin subscription as well: http://xamarin.com/student

    I am sorry if I didn't clarify this in the video. Let me know if you have any more questions and feel free to discuss in the CocosSharp GitHub page.

  • User profile image
    Russ

    @rogreen: Yeah, I think using Xamarin with Visual Studio requires Business/Pro. (Seems kind of messed up to me, but whatever)

    If you apply for an indie license (you just send them a picture of your ID / class list), you can create Xamarin.Android/Xamarin.iOS projects in Xamarin Studio to deploy to mobile (not sure about Windows Phone, I think thats Visual Studio only). Deploying to Win/Mac is free however, I think.

  • User profile image
    James​Montemagno

    @Russ: Student offer now includes Visual Studio: http://blog.xamarin.com/xamarin-for-students-expands-to-visual-studio/

    Also, the same projects and solutions open in both Visual Studio and Xamarin Studio, so you can go back and forth easily. Windows development is only on Windows in VS.

  • User profile image
    22296662
    How to join developer tools
  • User profile image
    Mike Valeriano

    Something really needs to be said about Robert's answer up there.

    "4. License Xamarin and get the game written"

    If I want Visual Studio support I need to use the Business License, currently priced at $83/month, paid yearly: $999. It would make sense, if the price tag wasn't - as brilliantly put by the fellow coder up there - ridiculous.

    I guess what I'm trying to say/ask is:

    ARE YOU FOR REAL? Being casual about dishing $1000 is not cool, man. But yeah, I suppose we - under funded developers from developing (irony much?) countries - gotta stick to MonoGame (not bad, really, but not great either) or face C++. Or sacrifice goats and chickens in order to to please the Android gods.

    Eh. Maybe I'm just bitter.

    All in all, CocosSharp looks great. Definitely better than MonoGame. But the price is definitely prohibitive. And the Indie license is a joke (lol MonoDevelop).

  • User profile image
    rogreen

    @Mike Valeriano: This is a business decision. There are costs and there are benefits. I am not being casual, just simply laying out the choices. It then becomes a math problem. For each of the choices, do the benefits outweigh the costs?

  • User profile image
    Mike Bluestein

    @Mike Valeriano

    I don't agree with you that the Indie license is a "joke." Many of Xamarin's customers use it effectively, including myself. Xamarin Studio has had a great deal of work put into it since the days when it was branded as MonoDevelop. In my opinion, it's a very nice IDE, that is comparable in both quality and features to any other IDE on the market.

    The licensing story is also the same for CocosSharp as it is for MonoGame, upon which it is built, so that isn't a factor in choosing to use one vs. the other.

    As far as Visual Studio and CocosSharp goes, there's nothing stopping you from using VS to do all your game development against Windows targets such as Windows, Windows Phone and Windows Store. You could then use Xamarin Studio with an Indie license simply to build and deploy to iOS and/or Android (there are a couple things you need to do to bootstrap the game in platform specific code but those are minimal).

Add Your 2 Cents