CocosSharp is a C# implementation of the Cocos2D and Cocos3D APIs that runs on any platform where MonoGame runs.
Перейти к файлу
Kenneth Pouncey 38ad5891e9 Fix windows 8 build process. 2014-08-29 17:02:55 +02:00
Extensions - fixed copy / paste error which prevents drawing of top part of scale9 sprite 2014-08-26 14:06:12 +02:00
MonoGame@0a55594b75 Update to current MonoGame 2014-05-26 12:05:38 +02:00
PCL Regen CocosSharpAPI for Nuget PCL Packages 2014-08-29 16:59:13 +02:00
ProjectTemplates Update WP8 to nupkg version 1.0.1.0 2014-08-29 13:57:34 +02:00
Samples Moved Spine same to Samples https://github.com/xamarin/cocos-sharp-samples 2014-07-20 12:02:39 +02:00
TestWin8Phone Fixes for WP8 tests to be able to compile and run. 2014-08-04 11:00:10 +02:00
box2d Fix solutions with invalid build profile 2014-08-21 07:31:09 +02:00
cocos2d.Content.Pipeline.Importers Fix accessibility in Pipeline Content importers. 2014-04-06 11:41:39 +02:00
docs Update CCNode documentation 2014-08-20 17:09:54 +02:00
scripts Renaming of Cocos2D-XNA and Cocos2DXNA to CocosSharp 2014-03-18 21:54:09 -04:00
src Fix compile error for Window 8. 2014-08-28 15:32:08 +02:00
testWin8Store Add Defaults for Windows Store apps. This was suggested by Jose. 2014-08-24 14:54:30 +02:00
tests Merge branch 'master' of https://github.com/mono/CocosSharp 2014-08-27 16:27:49 +02:00
tools Add PCL project build to Mac build. Add current 2.8 version of NuGet.exe to tools directory so it does not need to be downloaded and we can keep it up to date. 2014-04-11 11:20:16 +02:00
.gitattributes initial commit 2012-10-26 16:54:50 -07:00
.gitignore updated the nuspec to better describe each package. 2013-06-08 23:12:50 -07:00
.gitmodules Add submodule ChipmunkSharp 2014-08-09 12:11:51 +02:00
CocosSharp.Android.sln Fix regressions in CocosSharp Android and Ouya projects after update to MonoGame. 2014-05-26 18:05:30 +02:00
CocosSharp.MacOS.sln Make sure we only reference CS objects and wrap others for the PCL interface. 2014-08-10 18:17:54 +02:00
CocosSharp.Ouya.sln Fix regressions in CocosSharp Android and Ouya projects after update to MonoGame. 2014-05-26 18:05:30 +02:00
CocosSharp.Windows.sln Fix regression compile errors due to MonoGame update. 2014-05-26 16:07:14 +02:00
CocosSharp.Windows8.sln Fix windows 8 build process. 2014-08-29 17:02:55 +02:00
CocosSharp.WindowsDX.sln Fix conditional compilation of ChipmunkSharp and conditional include as reference 2014-08-09 12:48:34 +02:00
CocosSharp.WindowsGL.sln Fix regressions in build after update to MonoGame. 2014-05-26 19:12:17 +02:00
CocosSharp.WindowsPhone.sln Make WP8 compile again due to regressions in the API 2014-07-30 12:16:12 +02:00
CocosSharp.iOS.sln Fix regressions in CocosSharp iOS projects after update to MonoGame. 2014-05-26 13:54:49 +02:00
CocosSharp.sln Rename CocosSharp/cocos2d to CocosSharp/src in solutions and projects. 2014-03-31 14:24:55 +02:00
Contributing.md Update 2014-01-21 22:01:22 -05:00
LicenseAndCredit.txt Update 2014-01-21 22:01:22 -05:00
MonoGame.build Fix windows 8 build process. 2014-08-29 17:02:55 +02:00
README.md Forums 2014-08-11 22:33:43 -04:00
build.bat adjustments to make the build run in 32 bit. 2013-07-01 22:53:58 -07:00
default.build Fix windows 8 build process. 2014-08-29 17:02:55 +02:00

README.md

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.

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 git@github.com: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 <submodule>   
git pull origin <branch>   
cd <top-level>; git add <submodule>   
git commit

To make changes in a submodule

cd <submodule>

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

git checkout <branch>

work as normal, the submodule is a normal repo

git commit/push new changes to the repo (submodule)
cd <top-level>; git add <submodule> # 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 -- <path of the submodule> # 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 <desired new hash> # 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 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.

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

CocosSharp.Tests.Android.sln	
CocosSharp.Tests.Ouya.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

Statistics

There is a special case for Xamarin iOS MonoTouch running on the simulator where they aggresively 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.