From 5cfa948e9f32fb68e886af207fefb6e846f916bc Mon Sep 17 00:00:00 2001 From: olegoid Date: Mon, 19 Jan 2015 23:37:33 +0300 Subject: [PATCH] [cocos2d.PhysicsSystem] Migrate sample to unified --- .../PhysicsSystem/AppDelegate.cs | 4 +-- .../PhysicsSystem/Chipmunk#.csproj | 12 ++++++--- .../PhysicsSystem/DeviceExtensions.cs | 2 +- .../PhysicsSystem/PhysicsSystem/Info.plist | 2 +- .../PhysicsSystem/MachineLayer.cs | 25 ++++++++++--------- .../PhysicsSystem/PhysicsSystem/Main.cs | 4 +-- 6 files changed, 28 insertions(+), 21 deletions(-) diff --git a/cocos2d/samples/PhysicsSystem/PhysicsSystem/AppDelegate.cs b/cocos2d/samples/PhysicsSystem/PhysicsSystem/AppDelegate.cs index 54e96aea..a2331c89 100644 --- a/cocos2d/samples/PhysicsSystem/PhysicsSystem/AppDelegate.cs +++ b/cocos2d/samples/PhysicsSystem/PhysicsSystem/AppDelegate.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Linq; -using MonoTouch.Foundation; -using MonoTouch.UIKit; +using Foundation; +using UIKit; using MonoTouch.Cocos2D; diff --git a/cocos2d/samples/PhysicsSystem/PhysicsSystem/Chipmunk#.csproj b/cocos2d/samples/PhysicsSystem/PhysicsSystem/Chipmunk#.csproj index 1bece083..407e6ba0 100644 --- a/cocos2d/samples/PhysicsSystem/PhysicsSystem/Chipmunk#.csproj +++ b/cocos2d/samples/PhysicsSystem/PhysicsSystem/Chipmunk#.csproj @@ -6,11 +6,13 @@ 10.0.0 2.0 {3459A5CA-A1A2-4F80-87B7-2EBD1196C522} - {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} Exe PhysicsSystem Resources PhysicsSystem + Xamarin.iOS + v1.0 True @@ -44,6 +46,7 @@ False True iPhone Developer + ARMv7 none @@ -53,6 +56,7 @@ 4 False iPhone Developer + ARMv7, ARM64 none @@ -64,6 +68,7 @@ False Automatic:AdHoc iPhone Distribution + ARMv7, ARM64 none @@ -74,15 +79,16 @@ False iPhone Distribution Automatic:AppStore + ARMv7, ARM64 - ..\..\..\binding\Cocos2D.dll + @@ -96,7 +102,6 @@ - @@ -115,4 +120,5 @@ + \ No newline at end of file diff --git a/cocos2d/samples/PhysicsSystem/PhysicsSystem/DeviceExtensions.cs b/cocos2d/samples/PhysicsSystem/PhysicsSystem/DeviceExtensions.cs index 6c903950..163d9d5b 100644 --- a/cocos2d/samples/PhysicsSystem/PhysicsSystem/DeviceExtensions.cs +++ b/cocos2d/samples/PhysicsSystem/PhysicsSystem/DeviceExtensions.cs @@ -1,6 +1,6 @@ using System; -using MonoTouch.UIKit; +using UIKit; namespace PhysicsSystem { diff --git a/cocos2d/samples/PhysicsSystem/PhysicsSystem/Info.plist b/cocos2d/samples/PhysicsSystem/PhysicsSystem/Info.plist index a7c11ef7..116833d3 100644 --- a/cocos2d/samples/PhysicsSystem/PhysicsSystem/Info.plist +++ b/cocos2d/samples/PhysicsSystem/PhysicsSystem/Info.plist @@ -8,7 +8,7 @@ 2 MinimumOSVersion - 5.0 + 5.1.1 UISupportedInterfaceOrientations UIInterfaceOrientationLandscapeLeft diff --git a/cocos2d/samples/PhysicsSystem/PhysicsSystem/MachineLayer.cs b/cocos2d/samples/PhysicsSystem/PhysicsSystem/MachineLayer.cs index 40d6ed3f..e7e83953 100644 --- a/cocos2d/samples/PhysicsSystem/PhysicsSystem/MachineLayer.cs +++ b/cocos2d/samples/PhysicsSystem/PhysicsSystem/MachineLayer.cs @@ -1,9 +1,10 @@ using System; -using System.Drawing; +using CoreGraphics; using MonoTouch.Cocos2D; -using MonoTouch.UIKit; +using UIKit; using Chipmunk; +using System.Drawing; namespace PhysicsSystem { @@ -27,19 +28,19 @@ public MachineLayer () }; Add ( new CCSprite ("bg.jpg") { - Position = UIDevice.CurrentDevice.IsIPad() ? new PointF(512, 384) : new PointF(240, 160), + Position = UIDevice.CurrentDevice.IsIPad() ? new CGPoint(512, 384) : new CGPoint(240, 160), }); //motorblock, no body, no shape var motorblock = new CCSprite ("motor_block.png") { - Position = UIDevice.CurrentDevice.IsIPad() ? new PointF (160, 460) : new PointF (80, 230), + Position = UIDevice.CurrentDevice.IsIPad() ? new CGPoint (160, 460) : new CGPoint (80, 230), }; Add (motorblock); //motorwheel var motorwheel = new CCPhysicsSprite ("motor_wheel.png") { Body = new Body (1, Helper.MomentForCircle (1, 20, 20, PointF.Empty)), - Position = UIDevice.CurrentDevice.IsIPad() ? new PointF (160, 460) : new PointF (80, 230), + Position = UIDevice.CurrentDevice.IsIPad() ? new CGPoint (160, 460) : new CGPoint (80, 230), }; Add (motorwheel); @@ -51,7 +52,7 @@ public MachineLayer () //wheel var wheel = new CCPhysicsSprite ("wheel.png") { Body = new Body (25, Helper.MomentForCircle (25, 140, 140, PointF.Empty)), - Position = UIDevice.CurrentDevice.IsIPad() ? new PointF (160, 300) : new PointF (80, 150), + Position = UIDevice.CurrentDevice.IsIPad() ? new CGPoint (160, 300) : new CGPoint (80, 150), }; space.Add (wheel.Body); space.Add (new CircleShape (wheel.Body, UIDevice.CurrentDevice.IsIPad() ? 140 : 70, PointF.Empty){Group = 1}); @@ -61,7 +62,7 @@ public MachineLayer () //cylinder. no physics body. only a shape Add (new CCSprite ("cylinder.png") { - Position = UIDevice.CurrentDevice.IsIPad() ? new PointF (570, 300) : new PointF (285, 150), + Position = UIDevice.CurrentDevice.IsIPad() ? new CGPoint (570, 300) : new CGPoint (285, 150), }); //space.Add (new PolygonShape (space.StaticBody, new [] { @@ -81,7 +82,7 @@ public MachineLayer () //piston var piston = new CCPhysicsSprite ("piston.png") { Body = new Body (8, float.PositiveInfinity), //never rotates - Position = UIDevice.CurrentDevice.IsIPad() ? new PointF (370, 300) : new PointF (185, 150), + Position = UIDevice.CurrentDevice.IsIPad() ? new CGPoint (370, 300) : new CGPoint (185, 150), }; space.Add (piston.Body); space.Add (new PolygonShape (piston.Body, UIDevice.CurrentDevice.IsIPad() ? 100 : 50, UIDevice.CurrentDevice.IsIPad() ? 200 : 50) {Group = 1}); @@ -95,7 +96,7 @@ public MachineLayer () new PointF (160, 20), new PointF (160, -20), }, PointF.Empty)), - Position = UIDevice.CurrentDevice.IsIPad() ? new PointF (190, 300) : new PointF (95, 150) + Position = UIDevice.CurrentDevice.IsIPad() ? new CGPoint (190, 300) : new CGPoint (95, 150) }; space.Add (conrod.Body); space.Add (new PolygonShape (conrod.Body, UIDevice.CurrentDevice.IsIPad() ? 320 : 160, UIDevice.CurrentDevice.IsIPad() ? 40 : 20) {Group = 1}); @@ -105,9 +106,9 @@ public MachineLayer () space.Add ((Constraint)new PivotJoint (conrod.Body, piston.Body, UIDevice.CurrentDevice.IsIPad() ? new PointF (340, 300) : new PointF (170, 150))); space.Add ((Constraint)new GrooveJoint (space.StaticBody, piston.Body, - UIDevice.CurrentDevice.IsIPad() ? new PointF (0, 300) : new PointF (0, 150), - UIDevice.CurrentDevice.IsIPad() ? new PointF (1024, 300) : new PointF (480, 150), - UIDevice.CurrentDevice.IsIPad() ? new PointF (0, 0): new PointF (0, 0))); + UIDevice.CurrentDevice.IsIPad() ? new PointF (0, 300) : new PointF (0, 150), + UIDevice.CurrentDevice.IsIPad() ? new PointF (1024, 300) : new PointF (480, 150), + UIDevice.CurrentDevice.IsIPad() ? new PointF (0, 0): new PointF (0, 0))); } diff --git a/cocos2d/samples/PhysicsSystem/PhysicsSystem/Main.cs b/cocos2d/samples/PhysicsSystem/PhysicsSystem/Main.cs index 0d378693..e755c798 100644 --- a/cocos2d/samples/PhysicsSystem/PhysicsSystem/Main.cs +++ b/cocos2d/samples/PhysicsSystem/PhysicsSystem/Main.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Linq; -using MonoTouch.Foundation; -using MonoTouch.UIKit; +using Foundation; +using UIKit; namespace PhysicsSystem {