Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/mono/CocosSharp

CocosSharp is a C# implementation of the Cocos2D and Cocos3D APIs that runs on any platform where MonoGame runs.
https://github.com/mono/CocosSharp

Last synced: about 1 month ago
JSON representation

CocosSharp is a C# implementation of the Cocos2D and Cocos3D APIs that runs on any platform where MonoGame runs.

Lists

README

        

# CocosSharp

CocosSharp is an easy to use library for simple games using C# and F#.
It is a .NET port of the popular Cocos2D engine, derived from the
Cocos2D-X engine via Cocos2D-XNA.

This library is MIT licensed.

[![coverity][coverity-badge]][coverity-project]

[coverity-project]: https://scan.coverity.com/projects/6245
[coverity-badge]: https://scan.coverity.com/projects/6245/badge.svg

Website
-------

We have a dedicated website at [http://mono.github.io/CocosSharp](http://mono.github.io/CocosSharp). In particular,
check out the [contribute](http://mono.github.io/CocosSharp/contribute) section for how to be part of the CococsSharp community.

Forums
------

Xamarin is hosting forums for CocosSharp here:

http://forums.xamarin.com/categories/cocossharp

Learn More
----------

To learn more, see the https://github.com/mono/CocosSharp/wiki

License
-------

This project is open source, freely available, and free of royalties
or encumberance. The software is released under the highly permissive
MIT License.

Git
---

When you first check out, run

`git clone --recursive [email protected]:xamarin/CocosSharp`

so you will have all the submodules checked out for you.

With existing checkouts, run

`git submodule update --init --recursive`

to make sure you get the latest changes in the submodules. Repos that
were checked out recursively will do this automatically, but it
doesn't hurt to run this manually.

To pull external changes into a submodule

```
cd
git pull origin
cd ; git add
git commit
```

To make changes in a submodule

`cd `

* By default, submodules are detached because they point to a specific commit. Use git-checkout to put yourself back on a branch.

`git checkout `

work as normal, the submodule is a normal repo

```
git commit/push new changes to the repo (submodule)
cd ; git add # this will record the new commits to CocosSharp MonoGame submodule
git commit
```

* To switch the repo of a submodule

edit '.gitmodules' to point to the new location

`git submodule sync -- # updates .git/config`

* I think this will checkout from the new location, internally. It may take a while for big repos.

```
git submodule update --recursive
git checkout # This changes the pointer of the submodule
```

The desired output diff is a change in .gitmodule to reflect the
change in the remote URL, and a change in / where you see
the desired change in the commit hash

You now have everything you need to start start developing with
CocosSharp

Getting Started
---------------
### Solutions & Projects - MonoGame

After clone you will need to generate the MonoGame projects.

The solution and project files are generated by [Protobuild](https://github.com/hach-que/Protobuild) when you double-click `Protobuild.exe` on Windows from or run `mono Protobuild.exe` under Mac OS or Linux.
**Note: that the previous needs to be done in the MonoGame directory.**

To modify the projects you must edit the .definition file in the `Build/Projects/` folder and re-execute Protobuild.

For more information and advanced usage, please refer to the [Protobuild wiki](https://github.com/hach-que/Protobuild/wiki).

### Test Bed

We have created solutions for all the supported platforms that serves
as our TestBed for each platform.

You can find those in the [tests directory](https://github.com/xamarin/CocosSharp/tree/master/tests "Test Bed")

CocosSharp.Tests.Android.sln
CocosSharp.Tests.Windows.sln
CocosSharp.Tests.Windows8.sln
CocosSharp.Tests.WindowsDX.sln
CocosSharp.Tests.WindowsGL.sln
CocosSharp.Tests.WindowsPhone.sln
CocosSharp.Tests.WindowsPhone7.sln
CocosSharp.Tests.iOS.sln
CocosSharp.Tests.MacOS.sln

### Samples

As the saying goes "A picture is worth a thousand words" well sample code can be just as effective.

So to get started we have placed a number of samples here: [Samples](https://github.com/xamarin/cocos-sharp-samples)

### Statistics

There is a special case for Xamarin iOS MonoTouch running on the simulator where they aggressively call garbage collection themselves. This should not affect the devices though. On the Simulator the GC label will always be 0 (zero)

History
-------

This project is a fork of the Cocos2D-XNA project, which is a port of
the C++-based Cocos2D-X API, which in turn is a cross-platform port of
the cocos2d-iphone project.

The focus of this fork is to create a library that is idiomatically
correct for C# and remove many of the historical warts inherited from
the straight ports from C++ and Objective-C.