mono / cocos-sharp-samples Goto Github PK
View Code? Open in Web Editor NEWCocosSharp samples
CocosSharp samples
Although collisions are detected throughout the scene, the graphics for the balls remain at their initial position.
I tried some samples but found a common problem. The applications respond slowly to the back / home / lock screen button. For example, in GoneBananasForms, before I press these keys, the banana is at the top of monkey's head. But after switch back to the app, the banana dropped down.
In TheLevel.cs Draw() we need to call Begin/End on the created CCBox2dDraw object and not use CCDrawPrimtives.
Also, the loaded debug spritefont is not part of our content, so we need to choose a different font.
Xamarin Studio 5.2, Mac OS X Mavericks.
From Package Console:
Adding CocosSharp.PCL.Shared.MacOS...
Installing 'CocosSharp.PCL.Shared.MacOS 1.0.0.0'.
Added file 'CocosSharp.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/portable-net40+sl50+win8+wp8+MonoAndroid10+MonoTouch10'.
Added file 'CocosSharp.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/MonoAndroid10'.
Added file 'ICSharpCode.SharpZipLib.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/MonoAndroid10'.
Added file 'Lidgren.Network.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/MonoAndroid10'.
Added file 'MonoGame.Framework.Net.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/MonoAndroid10'.
Added file 'MonoGame.Framework.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/MonoAndroid10'.
Added file 'box2d.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/MonoAndroid10'.
Added file 'CocosSharp.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/MonoTouch10'.
Added file 'ICSharpCode.SharpZipLib.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/MonoTouch10'.
Added file 'Lidgren.Network.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/MonoTouch10'.
Added file 'MonoGame.Framework.Net.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/MonoTouch10'.
Added file 'MonoGame.Framework.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/MonoTouch10'.
Added file 'box2d.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/MonoTouch10'.
Added file 'ChipmunkSharp.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/net40'.
Added file 'CocosSharp.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/net40'.
Added file 'ICSharpCode.SharpZipLib.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/net40'.
Added file 'Lidgren.Network.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/net40'.
Added file 'MonoGame.Framework.Net.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/net40'.
Added file 'MonoGame.Framework.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/net40'.
Added file 'Tao.Sdl.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/net40'.
Added file 'box2d.dll' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0/lib/net40'.
Added file 'CocosSharp.PCL.Shared.MacOS.1.0.0.0.nupkg' to folder 'CocosSharp.PCL.Shared.MacOS.1.0.0.0'.
Successfully installed 'CocosSharp.PCL.Shared.MacOS 1.0.0.0'.
Adding 'CocosSharp.PCL.Shared.MacOS 1.0.0.0' to AngryNinjas.
For adding package 'CocosSharp.PCL.Shared.MacOS 1.0.0.0' to project 'AngryNinjas' that targets 'net40',
>> Assembly references are being added from 'lib/net40'
Added reference 'ChipmunkSharp' to project 'AngryNinjas'.
Added reference 'CocosSharp' to project 'AngryNinjas'.
Added reference 'ICSharpCode.SharpZipLib' to project 'AngryNinjas'.
Added reference 'Lidgren.Network' to project 'AngryNinjas'.
Added reference 'MonoGame.Framework.Net' to project 'AngryNinjas'.
Added reference 'MonoGame.Framework' to project 'AngryNinjas'.
Added reference 'Tao.Sdl' to project 'AngryNinjas'.
Added reference 'box2d' to project 'AngryNinjas'.
Added file 'packages.config'.
An exception was thrown while dispatching a method call in the UI thread.
Every project gives different error and reasons for not compiling. Samples need to be updated to support latest Xamarin platform.
Hello, when i try to run Gone Bananas on cocossharp 1.7, i am getting the exception alcMacOSXMixerOutputRate on line 13 of AppDelegate.cs file.
This part of code:
var application = new CCApplication ();
Someone can help with this?
Thank you!
The following compile time exception occurs when trying to compile the SkyDefenceWin8 solution.
Error 1 Source file '........\CSExtensions\Helpers\src\CCMathExHelper.cs' could not be found C:\Users\Chris\Desktop\cocos-sharp-samples-master\SkyDefense\src\win8\CSC SkyDefense.Store
Seems GoneBananas from revision 9e53c7c assumes CCApplication has methods ResumeGame() and PauseGame().
Building: GoneBananasShared (Debug|iPhoneSimulator)
Building: GoneBananasiOS (Debug|iPhoneSimulator)
Performing main compilation...
/Library/Frameworks/Mono.framework/Versions/3.6.0/bin/mcs /noconfig "/r:/Developer/MonoTouch/usr/lib/mono/2.1/mscorlib.dll" -nostdlib "/out:/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasiOS/bin/iPhoneSimulator/Debug/GoneBananasiOS.exe" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" "/r:/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasiOS/../packages/CocosSharp.iOS.1.0.0.0/lib/MonoTouch10/CocosSharp.dll" "/r:/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasiOS/../packages/CocosSharp.iOS.1.0.0.0/lib/MonoTouch10/ICSharpCode.SharpZipLib.dll" "/r:/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasiOS/../packages/CocosSharp.iOS.1.0.0.0/lib/MonoTouch10/Lidgren.Network.dll" "/r:/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasiOS/../packages/CocosSharp.iOS.1.0.0.0/lib/MonoTouch10/MonoGame.Framework.Net.dll" "/r:/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasiOS/../packages/CocosSharp.iOS.1.0.0.0/lib/MonoTouch10/MonoGame.Framework.dll" "/r:/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasiOS/../packages/CocosSharp.iOS.1.0.0.0/lib/MonoTouch10/box2d.dll" "/r:/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" /nologo /warn:4 /debug:full /optimize- /codepage:utf8 "/define:DEBUG" "/define:IOS" "/define:__MOBILE__" "/define:__IOS__" /t:exe "/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasiOS/Main.cs" "/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasiOS/AppDelegate.cs" "/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasShared/GameLayer.cs" "/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasShared/GameStartLayer.cs" "/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasShared/GameOverLayer.cs" "/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasShared/GoneBananasApplicationDelegate.cs" "/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasShared/CCPhysicsSprite.cs"
Compilation failed: 2 error(s), 0 warnings
/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasShared/GoneBananasApplicationDelegate.cs(27,25): error CS1061: Type `CocosSharp.CCApplication' does not contain a definition for `PauseGame' and no extension method `PauseGame' of type `CocosSharp.CCApplication' could be found. Are you missing an assembly reference?
/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasiOS/../packages/CocosSharp.iOS.1.0.0.0/lib/MonoTouch10/CocosSharp.dll (Location of the symbol related to previous error)
/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasShared/GoneBananasApplicationDelegate.cs(35,25): error CS1061: Type `CocosSharp.CCApplication' does not contain a definition for `ResumeGame' and no extension method `ResumeGame' of type `CocosSharp.CCApplication' could be found. Are you missing an assembly reference?
/Users/kamstrup/Xamarin/cocos-sharp-samples/GoneBananas/GoneBananasiOS/../packages/CocosSharp.iOS.1.0.0.0/lib/MonoTouch10/CocosSharp.dll (Location of the symbol related to previous error)
Build complete -- 2 errors, 0 warnings
---------------------- Done ----------------------
Build: 2 errors, 0 warnings
EndGame gets called every frame even when the game is transitioning to GameOverScene. This causes the game to crash on iPhone4s after 3 play throughs. It will probably crash on other devices too.
Code in GameLayer.cs:
void CheckCollision () // function is executed even after first EndGame() is called
{
//...
int ballHitCount = ballsBatch.Children.Count (ball => ball.BoundingBoxTransformedToParent.IntersectsRect (monkey.BoundingBoxTransformedToParent));
if (ballHitCount > 0 ) {
EndGame (); //This gets executed multiple times
}
}
It seems this sample is looking for an unreleased version of the library. Any ETA when it will be released?
When the sample game is tested on the iPhone 5s simulator it operates fine with the exception that the balls that are suppose to hit the monkey to end the game don't fall down at all and instead the ball's behavior is as such that it appears one by one, sometimes overlapping at random positions in a horizontal line at the very top of the iPhone simulator screen and just collectively stay in that linear position until a maximum of 10 balls appear at which point no more balls are created.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.