Added Gone Bananas sample
|
@ -0,0 +1,48 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||||
|
# Visual Studio 2010
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GoneBananasiOS", "GoneBananasiOS\GoneBananasiOS.csproj", "{0F682923-EE76-4240-BBEB-56BF44B82A57}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GoneBananasAndroid", "GoneBananasAndroid\GoneBananasAndroid.csproj", "{7B89D990-03EA-4FF4-8392-376C08E37161}"
|
||||||
|
EndProject
|
||||||
|
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "GoneBananasShared", "GoneBananasShared\GoneBananasShared.shproj", "{7187ABEC-F6E0-4CF4-8E8C-481DBE6DA18B}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|iPhoneSimulator = Debug|iPhoneSimulator
|
||||||
|
Release|iPhoneSimulator = Release|iPhoneSimulator
|
||||||
|
Debug|iPhone = Debug|iPhone
|
||||||
|
Release|iPhone = Release|iPhone
|
||||||
|
Ad-Hoc|iPhone = Ad-Hoc|iPhone
|
||||||
|
AppStore|iPhone = AppStore|iPhone
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{0F682923-EE76-4240-BBEB-56BF44B82A57}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
|
||||||
|
{0F682923-EE76-4240-BBEB-56BF44B82A57}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
|
||||||
|
{0F682923-EE76-4240-BBEB-56BF44B82A57}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
|
||||||
|
{0F682923-EE76-4240-BBEB-56BF44B82A57}.AppStore|iPhone.Build.0 = AppStore|iPhone
|
||||||
|
{0F682923-EE76-4240-BBEB-56BF44B82A57}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||||
|
{0F682923-EE76-4240-BBEB-56BF44B82A57}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||||
|
{0F682923-EE76-4240-BBEB-56BF44B82A57}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||||
|
{0F682923-EE76-4240-BBEB-56BF44B82A57}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||||
|
{0F682923-EE76-4240-BBEB-56BF44B82A57}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||||
|
{0F682923-EE76-4240-BBEB-56BF44B82A57}.Release|iPhone.Build.0 = Release|iPhone
|
||||||
|
{0F682923-EE76-4240-BBEB-56BF44B82A57}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||||
|
{0F682923-EE76-4240-BBEB-56BF44B82A57}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||||
|
{7B89D990-03EA-4FF4-8392-376C08E37161}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU
|
||||||
|
{7B89D990-03EA-4FF4-8392-376C08E37161}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU
|
||||||
|
{7B89D990-03EA-4FF4-8392-376C08E37161}.AppStore|iPhone.ActiveCfg = Release|Any CPU
|
||||||
|
{7B89D990-03EA-4FF4-8392-376C08E37161}.AppStore|iPhone.Build.0 = Release|Any CPU
|
||||||
|
{7B89D990-03EA-4FF4-8392-376C08E37161}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
||||||
|
{7B89D990-03EA-4FF4-8392-376C08E37161}.Debug|iPhone.Build.0 = Debug|Any CPU
|
||||||
|
{7B89D990-03EA-4FF4-8392-376C08E37161}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
||||||
|
{7B89D990-03EA-4FF4-8392-376C08E37161}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
||||||
|
{7B89D990-03EA-4FF4-8392-376C08E37161}.Release|iPhone.ActiveCfg = Release|Any CPU
|
||||||
|
{7B89D990-03EA-4FF4-8392-376C08E37161}.Release|iPhone.Build.0 = Release|Any CPU
|
||||||
|
{7B89D990-03EA-4FF4-8392-376C08E37161}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
||||||
|
{7B89D990-03EA-4FF4-8392-376C08E37161}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(MonoDevelopProperties) = preSolution
|
||||||
|
StartupItem = GoneBananasiOS\GoneBananasiOS.csproj
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
|
@ -0,0 +1,19 @@
|
||||||
|
Any raw assets you want to be deployed with your application can be placed in
|
||||||
|
this directory (and child directories) and given a Build Action of "AndroidAsset".
|
||||||
|
|
||||||
|
These files will be deployed with your package and will be accessible using Android's
|
||||||
|
AssetManager, like this:
|
||||||
|
|
||||||
|
public class ReadAsset : Activity
|
||||||
|
{
|
||||||
|
protected override void OnCreate (Bundle bundle)
|
||||||
|
{
|
||||||
|
base.OnCreate (bundle);
|
||||||
|
|
||||||
|
InputStream input = Assets.Open ("my_asset.txt");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Additionally, some Android functions will automatically load asset files:
|
||||||
|
|
||||||
|
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
|
|
@ -0,0 +1,139 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>frames</key>
|
||||||
|
<dict>
|
||||||
|
<key>Banana-hd.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{2,2},{44,108}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{44,108}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{44,108}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-1.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{48,2},{391,555}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{391,555}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{391,555}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-2.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{441,2},{390,553}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{390,553}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{390,553}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-3.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{833,2},{387,566}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{387,566}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{387,566}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-4.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{1222,2},{386,579}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{386,579}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{386,579}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-5.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{1610,2},{387,573}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{387,573}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{387,573}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-6.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{2,583},{389,560}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{389,560}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{389,560}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-7.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{393,583},{390,553}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{390,553}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{390,553}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-8.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{785,583},{389,557}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{389,557}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{389,557}</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>metadata</key>
|
||||||
|
<dict>
|
||||||
|
<key>format</key>
|
||||||
|
<integer>2</integer>
|
||||||
|
<key>realTextureFileName</key>
|
||||||
|
<string>monkey.png</string>
|
||||||
|
<key>size</key>
|
||||||
|
<string>{2048,2048}</string>
|
||||||
|
<key>smartupdate</key>
|
||||||
|
<string>$TexturePacker:SmartUpdate:c63ac17999f746ee253cb9e63215058f:7b9d55d9c4db1e73987b80a4545fa776:c408e1678cc8476d89ba18c5256b3484$</string>
|
||||||
|
<key>textureFileName</key>
|
||||||
|
<string>monkey.png</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
После Ширина: | Высота: | Размер: 764 KiB |
После Ширина: | Высота: | Размер: 5.2 KiB |
После Ширина: | Высота: | Размер: 6.9 KiB |
После Ширина: | Высота: | Размер: 1.8 MiB |
|
@ -0,0 +1,81 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<ProductVersion>8.0.30703</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{7B89D990-03EA-4FF4-8392-376C08E37161}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<RootNamespace>GoneBananasAndroid</RootNamespace>
|
||||||
|
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
||||||
|
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
||||||
|
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||||
|
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||||
|
<AndroidApplication>True</AndroidApplication>
|
||||||
|
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
|
||||||
|
<AssemblyName>GoneBananasAndroid</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.0.3</TargetFrameworkVersion>
|
||||||
|
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;ANDROID;</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<AndroidLinkMode>None</AndroidLinkMode>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release</OutputPath>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="Mono.Android" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="MainActivity.cs" />
|
||||||
|
<Compile Include="Resources\Resource.designer.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Resources\AboutResources.txt" />
|
||||||
|
<None Include="Assets\AboutAssets.txt" />
|
||||||
|
<None Include="Properties\AndroidManifest.xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AndroidResource Include="Resources\layout\Main.axml" />
|
||||||
|
<AndroidResource Include="Resources\values\Strings.xml" />
|
||||||
|
<AndroidResource Include="Resources\drawable\ic_launcher.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="..\GoneBananasShared\GoneBananasShared.projitems" Label="Shared" Condition="Exists('..\GoneBananasShared\GoneBananasShared.projitems')" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Assets\Content\" />
|
||||||
|
<Folder Include="Assets\Content\fonts\" />
|
||||||
|
<Folder Include="Assets\Content\hd\" />
|
||||||
|
<Folder Include="Assets\Content\Sounds\" />
|
||||||
|
<Folder Include="Assets\Content\hd\animations\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AndroidAsset Include="Assets\Content\hd\animations\monkey.plist" />
|
||||||
|
<AndroidAsset Include="Assets\Content\hd\animations\monkey.png" />
|
||||||
|
<AndroidAsset Include="Assets\Content\Sounds\tap.mp3" />
|
||||||
|
<AndroidAsset Include="Assets\Content\fonts\arial-22.xnb" />
|
||||||
|
<AndroidAsset Include="Assets\Content\hd\cloud.png" />
|
||||||
|
<AndroidAsset Include="Assets\Content\hd\grass.png" />
|
||||||
|
<AndroidAsset Include="Assets\Content\hd\balls.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
|
@ -0,0 +1,38 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
using Android.App;
|
||||||
|
using Android.Content;
|
||||||
|
using Android.Content.PM;
|
||||||
|
using Android.OS;
|
||||||
|
using Android.Runtime;
|
||||||
|
using Android.Views;
|
||||||
|
using Android.Widget;
|
||||||
|
using CocosSharp;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using GoneBananas;
|
||||||
|
|
||||||
|
namespace GoneBananasAndroid
|
||||||
|
{
|
||||||
|
[Activity(
|
||||||
|
Label = "GoneBananas",
|
||||||
|
AlwaysRetainTaskState = true,
|
||||||
|
Icon = "@drawable/ic_launcher",
|
||||||
|
Theme = "@android:style/Theme.NoTitleBar",
|
||||||
|
ScreenOrientation = ScreenOrientation.Portrait,
|
||||||
|
LaunchMode = LaunchMode.SingleInstance,
|
||||||
|
MainLauncher = true,
|
||||||
|
ConfigurationChanges = ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden)
|
||||||
|
]
|
||||||
|
public class MainActivity : AndroidGameActivity
|
||||||
|
{
|
||||||
|
protected override void OnCreate(Bundle bundle)
|
||||||
|
{
|
||||||
|
base.OnCreate(bundle);
|
||||||
|
|
||||||
|
var application = new CCApplication();
|
||||||
|
application.ApplicationDelegate = new GoneBananasApplicationDelegate();
|
||||||
|
SetContentView(application.AndroidContentView);
|
||||||
|
application.StartGame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="GoneBananasAndroid.GoneBananasAndroid">
|
||||||
|
<uses-sdk />
|
||||||
|
<application android:label="GoneBananasAndroid">
|
||||||
|
</application>
|
||||||
|
</manifest>
|
|
@ -0,0 +1,28 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using Android.App;
|
||||||
|
|
||||||
|
// Information about this assembly is defined by the following attributes.
|
||||||
|
// Change them to the values specific to your project.
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle ("GoneBananasAndroid")]
|
||||||
|
[assembly: AssemblyDescription ("")]
|
||||||
|
[assembly: AssemblyConfiguration ("")]
|
||||||
|
[assembly: AssemblyCompany ("")]
|
||||||
|
[assembly: AssemblyProduct ("")]
|
||||||
|
[assembly: AssemblyCopyright ("mike_bluestein")]
|
||||||
|
[assembly: AssemblyTrademark ("")]
|
||||||
|
[assembly: AssemblyCulture ("")]
|
||||||
|
|
||||||
|
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||||
|
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||||
|
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||||
|
|
||||||
|
[assembly: AssemblyVersion ("1.0.0")]
|
||||||
|
|
||||||
|
// The following attributes are used to specify the signing key for the assembly,
|
||||||
|
// if desired. See the Mono documentation for more information about signing.
|
||||||
|
|
||||||
|
//[assembly: AssemblyDelaySign(false)]
|
||||||
|
//[assembly: AssemblyKeyFile("")]
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||||
|
in your application as resource files. Various Android APIs are designed to
|
||||||
|
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||||
|
directly.
|
||||||
|
|
||||||
|
For example, a sample Android app that contains a user interface layout (main.axml),
|
||||||
|
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
|
||||||
|
would keep its resources in the "Resources" directory of the application:
|
||||||
|
|
||||||
|
Resources/
|
||||||
|
drawable/
|
||||||
|
icon.png
|
||||||
|
|
||||||
|
layout/
|
||||||
|
main.axml
|
||||||
|
|
||||||
|
values/
|
||||||
|
strings.xml
|
||||||
|
|
||||||
|
In order to get the build system to recognize Android resources, set the build action to
|
||||||
|
"AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||||
|
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||||
|
the build system will package the resources for distribution and generate a class called "R"
|
||||||
|
(this is an Android convention) that contains the tokens for each one of the resources
|
||||||
|
included. For example, for the above Resources layout, this is what the R class would expose:
|
||||||
|
|
||||||
|
public class R {
|
||||||
|
public class drawable {
|
||||||
|
public const int icon = 0x123;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class layout {
|
||||||
|
public const int main = 0x456;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class strings {
|
||||||
|
public const int first_string = 0xabc;
|
||||||
|
public const int second_string = 0xbcd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
|
||||||
|
to reference the layout/main.axml file, or R.strings.first_string to reference the first
|
||||||
|
string in the dictionary file values/strings.xml.
|
|
@ -0,0 +1,112 @@
|
||||||
|
#pragma warning disable 1591
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
// <autogenerated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Mono Runtime Version: 4.0.30319.17020
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </autogenerated>
|
||||||
|
// ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
[assembly: Android.Runtime.ResourceDesignerAttribute("GoneBananasAndroid.Resource", IsApplication=true)]
|
||||||
|
|
||||||
|
namespace GoneBananasAndroid
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
|
||||||
|
public partial class Resource
|
||||||
|
{
|
||||||
|
|
||||||
|
static Resource()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void UpdateIdValues()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Attribute
|
||||||
|
{
|
||||||
|
|
||||||
|
static Attribute()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Attribute()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Drawable
|
||||||
|
{
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f020000
|
||||||
|
public const int ic_launcher = 2130837504;
|
||||||
|
|
||||||
|
static Drawable()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Drawable()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Id
|
||||||
|
{
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f050000
|
||||||
|
public const int myButton = 2131034112;
|
||||||
|
|
||||||
|
static Id()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Id()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Layout
|
||||||
|
{
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f030000
|
||||||
|
public const int Main = 2130903040;
|
||||||
|
|
||||||
|
static Layout()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Layout()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class String
|
||||||
|
{
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f040001
|
||||||
|
public const int app_name = 2130968577;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f040000
|
||||||
|
public const int hello = 2130968576;
|
||||||
|
|
||||||
|
static String()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#pragma warning restore 1591
|
После Ширина: | Высота: | Размер: 5.4 KiB |
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
android:id="@+id/myButton"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/hello"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string name="hello">Hello World, Click Me!</string>
|
||||||
|
<string name="app_name">GoneBananasAndroid</string>
|
||||||
|
</resources>
|
|
@ -0,0 +1,51 @@
|
||||||
|
using System;
|
||||||
|
using Box2D.Common;
|
||||||
|
using Box2D.Dynamics;
|
||||||
|
using CocosSharp;
|
||||||
|
|
||||||
|
namespace GoneBananas
|
||||||
|
{
|
||||||
|
internal class CCPhysicsSprite : CCSprite
|
||||||
|
{
|
||||||
|
readonly float ptmRatio;
|
||||||
|
|
||||||
|
public CCPhysicsSprite (CCTexture2D f, CCRect r, float ptmRatio) : base (f, r)
|
||||||
|
{
|
||||||
|
this.ptmRatio = ptmRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public b2Body PhysicsBody { get; set; }
|
||||||
|
|
||||||
|
public override CCAffineTransform AffineLocalTransform {
|
||||||
|
get {
|
||||||
|
if (PhysicsBody == null)
|
||||||
|
return base.AffineLocalTransform;
|
||||||
|
|
||||||
|
b2Vec2 pos = PhysicsBody.Position;
|
||||||
|
|
||||||
|
float x = pos.x * ptmRatio;
|
||||||
|
float y = pos.y * ptmRatio;
|
||||||
|
|
||||||
|
if (IgnoreAnchorPointForPosition) {
|
||||||
|
x += AnchorPointInPoints.X;
|
||||||
|
y += AnchorPointInPoints.Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make matrix
|
||||||
|
float radians = PhysicsBody.Angle;
|
||||||
|
var c = (float)Math.Cos (radians);
|
||||||
|
var s = (float)Math.Sin (radians);
|
||||||
|
|
||||||
|
if (!AnchorPointInPoints.Equals (CCPoint.Zero)) {
|
||||||
|
x += c * -AnchorPointInPoints.X + -s * -AnchorPointInPoints.Y;
|
||||||
|
y += s * -AnchorPointInPoints.X + c * -AnchorPointInPoints.Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rot, Translate Matrix
|
||||||
|
var m_sTransform = new CCAffineTransform (c, s, -s, c, x, y);
|
||||||
|
|
||||||
|
return m_sTransform;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,346 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using CocosDenshion;
|
||||||
|
using CocosSharp;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
using Box2D.Common;
|
||||||
|
using Box2D.Dynamics;
|
||||||
|
using Box2D.Collision.Shapes;
|
||||||
|
|
||||||
|
namespace GoneBananas
|
||||||
|
{
|
||||||
|
public class GameLayer : CCLayerColor
|
||||||
|
{
|
||||||
|
const float MONKEY_SPEED = 350.0f;
|
||||||
|
const float GAME_DURATION = 60.0f; // game ends after 60 seconds or when the monkey hits a ball, whihcever comes first
|
||||||
|
|
||||||
|
// point to meter ratio for physics
|
||||||
|
const int PTM_RATIO = 32;
|
||||||
|
|
||||||
|
float elapsedTime;
|
||||||
|
CCSprite monkey;
|
||||||
|
List<CCSprite> visibleBananas;
|
||||||
|
List<CCSprite> hitBananas;
|
||||||
|
|
||||||
|
// monkey walking animation
|
||||||
|
CCAnimation walkAnim;
|
||||||
|
CCRepeatForever walkRepeat;
|
||||||
|
CCCallFuncN walkAnimStop = new CCCallFuncN (node => node.StopAllActions ());
|
||||||
|
|
||||||
|
// background sprite
|
||||||
|
CCSprite grass;
|
||||||
|
|
||||||
|
// particles
|
||||||
|
CCParticleSun sun;
|
||||||
|
|
||||||
|
// circle layered behind sun
|
||||||
|
CCDrawNode circleNode;
|
||||||
|
|
||||||
|
// parallax node for clouds
|
||||||
|
CCParallaxNode parallaxClouds;
|
||||||
|
|
||||||
|
// define our banana rotation action
|
||||||
|
CCRotateBy rotateBanana = new CCRotateBy (0.8f, 360);
|
||||||
|
|
||||||
|
// define our completion action to remove the banana once it hits the bottom of the screen
|
||||||
|
CCCallFuncN moveBananaComplete = new CCCallFuncN (node => node.RemoveFromParent ());
|
||||||
|
|
||||||
|
// physics world
|
||||||
|
b2World world;
|
||||||
|
|
||||||
|
// balls sprite batch
|
||||||
|
CCSpriteBatchNode ballsBatch;
|
||||||
|
CCTexture2D ballTexture;
|
||||||
|
|
||||||
|
public GameLayer ()
|
||||||
|
{
|
||||||
|
var touchListener = new CCEventListenerTouchAllAtOnce ();
|
||||||
|
touchListener.OnTouchesEnded = OnTouchesEnded;
|
||||||
|
|
||||||
|
AddEventListener (touchListener, this);
|
||||||
|
Color = new CCColor3B (CCColor4B.White);
|
||||||
|
Opacity = 255;
|
||||||
|
|
||||||
|
visibleBananas = new List<CCSprite> ();
|
||||||
|
hitBananas = new List<CCSprite> ();
|
||||||
|
|
||||||
|
// batch node for physics balls
|
||||||
|
ballsBatch = new CCSpriteBatchNode ("balls", 100);
|
||||||
|
ballTexture = ballsBatch.Texture;
|
||||||
|
AddChild (ballsBatch, 1, 1);
|
||||||
|
|
||||||
|
AddGrass ();
|
||||||
|
AddSun ();
|
||||||
|
AddMonkey ();
|
||||||
|
|
||||||
|
Schedule (t => {
|
||||||
|
visibleBananas.Add (AddBanana ());
|
||||||
|
elapsedTime += t;
|
||||||
|
if (ShouldEndGame ()) {
|
||||||
|
EndGame ();
|
||||||
|
}
|
||||||
|
AddBall ();
|
||||||
|
}, 1.0f);
|
||||||
|
|
||||||
|
Schedule (t => CheckCollision ());
|
||||||
|
|
||||||
|
Schedule (t => {
|
||||||
|
world.Step (t, 8, 1);
|
||||||
|
|
||||||
|
foreach (CCPhysicsSprite sprite in ballsBatch.Children) {
|
||||||
|
if (sprite.Visible && sprite.PhysicsBody.Position.x < 0f || sprite.PhysicsBody.Position.x * PTM_RATIO > ContentSize.Width) { //or should it be Layer.VisibleBoundsWorldspace.Size.Width
|
||||||
|
world.DestroyBody (sprite.PhysicsBody);
|
||||||
|
sprite.Visible = false;
|
||||||
|
sprite.RemoveFromParent ();
|
||||||
|
} else {
|
||||||
|
sprite.UpdateTransformedSpriteTextureQuads ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddGrass ()
|
||||||
|
{
|
||||||
|
grass = new CCSprite ("grass");
|
||||||
|
AddChild (grass);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddSun ()
|
||||||
|
{
|
||||||
|
circleNode = new CCDrawNode ();
|
||||||
|
circleNode.DrawSolidCircle (CCPoint.Zero, 30.0f, CCColor4B.Yellow);
|
||||||
|
AddChild (circleNode);
|
||||||
|
|
||||||
|
sun = new CCParticleSun (CCPoint.Zero);
|
||||||
|
sun.StartColor = new CCColor4F (CCColor3B.Red);
|
||||||
|
sun.EndColor = new CCColor4F (CCColor3B.Yellow);
|
||||||
|
AddChild (sun);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddMonkey ()
|
||||||
|
{
|
||||||
|
var spriteSheet = new CCSpriteSheet ("animations/monkey.plist");
|
||||||
|
var animationFrames = spriteSheet.Frames.FindAll ((x) => x.TextureFilename.StartsWith ("frame"));
|
||||||
|
|
||||||
|
walkAnim = new CCAnimation (animationFrames, 0.1f);
|
||||||
|
walkRepeat = new CCRepeatForever (new CCAnimate (walkAnim));
|
||||||
|
monkey = new CCSprite (animationFrames.First ()) { Name = "Monkey" };
|
||||||
|
monkey.Scale = 0.25f;
|
||||||
|
|
||||||
|
AddChild (monkey);
|
||||||
|
}
|
||||||
|
|
||||||
|
CCSprite AddBanana ()
|
||||||
|
{
|
||||||
|
var spriteSheet = new CCSpriteSheet ("animations/monkey.plist");
|
||||||
|
var banana = new CCSprite (spriteSheet.Frames.Find ((x) => x.TextureFilename.StartsWith ("Banana")));
|
||||||
|
|
||||||
|
var p = GetRandomPosition (banana.ContentSize);
|
||||||
|
banana.Position = p;
|
||||||
|
banana.Scale = 0.5f;
|
||||||
|
|
||||||
|
AddChild (banana);
|
||||||
|
|
||||||
|
var moveBanana = new CCMoveTo (5.0f, new CCPoint (banana.Position.X, 0));
|
||||||
|
banana.RunActions (moveBanana, moveBananaComplete);
|
||||||
|
banana.RepeatForever (rotateBanana);
|
||||||
|
|
||||||
|
return banana;
|
||||||
|
}
|
||||||
|
|
||||||
|
CCPoint GetRandomPosition (CCSize spriteSize)
|
||||||
|
{
|
||||||
|
double rnd = CCRandom.NextDouble ();
|
||||||
|
double randomX = (rnd > 0)
|
||||||
|
? rnd * VisibleBoundsWorldspace.Size.Width - spriteSize.Width / 2
|
||||||
|
: spriteSize.Width / 2;
|
||||||
|
|
||||||
|
return new CCPoint ((float)randomX, VisibleBoundsWorldspace.Size.Height - spriteSize.Height / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddClouds ()
|
||||||
|
{
|
||||||
|
float h = VisibleBoundsWorldspace.Size.Height;
|
||||||
|
|
||||||
|
parallaxClouds = new CCParallaxNode {
|
||||||
|
Position = new CCPoint (0, h)
|
||||||
|
};
|
||||||
|
|
||||||
|
AddChild (parallaxClouds);
|
||||||
|
|
||||||
|
var cloud1 = new CCSprite ("cloud");
|
||||||
|
var cloud2 = new CCSprite ("cloud");
|
||||||
|
var cloud3 = new CCSprite ("cloud");
|
||||||
|
|
||||||
|
float yRatio1 = 1.0f;
|
||||||
|
float yRatio2 = 0.15f;
|
||||||
|
float yRatio3 = 0.5f;
|
||||||
|
|
||||||
|
parallaxClouds.AddChild (cloud1, 0, new CCPoint (1.0f, yRatio1), new CCPoint (100, -100 + h - (h * yRatio1)));
|
||||||
|
parallaxClouds.AddChild (cloud2, 0, new CCPoint (1.0f, yRatio2), new CCPoint (250, -200 + h - (h * yRatio2)));
|
||||||
|
parallaxClouds.AddChild (cloud3, 0, new CCPoint (1.0f, yRatio3), new CCPoint (400, -150 + h - (h * yRatio3)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void MoveClouds (float dy)
|
||||||
|
{
|
||||||
|
parallaxClouds.StopAllActions ();
|
||||||
|
var moveClouds = new CCMoveBy (1.0f, new CCPoint (0, dy * 0.1f));
|
||||||
|
parallaxClouds.RunAction (moveClouds);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CheckCollision ()
|
||||||
|
{
|
||||||
|
visibleBananas.ForEach (banana => {
|
||||||
|
bool hit = banana.BoundingBoxTransformedToParent.IntersectsRect (monkey.BoundingBoxTransformedToParent);
|
||||||
|
if (hit) {
|
||||||
|
hitBananas.Add (banana);
|
||||||
|
CCSimpleAudioEngine.SharedEngine.PlayEffect ("Sounds/tap");
|
||||||
|
Explode (banana.Position);
|
||||||
|
banana.RemoveFromParent ();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hitBananas.ForEach (banana => visibleBananas.Remove (banana));
|
||||||
|
|
||||||
|
int ballHitCount = ballsBatch.Children.Count (ball => ball.BoundingBoxTransformedToParent.IntersectsRect (monkey.BoundingBoxTransformedToParent));
|
||||||
|
|
||||||
|
if (ballHitCount > 0) {
|
||||||
|
EndGame ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void EndGame ()
|
||||||
|
{
|
||||||
|
var gameOverScene = GameOverLayer.SceneWithScore (Window, hitBananas.Count);
|
||||||
|
var transitionToGameOver = new CCTransitionMoveInR (0.3f, gameOverScene);
|
||||||
|
Director.ReplaceScene (transitionToGameOver);
|
||||||
|
|
||||||
|
//work-around bug that creates an infinite loop resulting in repeated transitionToGameOver calls
|
||||||
|
this.UnscheduleAll ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Explode (CCPoint pt)
|
||||||
|
{
|
||||||
|
var explosion = new CCParticleExplosion (pt); //TODO: manage "better" for performance when "many" particles
|
||||||
|
explosion.TotalParticles = 10;
|
||||||
|
explosion.AutoRemoveOnFinish = true;
|
||||||
|
AddChild (explosion);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ShouldEndGame ()
|
||||||
|
{
|
||||||
|
return elapsedTime > GAME_DURATION;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnTouchesEnded (List<CCTouch> touches, CCEvent touchEvent)
|
||||||
|
{
|
||||||
|
monkey.StopAllActions ();
|
||||||
|
|
||||||
|
var location = touches [0].LocationOnScreen;
|
||||||
|
location = WorldToScreenspace (location); //Layer.WorldToScreenspace(location);
|
||||||
|
float ds = CCPoint.Distance (monkey.Position, location);
|
||||||
|
|
||||||
|
var dt = ds / MONKEY_SPEED;
|
||||||
|
|
||||||
|
var moveMonkey = new CCMoveTo (dt, location);
|
||||||
|
|
||||||
|
//BUG: calling walkRepeat separately as it doesn't run when called in RunActions or CCSpawn
|
||||||
|
monkey.RunAction (walkRepeat);
|
||||||
|
monkey.RunActions (moveMonkey, walkAnimStop);
|
||||||
|
|
||||||
|
// move the clouds relative to the monkey's movement
|
||||||
|
MoveClouds (location.Y - monkey.Position.Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void AddedToScene ()
|
||||||
|
{
|
||||||
|
base.AddedToScene ();
|
||||||
|
|
||||||
|
Scene.SceneResolutionPolicy = CCSceneResolutionPolicy.NoBorder;
|
||||||
|
|
||||||
|
grass.Position = VisibleBoundsWorldspace.Center;
|
||||||
|
monkey.Position = VisibleBoundsWorldspace.Center;
|
||||||
|
|
||||||
|
var b = VisibleBoundsWorldspace;
|
||||||
|
sun.Position = b.UpperRight.Offset (-100, -100); //BUG: doesn't appear in visible area on Nexus 7 device
|
||||||
|
|
||||||
|
circleNode.Position = sun.Position;
|
||||||
|
|
||||||
|
AddClouds ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitPhysics ()
|
||||||
|
{
|
||||||
|
CCSize s = Layer.VisibleBoundsWorldspace.Size;
|
||||||
|
|
||||||
|
var gravity = new b2Vec2 (0.0f, -10.0f);
|
||||||
|
world = new b2World (gravity);
|
||||||
|
|
||||||
|
world.SetAllowSleeping (true);
|
||||||
|
world.SetContinuousPhysics (true);
|
||||||
|
|
||||||
|
var def = new b2BodyDef ();
|
||||||
|
def.allowSleep = true;
|
||||||
|
def.position = b2Vec2.Zero;
|
||||||
|
def.type = b2BodyType.b2_staticBody;
|
||||||
|
b2Body groundBody = world.CreateBody (def);
|
||||||
|
groundBody.SetActive (true);
|
||||||
|
|
||||||
|
b2EdgeShape groundBox = new b2EdgeShape ();
|
||||||
|
groundBox.Set (b2Vec2.Zero, new b2Vec2 (s.Width / PTM_RATIO, 0));
|
||||||
|
b2FixtureDef fd = new b2FixtureDef ();
|
||||||
|
fd.shape = groundBox;
|
||||||
|
groundBody.CreateFixture (fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddBall ()
|
||||||
|
{
|
||||||
|
int idx = (CCRandom.Float_0_1 () > .5 ? 0 : 1);
|
||||||
|
int idy = (CCRandom.Float_0_1 () > .5 ? 0 : 1);
|
||||||
|
var sprite = new CCPhysicsSprite (ballTexture, new CCRect (32 * idx, 32 * idy, 32, 32), PTM_RATIO);
|
||||||
|
|
||||||
|
ballsBatch.AddChild (sprite);
|
||||||
|
|
||||||
|
CCPoint p = GetRandomPosition (sprite.ContentSize);
|
||||||
|
|
||||||
|
sprite.Position = new CCPoint (p.X, p.Y);
|
||||||
|
|
||||||
|
var def = new b2BodyDef ();
|
||||||
|
def.position = new b2Vec2 (p.X / PTM_RATIO, p.Y / PTM_RATIO);
|
||||||
|
def.type = b2BodyType.b2_dynamicBody;
|
||||||
|
b2Body body = world.CreateBody (def);
|
||||||
|
|
||||||
|
var circle = new b2CircleShape ();
|
||||||
|
circle.Radius = 0.5f;
|
||||||
|
|
||||||
|
var fd = new b2FixtureDef ();
|
||||||
|
fd.shape = circle;
|
||||||
|
fd.density = 1f;
|
||||||
|
fd.restitution = 0.85f;
|
||||||
|
fd.friction = 0.3f;
|
||||||
|
body.CreateFixture (fd);
|
||||||
|
|
||||||
|
sprite.PhysicsBody = body;
|
||||||
|
|
||||||
|
Console.WriteLine ("sprite batch node count = {0}", ballsBatch.ChildrenCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnEnter ()
|
||||||
|
{
|
||||||
|
base.OnEnter ();
|
||||||
|
|
||||||
|
InitPhysics ();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CCScene GameScene (CCWindow mainWindow)
|
||||||
|
{
|
||||||
|
var scene = new CCScene (mainWindow);
|
||||||
|
var layer = new GameLayer ();
|
||||||
|
|
||||||
|
scene.AddChild (layer);
|
||||||
|
|
||||||
|
return scene;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,81 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using CocosSharp;
|
||||||
|
|
||||||
|
namespace GoneBananas
|
||||||
|
{
|
||||||
|
public class GameOverLayer : CCLayerColor
|
||||||
|
{
|
||||||
|
|
||||||
|
string scoreMessage = string.Empty;
|
||||||
|
|
||||||
|
public GameOverLayer (int score) //: base(new CCSize (640, 1136))
|
||||||
|
{
|
||||||
|
|
||||||
|
var touchListener = new CCEventListenerTouchAllAtOnce ();
|
||||||
|
touchListener.OnTouchesEnded = (touches, ccevent) => Window.DefaultDirector.ReplaceScene (GameLayer.GameScene (Window));
|
||||||
|
|
||||||
|
AddEventListener (touchListener, this);
|
||||||
|
|
||||||
|
scoreMessage = String.Format ("Game Over. You collected {0} bananas!", score);
|
||||||
|
|
||||||
|
Color = new CCColor3B (CCColor4B.Black);
|
||||||
|
|
||||||
|
Opacity = 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddMonkey ()
|
||||||
|
{
|
||||||
|
var spriteSheet = new CCSpriteSheet ("animations/monkey.plist");
|
||||||
|
var frame = spriteSheet.Frames.Find ((x) => x.TextureFilename.StartsWith ("frame"));
|
||||||
|
|
||||||
|
var monkey = new CCSprite (frame) {
|
||||||
|
Position = new CCPoint (VisibleBoundsWorldspace.Size.Center.X + 20, VisibleBoundsWorldspace.Size.Center.Y + 300),
|
||||||
|
Scale = 0.5f
|
||||||
|
};
|
||||||
|
|
||||||
|
AddChild (monkey);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void AddedToScene ()
|
||||||
|
{
|
||||||
|
base.AddedToScene ();
|
||||||
|
|
||||||
|
Scene.SceneResolutionPolicy = CCSceneResolutionPolicy.ShowAll;
|
||||||
|
|
||||||
|
var scoreLabel = new CCLabelTtf (scoreMessage, "arial", 22) {
|
||||||
|
Position = new CCPoint (VisibleBoundsWorldspace.Size.Center.X, VisibleBoundsWorldspace.Size.Center.Y + 50),
|
||||||
|
Color = new CCColor3B (CCColor4B.Yellow),
|
||||||
|
HorizontalAlignment = CCTextAlignment.Center,
|
||||||
|
VerticalAlignment = CCVerticalTextAlignment.Center,
|
||||||
|
AnchorPoint = CCPoint.AnchorMiddle,
|
||||||
|
Dimensions = ContentSize
|
||||||
|
};
|
||||||
|
|
||||||
|
AddChild (scoreLabel);
|
||||||
|
|
||||||
|
var playAgainLabel = new CCLabelTtf ("Tap to Play Again", "arial", 22) {
|
||||||
|
Position = VisibleBoundsWorldspace.Size.Center,
|
||||||
|
Color = new CCColor3B (CCColor4B.Green),
|
||||||
|
HorizontalAlignment = CCTextAlignment.Center,
|
||||||
|
VerticalAlignment = CCVerticalTextAlignment.Center,
|
||||||
|
AnchorPoint = CCPoint.AnchorMiddle,
|
||||||
|
Dimensions = ContentSize
|
||||||
|
};
|
||||||
|
|
||||||
|
AddChild (playAgainLabel);
|
||||||
|
|
||||||
|
AddMonkey ();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CCScene SceneWithScore (CCWindow mainWindow, int score)
|
||||||
|
{
|
||||||
|
var scene = new CCScene (mainWindow);
|
||||||
|
var layer = new GameOverLayer (score);
|
||||||
|
|
||||||
|
scene.AddChild (layer);
|
||||||
|
|
||||||
|
return scene;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using CocosSharp;
|
||||||
|
|
||||||
|
namespace GoneBananas
|
||||||
|
{
|
||||||
|
public class GameStartLayer : CCLayerColor
|
||||||
|
{
|
||||||
|
public GameStartLayer () : base ()
|
||||||
|
{
|
||||||
|
var touchListener = new CCEventListenerTouchAllAtOnce ();
|
||||||
|
touchListener.OnTouchesEnded = (touches, ccevent) => Window.DefaultDirector.ReplaceScene (GameLayer.GameScene (Window));
|
||||||
|
|
||||||
|
AddEventListener (touchListener, this);
|
||||||
|
|
||||||
|
Color = CCColor3B.Black;
|
||||||
|
Opacity = 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void AddedToScene ()
|
||||||
|
{
|
||||||
|
base.AddedToScene ();
|
||||||
|
|
||||||
|
Scene.SceneResolutionPolicy = CCSceneResolutionPolicy.ShowAll;
|
||||||
|
|
||||||
|
var label = new CCLabelTtf ("Tap Screen to Go Bananas!", "arial", 22) {
|
||||||
|
Position = VisibleBoundsWorldspace.Center,
|
||||||
|
Color = CCColor3B.Green,
|
||||||
|
HorizontalAlignment = CCTextAlignment.Center,
|
||||||
|
VerticalAlignment = CCVerticalTextAlignment.Center,
|
||||||
|
AnchorPoint = CCPoint.AnchorMiddle,
|
||||||
|
Dimensions = ContentSize
|
||||||
|
};
|
||||||
|
|
||||||
|
AddChild (label);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CCScene GameStartLayerScene (CCWindow mainWindow)
|
||||||
|
{
|
||||||
|
var scene = new CCScene (mainWindow);
|
||||||
|
var layer = new GameStartLayer ();
|
||||||
|
|
||||||
|
scene.AddChild (layer);
|
||||||
|
|
||||||
|
return scene;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
using CocosDenshion;
|
||||||
|
using CocosSharp;
|
||||||
|
|
||||||
|
namespace GoneBananas
|
||||||
|
{
|
||||||
|
public class GoneBananasApplicationDelegate : CCApplicationDelegate
|
||||||
|
{
|
||||||
|
|
||||||
|
public override void ApplicationDidFinishLaunching (CCApplication application, CCWindow mainWindow)
|
||||||
|
{
|
||||||
|
application.PreferMultiSampling = false;
|
||||||
|
application.ContentRootDirectory = "Content";
|
||||||
|
|
||||||
|
mainWindow.SupportedDisplayOrientations = CCDisplayOrientation.Portrait;
|
||||||
|
|
||||||
|
application.ContentSearchPaths.Add("hd");
|
||||||
|
|
||||||
|
CCSimpleAudioEngine.SharedEngine.PreloadEffect ("Sounds/tap");
|
||||||
|
|
||||||
|
CCScene scene = GameStartLayer.GameStartLayerScene(mainWindow);
|
||||||
|
mainWindow.RunWithScene (scene);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ApplicationDidEnterBackground (CCApplication application)
|
||||||
|
{
|
||||||
|
// stop all of the animation actions that are running.
|
||||||
|
application.PauseGame ();
|
||||||
|
|
||||||
|
// if you use SimpleAudioEngine, your music must be paused
|
||||||
|
CCSimpleAudioEngine.SharedEngine.PauseBackgroundMusic ();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ApplicationWillEnterForeground (CCApplication application)
|
||||||
|
{
|
||||||
|
application.ResumeGame ();
|
||||||
|
|
||||||
|
|
||||||
|
// if you use SimpleAudioEngine, your background music track must resume here.
|
||||||
|
CCSimpleAudioEngine.SharedEngine.ResumeBackgroundMusic ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||||
|
<HasSharedItems>true</HasSharedItems>
|
||||||
|
<SharedGUID>{7187ABEC-F6E0-4CF4-8E8C-481DBE6DA18B}</SharedGUID>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="Configuration">
|
||||||
|
<Import_RootNamespace>GoneBananasShared</Import_RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)GameLayer.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)GameStartLayer.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)GameOverLayer.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)GoneBananasApplicationDelegate.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)CCPhysicsSprite.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ProjectGuid>{7187ABEC-F6E0-4CF4-8E8C-481DBE6DA18B}</ProjectGuid>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
|
||||||
|
<Import Project="GoneBananasShared.projitems" Label="Shared" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
|
||||||
|
</Project>
|
|
@ -0,0 +1,18 @@
|
||||||
|
using System;
|
||||||
|
using MonoTouch.Foundation;
|
||||||
|
using MonoTouch.UIKit;
|
||||||
|
using CocosSharp;
|
||||||
|
|
||||||
|
namespace GoneBananas
|
||||||
|
{
|
||||||
|
[Register ("AppDelegate")]
|
||||||
|
public partial class AppDelegate : UIApplicationDelegate
|
||||||
|
{
|
||||||
|
public override void FinishedLaunching (UIApplication app)
|
||||||
|
{
|
||||||
|
var application = new CCApplication ();
|
||||||
|
application.ApplicationDelegate = new GoneBananasApplicationDelegate ();
|
||||||
|
application.StartGame ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,139 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>frames</key>
|
||||||
|
<dict>
|
||||||
|
<key>Banana-hd.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{2,2},{44,108}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{44,108}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{44,108}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-1.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{48,2},{391,555}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{391,555}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{391,555}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-2.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{441,2},{390,553}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{390,553}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{390,553}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-3.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{833,2},{387,566}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{387,566}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{387,566}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-4.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{1222,2},{386,579}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{386,579}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{386,579}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-5.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{1610,2},{387,573}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{387,573}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{387,573}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-6.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{2,583},{389,560}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{389,560}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{389,560}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-7.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{393,583},{390,553}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{390,553}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{390,553}</string>
|
||||||
|
</dict>
|
||||||
|
<key>frame-8.png</key>
|
||||||
|
<dict>
|
||||||
|
<key>frame</key>
|
||||||
|
<string>{{785,583},{389,557}}</string>
|
||||||
|
<key>offset</key>
|
||||||
|
<string>{0,0}</string>
|
||||||
|
<key>rotated</key>
|
||||||
|
<false/>
|
||||||
|
<key>sourceColorRect</key>
|
||||||
|
<string>{{0,0},{389,557}}</string>
|
||||||
|
<key>sourceSize</key>
|
||||||
|
<string>{389,557}</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>metadata</key>
|
||||||
|
<dict>
|
||||||
|
<key>format</key>
|
||||||
|
<integer>2</integer>
|
||||||
|
<key>realTextureFileName</key>
|
||||||
|
<string>monkey.png</string>
|
||||||
|
<key>size</key>
|
||||||
|
<string>{2048,2048}</string>
|
||||||
|
<key>smartupdate</key>
|
||||||
|
<string>$TexturePacker:SmartUpdate:c63ac17999f746ee253cb9e63215058f:7b9d55d9c4db1e73987b80a4545fa776:c408e1678cc8476d89ba18c5256b3484$</string>
|
||||||
|
<key>textureFileName</key>
|
||||||
|
<string>monkey.png</string>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
После Ширина: | Высота: | Размер: 764 KiB |
После Ширина: | Высота: | Размер: 5.2 KiB |
После Ширина: | Высота: | Размер: 6.9 KiB |
После Ширина: | Высота: | Размер: 1.2 MiB |
|
@ -0,0 +1,203 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
|
||||||
|
<ProductVersion>8.0.30703</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{0F682923-EE76-4240-BBEB-56BF44B82A57}</ProjectGuid>
|
||||||
|
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>GoneBananas</RootNamespace>
|
||||||
|
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;IOS;</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<MtouchLink>None</MtouchLink>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<MtouchDebug>true</MtouchDebug>
|
||||||
|
<AssemblyName>GoneBananasiOS</AssemblyName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<MtouchLink>None</MtouchLink>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<AssemblyName>GoneBananasiOS</AssemblyName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\iPhone\Debug</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<MtouchDebug>true</MtouchDebug>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<CodesignKey>iPhone Developer</CodesignKey>
|
||||||
|
<AssemblyName>GoneBananas</AssemblyName>
|
||||||
|
<IpaPackageName>
|
||||||
|
</IpaPackageName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\iPhone\Release</OutputPath>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<CodesignKey>iPhone Developer</CodesignKey>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<AssemblyName>GoneBananas</AssemblyName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\iPhone\Ad-Hoc</OutputPath>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<CodesignKey>iPhone Distribution</CodesignKey>
|
||||||
|
<BuildIpa>true</BuildIpa>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
|
||||||
|
<AssemblyName>GoneBananas</AssemblyName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\iPhone\AppStore</OutputPath>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<CodesignKey>iPhone Distribution</CodesignKey>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<CodesignProvision>Automatic:AppStore</CodesignProvision>
|
||||||
|
<AssemblyName>GoneBananas</AssemblyName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="monotouch" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Resources\" />
|
||||||
|
<Folder Include="Content\" />
|
||||||
|
<Folder Include="Content\fonts\" />
|
||||||
|
<Folder Include="Content\Sounds\" />
|
||||||
|
<Folder Include="Content\hd\" />
|
||||||
|
<Folder Include="Content\hd\animations\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Info.plist" />
|
||||||
|
<Compile Include="Main.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="AppDelegate.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="..\GoneBananasShared\GoneBananasShared.projitems" Label="Shared" Condition="Exists('..\GoneBananasShared\GoneBananasShared.projitems')" />
|
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="Resources\Default-568h%402x.png" />
|
||||||
|
<BundleResource Include="Content\Sounds\tap.mp3" />
|
||||||
|
<BundleResource Include="Content\hd\animations\monkey.png" />
|
||||||
|
<BundleResource Include="Content\hd\animations\monkey.plist" />
|
||||||
|
<BundleResource Include="Content\fonts\arial-22.xnb" />
|
||||||
|
<BundleResource Include="Content\hd\grass.png" />
|
||||||
|
<BundleResource Include="Content\hd\cloud.png" />
|
||||||
|
<BundleResource Include="Content\hd\balls.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Contents.json" />
|
||||||
|
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-60%402x.png" />
|
||||||
|
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-Small-40%402x.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>UIDeviceFamily</key>
|
||||||
|
<array>
|
||||||
|
<integer>1</integer>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
</array>
|
||||||
|
<key>MinimumOSVersion</key>
|
||||||
|
<string>8.0</string>
|
||||||
|
<key>UIPrerenderedIcon</key>
|
||||||
|
<true/>
|
||||||
|
<key>CFBundleDisplayName</key>
|
||||||
|
<string>GoneBananas</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>com.xamarin.gonebananas</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>XSAppIconAssets</key>
|
||||||
|
<string>Resources/Images.xcassets/AppIcons.appiconset</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -0,0 +1,16 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using MonoTouch.Foundation;
|
||||||
|
using MonoTouch.UIKit;
|
||||||
|
|
||||||
|
namespace GoneBananas
|
||||||
|
{
|
||||||
|
public class Application
|
||||||
|
{
|
||||||
|
static void Main (string[] args)
|
||||||
|
{
|
||||||
|
UIApplication.Main (args, null, "AppDelegate");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
После Ширина: | Высота: | Размер: 61 KiB |
|
@ -0,0 +1 @@
|
||||||
|
{"images":[{"idiom":"iphone","filename":"Icon-60@2x.png","size":"60x60","scale":"2x"},{"idiom":"iphone","filename":"Icon-Small-40@2x.png","size":"40x40","scale":"2x"}],"info":{"version":1,"author":"xcode"}}
|
Двоичные данные
GoneBananas/GoneBananasiOS/Resources/Images.xcassets/AppIcons.appiconset/Icon-60@2x.png
Normal file
После Ширина: | Высота: | Размер: 18 KiB |
Двоичные данные
GoneBananas/GoneBananasiOS/Resources/Images.xcassets/AppIcons.appiconset/Icon-Small-40@2x.png
Normal file
После Ширина: | Высота: | Размер: 10 KiB |
|
@ -0,0 +1,24 @@
|
||||||
|
Gone Bananas
|
||||||
|
============
|
||||||
|
|
||||||
|
Sample game to accompany the getting started walkthrough.
|
||||||
|
|
||||||
|
![GoneBananas](screenshots/GoneBananas.png?raw=true "Gone Bananas")
|
||||||
|
|
||||||
|
Demonstrates the following features:
|
||||||
|
|
||||||
|
- Sprite creation
|
||||||
|
- Actions
|
||||||
|
- Scene transitions
|
||||||
|
- Sprite sheet animation
|
||||||
|
- Sprite batching
|
||||||
|
- Parallax
|
||||||
|
- Particles
|
||||||
|
- Touch handling
|
||||||
|
- Physics
|
||||||
|
|
||||||
|
Future verisons will include:
|
||||||
|
|
||||||
|
- Accelerometer input
|
||||||
|
- Leaderboards
|
||||||
|
- Multi-player
|
После Ширина: | Высота: | Размер: 209 KiB |