Initial commit

This commit is contained in:
The Fuzzy Riolu 2018-03-12 11:52:38 -04:00
parent cdb0da6c34
commit 40d01342d0
364 changed files with 37964 additions and 0 deletions

Binary file not shown.

40
README.md Normal file
View file

@ -0,0 +1,40 @@
# ShiftOS Pong
This is an Android port of the Pong minigame from ShiftOS. In this version of Pong, the game is split into
60-second levels. The higher the level, the harder the game gets and the more Codepoints you earn for surviving
the level or beating the computer player.
In ShiftOS, the mouse was used to control your paddle by moving the mouse up and down the screen to move the
paddle. In this version, since there is no mouse, you use your finger to swipe up and down the screen to move
your paddle.
This version of the game also does not allow you to cash out your Codepoints into your Shiftorium, because this
is not in any way attached to a ShiftOS backend. It is simply a way to see how far you can get in ShiftOS Pong
without having to play ShiftOS.
It can actually get quite addictive. The current "world" record (the record set by the developer of the game) is
Level 4 with 43 Codepoints. Can you beat that?
## Compiling
You will need Xamarin for Visual Studio 2017, as well as the MonoGame 3.6 SDK for Visual Studio. That'll get you
at least a working development environment on your computer.
The game is tested on Android 7.0 Nougat on an LG G5, however it should theoretically work on Marshmallow as
well.
## Getting the game on your device
Since this game isn't on Google Play, you'll have to side-load it. You can do this from within Visual Studio if
you have a proper Xamarin Android dev environment set up. However, there are a few things you need to do on your
device to get it to let you side-load.
For modern Android versions, you'll want to head into your Settings and find your Android build number. Tap that
at least 5 times in a row, and your phone should go into Developer Mode. Developer Mode unlocks some advanced
settings for Android developers, under the "Developer Options" category. In there, you will find an option for
USB Debugging.
Turn that on. If it is greyed out, make sure your device is **not** plugged in via USB! Once it's on, plug your
device into your development environment through USB and make sure the device is set to charge off your PC. If
the device asks you if you want to allow USB debugging for this system, say yes. Now you can side-load the game
onto your device from within Visual Studio by compiling the game an using your device as the target.

27
WatercolorGames.Pong.sln Normal file
View file

@ -0,0 +1,27 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2002
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WatercolorGames.Pong", "WatercolorGames.Pong\WatercolorGames.Pong.csproj", "{235981A1-6BC1-428D-8882-7A0373D3FED4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{235981A1-6BC1-428D-8882-7A0373D3FED4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{235981A1-6BC1-428D-8882-7A0373D3FED4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{235981A1-6BC1-428D-8882-7A0373D3FED4}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{235981A1-6BC1-428D-8882-7A0373D3FED4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{235981A1-6BC1-428D-8882-7A0373D3FED4}.Release|Any CPU.Build.0 = Release|Any CPU
{235981A1-6BC1-428D-8882-7A0373D3FED4}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {63168E43-6C18-46D2-9ED3-87618792CB32}
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,226 @@
using System;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Plex.Engine.GraphicsSubsystem;
using Microsoft.Xna.Framework.Graphics;
namespace Plex.Engine
{
public enum WrapMode
{
None,
Words,
Letters
}
/// <summary>
/// A class for rendering text.
/// </summary>
public static class TextRenderer
{
private static string WrapLine(SpriteFont font, string text, float maxLineWidth)
{
if (string.IsNullOrEmpty(text))
return text;
if (font.MeasureString(text).X <= maxLineWidth)
return text;
text = text.Trim();
var sb = new StringBuilder();
return sb.ToString().TrimEnd();
}
/// <summary>
/// Perform text wrapping on a string of text using the specified <see cref="SpriteFont"/>.
/// </summary>
/// <param name="font">The <see cref="SpriteFont"/> representing the font to measure the text in.</param>
/// <param name="text">The text to wrap.</param>
/// <param name="maxLineWidth">The maximum width (in pixels) that a line of text can be.</param>
/// <param name="mode">The type of text wrapping to apply.</param>
/// <returns>The resulting wrapped text.</returns>
public static string WrapText(SpriteFont font, string text, float maxLineWidth, WrapMode mode)
{
if (string.IsNullOrEmpty(text))
return text;
if (font.MeasureString(text).X <= maxLineWidth)
return text;
if (mode == WrapMode.Words)
{
float spacewidth = font.MeasureString(" ").X;
if (maxLineWidth < spacewidth)
return text;
text = text.Trim().Replace("\r", "");
string[] lines = text.Split('\n');
float lineWidth = 0;
var sb = new StringBuilder();
foreach (var line in lines)
{
lineWidth = 0;
if (sb.Length>0)
sb.Append("\n");
var words = line.Split(' ').ToList();
for (int i = 0; i < words.Count; i++)
{
string word = words[i];
Vector2 size = font.MeasureString(word);
if (lineWidth + size.X <= maxLineWidth)
{
sb.Append(word + " ");
lineWidth += size.X + spacewidth;
}
else
{
if (size.X >= maxLineWidth)
{
if (sb.Length>0)
sb.Append("\n");
int half = word.Length / 2;
string first = word.Substring(0, half);
string second = word.Substring(half);
words[i] = first;
words.Insert(i + 1, second);
i--;
continue;
}
else
{
sb.Append("\n" + word + " ");
lineWidth = size.X + spacewidth;
}
}
}
}
return sb.ToString().TrimEnd();
}
else
{
float lineWidth = 0;
string newstr = "";
foreach (char c in text)
{
var measure = font.MeasureString(c.ToString());
if(lineWidth + measure.X > maxLineWidth)
{
newstr += "\n";
lineWidth = 0;
}
else
{
if (c == '\n')
{
lineWidth = 0;
}
else
lineWidth += measure.X;
}
newstr += c;
}
return newstr;
}
}
/// <summary>
/// Measure a string of text to get its width and height in pixels.
/// </summary>
/// <param name="text">The text to measure</param>
/// <param name="font">The font to measure with</param>
/// <param name="maxwidth">The maximum width text can be before it is wrapped</param>
/// <param name="wrapMode">The wrap mode to use</param>
/// <returns>The size in pixels of the text.</returns>
public static Vector2 MeasureText(string text, SpriteFont font, int maxwidth, WrapMode wrapMode)
{
if (string.IsNullOrEmpty(text))
return Vector2.Zero;
switch (wrapMode)
{
case WrapMode.None:
return font.MeasureString(text);
default:
return font.MeasureString(WrapText(font, text, maxwidth, wrapMode));
}
}
/// <summary>
/// Render a string of text.
/// </summary>
/// <param name="gfx">The graphics context to render the text to.</param>
/// <param name="text">The text to render.</param>
/// <param name="x">The X coordinate of the text.</param>
/// <param name="y">The Y coordinate of the text.</param>
/// <param name="font">The font to render the text in.</param>
/// <param name="maxwidth">The maximum width text can be before it is wrapped.</param>
/// <param name="alignment">The alignment of the text.</param>
/// <param name="wrapMode">The type of text wrapping to use.</param>
/// <param name="color">The color of the text to render</param>
public static void DrawText(GraphicsContext gfx, int x, int y, string text, SpriteFont font, Color color, int maxwidth, TextAlignment alignment, WrapMode wrapMode)
{
if (string.IsNullOrEmpty(text))
return;
string measured = (wrapMode == WrapMode.None) ? text : WrapText(font, text, maxwidth, wrapMode);
string[] lines = measured.Split('\n');
for (int i = 0; i < lines.Length; i++)
{
var line = lines[i];
var measure = font.MeasureString(line);
switch (alignment)
{
case TextAlignment.Left:
gfx.Batch.DrawString(font, line, new Vector2(x, y + (measure.Y * i)), color);
break;
case TextAlignment.Center:
gfx.Batch.DrawString(font, line, new Vector2(x + ((maxwidth-measure.X)/2), y + (measure.Y * i)), color);
break;
case TextAlignment.Right:
gfx.Batch.DrawString(font, line, new Vector2(x + (maxwidth - measure.X), y + (measure.Y * i)), color);
break;
}
}
}
}
/// <summary>
/// Describes how text should be aligned when rendered.
/// </summary>
public enum TextAlignment
{
/// <summary>
/// Text should be aligned to the centre of the render bounds.
/// </summary>
Center = 0,
/// <summary>
/// Text should be aligned to the left.
/// </summary>
Left = 1,
/// <summary>
/// Text should be rendered to the right.
/// </summary>
Right = 2,
}
/// <summary>
/// Indicates that this <see cref="ATextRenderer"/> should be the default renderer for the game.
/// </summary>
[Obsolete("GDI fonts no longer supported.")]
public class DefaultRenderer : Attribute
{
}
/// <summary>
/// Indicates that this <see cref="ATextRenderer"/> should be the fallback renderer for the game.
/// </summary>
[Obsolete("GDI fonts no longer supported.")]
public class FallbackRenderer : Attribute
{
}
}

View file

@ -0,0 +1,27 @@
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Views;
namespace WatercolorGames.Pong
{
[Activity(Label = "WatercolorGames.Pong"
, MainLauncher = true
, Icon = "@drawable/icon"
, Theme = "@style/Theme.Splash"
, AlwaysRetainTaskState = true
, LaunchMode = Android.Content.PM.LaunchMode.SingleInstance
, ScreenOrientation = ScreenOrientation.FullUser
, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize)]
public class Activity1 : Microsoft.Xna.Framework.AndroidGameActivity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
var g = new Game1(this);
SetContentView((View)g.Services.GetService(typeof(View)));
g.Run();
}
}
}

View file

@ -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 you 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");

View file

@ -0,0 +1,48 @@
#----------------------------- Global Properties ----------------------------#
/outputDir:bin/$(Platform)
/intermediateDir:obj/$(Platform)
/platform:Android
/config:
/profile:Reach
/compress:False
#-------------------------------- References --------------------------------#
#---------------------------------- Content ---------------------------------#
#begin Fonts/MainBody.spritefont
/importer:FontDescriptionImporter
/processor:FontDescriptionProcessor
/processorParam:PremultiplyAlpha=True
/processorParam:TextureFormat=Compressed
/build:Fonts/MainBody.spritefont
#begin Fonts/TimeLeft.spritefont
/importer:FontDescriptionImporter
/processor:FontDescriptionProcessor
/processorParam:PremultiplyAlpha=True
/processorParam:TextureFormat=Compressed
/build:Fonts/TimeLeft.spritefont
#begin Fonts/Score.spritefont
/importer:FontDescriptionImporter
/processor:FontDescriptionProcessor
/processorParam:PremultiplyAlpha=True
/processorParam:TextureFormat=Compressed
/build:Fonts/Score.spritefont
#begin SFX/writesound.wav
/importer:WavImporter
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:SFX/writesound.wav
#begin SFX/typesound.wav
/importer:WavImporter
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:SFX/typesound.wav

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains an xml description of a font, and will be read by the XNA
Framework Content Pipeline. Follow the comments to customize the appearance
of the font in your game, and to change the characters which are available to draw
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription">
<!--
Modify this string to change the font that will be imported.
-->
<FontName>Oxygen</FontName>
<!--
Size is a float value, measured in points. Modify this value to change
the size of the font.
-->
<Size>45</Size>
<!--
Spacing is a float value, measured in pixels. Modify this value to change
the amount of spacing in between characters.
-->
<Spacing>0</Spacing>
<!--
UseKerning controls the layout of the font. If this value is true, kerning information
will be used when placing characters.
-->
<UseKerning>true</UseKerning>
<!--
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
and "Bold, Italic", and are case sensitive.
-->
<Style>Regular</Style>
<!--
If you uncomment this line, the default character will be substituted if you draw
or measure text that contains characters which were not included in the font.
-->
<!-- <DefaultCharacter>*</DefaultCharacter> -->
<!--
CharacterRegions control what letters are available in the font. Every
character from Start to End will be built and made available for drawing. The
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
character set. The characters are ordered according to the Unicode standard.
See the documentation for more information.
-->
<CharacterRegions>
<CharacterRegion>
<Start>&#32;</Start>
<End>&#126;</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains an xml description of a font, and will be read by the XNA
Framework Content Pipeline. Follow the comments to customize the appearance
of the font in your game, and to change the characters which are available to draw
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription">
<!--
Modify this string to change the font that will be imported.
-->
<FontName>Oxygen</FontName>
<!--
Size is a float value, measured in points. Modify this value to change
the size of the font.
-->
<Size>48</Size>
<!--
Spacing is a float value, measured in pixels. Modify this value to change
the amount of spacing in between characters.
-->
<Spacing>0</Spacing>
<!--
UseKerning controls the layout of the font. If this value is true, kerning information
will be used when placing characters.
-->
<UseKerning>true</UseKerning>
<!--
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
and "Bold, Italic", and are case sensitive.
-->
<Style>Regular</Style>
<!--
If you uncomment this line, the default character will be substituted if you draw
or measure text that contains characters which were not included in the font.
-->
<!-- <DefaultCharacter>*</DefaultCharacter> -->
<!--
CharacterRegions control what letters are available in the font. Every
character from Start to End will be built and made available for drawing. The
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
character set. The characters are ordered according to the Unicode standard.
See the documentation for more information.
-->
<CharacterRegions>
<CharacterRegion>
<Start>&#32;</Start>
<End>&#126;</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>

View file

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains an xml description of a font, and will be read by the XNA
Framework Content Pipeline. Follow the comments to customize the appearance
of the font in your game, and to change the characters which are available to draw
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription">
<!--
Modify this string to change the font that will be imported.
-->
<FontName>Roboto Mono</FontName>
<!--
Size is a float value, measured in points. Modify this value to change
the size of the font.
-->
<Size>96</Size>
<!--
Spacing is a float value, measured in pixels. Modify this value to change
the amount of spacing in between characters.
-->
<Spacing>0</Spacing>
<!--
UseKerning controls the layout of the font. If this value is true, kerning information
will be used when placing characters.
-->
<UseKerning>true</UseKerning>
<!--
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
and "Bold, Italic", and are case sensitive.
-->
<Style>Regular</Style>
<!--
If you uncomment this line, the default character will be substituted if you draw
or measure text that contains characters which were not included in the font.
-->
<!-- <DefaultCharacter>*</DefaultCharacter> -->
<!--
CharacterRegions control what letters are available in the font. Every
character from Start to End will be built and made available for drawing. The
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
character set. The characters are ordered according to the Unicode standard.
See the documentation for more information.
-->
<CharacterRegions>
<CharacterRegion>
<Start>&#32;</Start>
<End>&#126;</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<SourceFileCollection xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Profile>Reach</Profile>
<Platform>Android</Platform>
<Config />
<SourceFiles>
<File>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/Fonts/MainBody.spritefont</File>
<File>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/Fonts/TimeLeft.spritefont</File>
<File>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/Fonts/Score.spritefont</File>
<File>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/SFX/writesound.wav</File>
<File>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/SFX/typesound.wav</File>
</SourceFiles>
</SourceFileCollection>

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<PipelineBuildEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SourceFile>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/Fonts/MainBody.spritefont</SourceFile>
<SourceTime>2018-03-11T22:50:31.6415571-04:00</SourceTime>
<DestFile>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/bin/Android/Fonts/MainBody.xnb</DestFile>
<DestTime>2018-03-11T22:50:33.8371122-04:00</DestTime>
<Importer>FontDescriptionImporter</Importer>
<ImporterTime>2017-03-01T10:05:36-05:00</ImporterTime>
<Processor>FontDescriptionProcessor</Processor>
<ProcessorTime>2017-03-01T10:05:36-05:00</ProcessorTime>
<Parameters>
<Key>PremultiplyAlpha</Key>
<Value>True</Value>
</Parameters>
<Parameters>
<Key>TextureFormat</Key>
<Value>Compressed</Value>
</Parameters>
<Dependencies />
<BuildAsset />
<BuildOutput />
</PipelineBuildEvent>

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<PipelineBuildEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SourceFile>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/Fonts/Score.spritefont</SourceFile>
<SourceTime>2018-03-11T18:13:51.1849077-04:00</SourceTime>
<DestFile>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/bin/Android/Fonts/Score.xnb</DestFile>
<DestTime>2018-03-11T18:13:52.6961013-04:00</DestTime>
<Importer>FontDescriptionImporter</Importer>
<ImporterTime>2017-03-01T10:05:36-05:00</ImporterTime>
<Processor>FontDescriptionProcessor</Processor>
<ProcessorTime>2017-03-01T10:05:36-05:00</ProcessorTime>
<Parameters>
<Key>PremultiplyAlpha</Key>
<Value>True</Value>
</Parameters>
<Parameters>
<Key>TextureFormat</Key>
<Value>Compressed</Value>
</Parameters>
<Dependencies />
<BuildAsset />
<BuildOutput />
</PipelineBuildEvent>

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<PipelineBuildEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SourceFile>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/Fonts/TimeLeft.spritefont</SourceFile>
<SourceTime>2018-03-11T18:13:51.163905-04:00</SourceTime>
<DestFile>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/bin/Android/Fonts/TimeLeft.xnb</DestFile>
<DestTime>2018-03-11T18:13:52.6020888-04:00</DestTime>
<Importer>FontDescriptionImporter</Importer>
<ImporterTime>2017-03-01T10:05:36-05:00</ImporterTime>
<Processor>FontDescriptionProcessor</Processor>
<ProcessorTime>2017-03-01T10:05:36-05:00</ProcessorTime>
<Parameters>
<Key>PremultiplyAlpha</Key>
<Value>True</Value>
</Parameters>
<Parameters>
<Key>TextureFormat</Key>
<Value>Compressed</Value>
</Parameters>
<Dependencies />
<BuildAsset />
<BuildOutput />
</PipelineBuildEvent>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<PipelineBuildEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SourceFile>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/SFX/typesound.wav</SourceFile>
<SourceTime>2017-04-09T11:14:37.6494174-04:00</SourceTime>
<DestFile>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/bin/Android/SFX/typesound.xnb</DestFile>
<DestTime>2018-03-12T11:28:08.6344184-04:00</DestTime>
<Importer>WavImporter</Importer>
<ImporterTime>2017-03-01T10:05:36-05:00</ImporterTime>
<Processor>SoundEffectProcessor</Processor>
<ProcessorTime>2017-03-01T10:05:36-05:00</ProcessorTime>
<Parameters>
<Key>Quality</Key>
<Value>Best</Value>
</Parameters>
<Dependencies />
<BuildAsset />
<BuildOutput />
</PipelineBuildEvent>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<PipelineBuildEvent xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SourceFile>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/SFX/writesound.wav</SourceFile>
<SourceTime>2017-04-09T11:14:37.7734673-04:00</SourceTime>
<DestFile>C:/Users/Michael/source/repos/WatercolorGames.Pong/WatercolorGames.Pong/Content/bin/Android/SFX/writesound.xnb</DestFile>
<DestTime>2018-03-12T11:28:08.3453727-04:00</DestTime>
<Importer>WavImporter</Importer>
<ImporterTime>2017-03-01T10:05:36-05:00</ImporterTime>
<Processor>SoundEffectProcessor</Processor>
<ProcessorTime>2017-03-01T10:05:36-05:00</ProcessorTime>
<Parameters>
<Key>Quality</Key>
<Value>Best</Value>
</Parameters>
<Dependencies />
<BuildAsset />
<BuildOutput />
</PipelineBuildEvent>

View file

@ -0,0 +1,399 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Plex.Engine.GraphicsSubsystem;
using Microsoft.Xna.Framework.Input.Touch;
using System;
using Plex.Engine;
using Microsoft.Xna.Framework.Audio;
namespace WatercolorGames.Pong
{
/// <summary>
/// This is the main type for your game.
/// </summary>
public class Game1 : Game
{
private SpriteFont _scoreFont = null;
private SpriteFont _timeLeftFont = null;
private SpriteFont _bodyFont = null;
private double _timeLeftSeconds = 60;
private int _level = 1;
private long _codepoints = 0;
private SoundEffect _typesound = null;
private SoundEffect _writesound = null;
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
private float _playerPaddleY = 0.5F;
private float _cpuPaddleY = 0.5F;
private float _ballX = 0.5F;
private float _ballY = 0.5F;
private const float _paddleHeight = 0.15F;
private const float _paddleWidth = 0.05F;
private const float _ballSize = 0.1F;
private const float _ballSizeLandscape = 0.05F;
private Rectangle _ballRect = new Rectangle();
private Rectangle _playerRect = new Rectangle();
private Rectangle _cpuRect = new Rectangle();
private const long _cpLevelBeatReward = 1;
private const long _cpCpuBeatReward = 2;
private string _countdownHead = "Countdown header";
private string _countdownDesc = "Countdown description";
private double _countdown = 3;
private const float _paddleHeightLandscape = 0.20F;
private const float _paddleWidthLandscape = 0.025F;
private float _ballVelYStart = 0.0025F;
private float _ballVelX = 0.0025F;
private float _ballVelY = -0.0025F;
private float _cpuSpeed = 0.5F;
private int _gameState = 0;
private double _countdownBeepTimer = 0;
private bool _isLandscape = false;
private GraphicsContext _gfx = null;
private Activity1 _activity = null;
public Game1(Activity1 activity)
{
_activity = activity;
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.IsFullScreen = true;
graphics.SupportedOrientations = DisplayOrientation.Portrait | DisplayOrientation.PortraitDown | DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
}
/// <summary>
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
/// </summary>
protected override void Initialize()
{
// TODO: Add your initialization logic here
base.Initialize();
}
/// <summary>
/// LoadContent will be called once per game and is the place to load
/// all of your content.
/// </summary>
protected override void LoadContent()
{
// Create a new SpriteBatch, which can be used to draw textures.
spriteBatch = new SpriteBatch(GraphicsDevice);
_gfx = new GraphicsContext(GraphicsDevice, spriteBatch, 0, 0, GraphicsDevice.PresentationParameters.BackBufferWidth, GraphicsDevice.PresentationParameters.BackBufferHeight);
_bodyFont = Content.Load<SpriteFont>("Fonts/MainBody");
_timeLeftFont = Content.Load<SpriteFont>("Fonts/TimeLeft");
_scoreFont = Content.Load<SpriteFont>("Fonts/Score");
_typesound = Content.Load<SoundEffect>("SFX/typesound");
_writesound = Content.Load<SoundEffect>("SFX/writesound");
// TODO: use this.Content to load your game content here
}
/// <summary>
/// UnloadContent will be called once per game and is the place to unload
/// game-specific content.
/// </summary>
protected override void UnloadContent()
{
// TODO: Unload any non ContentManager content here
}
private int _frames = 0;
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Update(GameTime gameTime)
{
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
Exit();
//In case the player rotates their screen...
_gfx.Width = GraphicsDevice.PresentationParameters.BackBufferWidth;
_gfx.Height = GraphicsDevice.PresentationParameters.BackBufferHeight;
//Now we need to figure out if we're landscape or not.
_isLandscape = GraphicsDevice.PresentationParameters.DisplayOrientation == DisplayOrientation.LandscapeLeft || GraphicsDevice.PresentationParameters.DisplayOrientation == DisplayOrientation.LandscapeLeft;
switch (_gameState)
{
case 0: //intro
foreach(var touch in TouchPanel.GetState())
{
if(touch.State == TouchLocationState.Released)
{
_countdownHead = "Ready to play?";
_countdownDesc = $"Level {_level} - you can earn:\n\n{_cpCpuBeatReward * _level} CP for beating the computer.\n{_cpLevelBeatReward * _level} CP for surviving.";
_gameState = 2;
break;
}
}
break;
case 1: //In-game.
_frames++;
TouchLocation previous = default(TouchLocation);
foreach (var touch in TouchPanel.GetState())
{
if (!touch.TryGetPreviousLocation(out previous))
continue;
var delta = previous.Position - touch.Position;
_playerPaddleY -= (delta.Y / _gfx.Width);
}
float ballSize = (_isLandscape) ? _ballSizeLandscape : _ballSize;
float paddleSize = (_isLandscape) ? _paddleWidthLandscape : _paddleWidth;
float paddleHeight = (_isLandscape) ? _paddleHeightLandscape : _paddleHeight;
_ballRect.Width = (int)Math.Round(MathHelper.Lerp(0, _gfx.Width, ballSize));
_ballRect.Height = (int)Math.Round(MathHelper.Lerp(0, _gfx.Height, ballSize));
_ballRect.X = (int)Math.Round(MathHelper.Lerp(0, _gfx.Width, _ballX - (ballSize / 2)));
_ballRect.Y = (int)MathHelper.Clamp((float)Math.Round(MathHelper.Lerp(0, _gfx.Height, _ballY - (ballSize / 2))), 0, _gfx.Height);
_playerRect.Width = (int)MathHelper.Lerp(0, _gfx.Width, paddleSize);
_playerRect.Height = (int)MathHelper.Lerp(0, _gfx.Height, paddleHeight);
_cpuRect.Width = _playerRect.Width;
_cpuRect.Height = _playerRect.Height;
float screenMarginX = 0.01f;
_playerRect.X = (int)MathHelper.Lerp(0, _gfx.Width, screenMarginX);
_cpuRect.X = (int)MathHelper.Lerp(0, _gfx.Width, (1F - screenMarginX) - paddleSize);
_playerRect.Y = (int)MathHelper.Lerp(0, _gfx.Height, _playerPaddleY - (paddleHeight / 2));
_cpuRect.Y = (int)MathHelper.Lerp(0, _gfx.Height, _cpuPaddleY - (paddleHeight / 2));
if (_ballRect.Top <= 0)
{
_ballY = ballSize / 2;
_ballVelY = -_ballVelY;
}
if (_ballRect.Bottom >= _gfx.Height)
{
_ballY = 1f - (ballSize / 2F);
_ballVelY = -_ballVelY;
}
if (_cpuRect.Intersects(_ballRect))
{
float ballInPaddle = _ballY - (_cpuPaddleY - (paddleHeight / 2));
float hitLocationPercentage = ballInPaddle / paddleHeight;
_ballVelX = -_ballVelX;
_ballVelY = MathHelper.Lerp(-_ballVelYStart, _ballVelYStart, hitLocationPercentage);
_typesound.Play();
}
if (_playerRect.Intersects(_ballRect))
{
float ballInPaddle = _ballY - (_playerPaddleY - (paddleHeight / 2));
float hitLocationPercentage = ballInPaddle / paddleHeight;
_ballX = screenMarginX + paddleSize + (ballSize / 2);
_ballVelX = -_ballVelX;
_ballVelY = MathHelper.Lerp(-_ballVelYStart, _ballVelYStart, hitLocationPercentage);
_typesound.Play();
}
if (_ballRect.Left >= _gfx.Width)
{
_ballX = 0.85F;
_ballY = 0.5F;
_codepoints += (_cpCpuBeatReward * _level);
_ballVelX = -_ballVelX;
_countdownHead = "You Beat the Computer!";
_countdownDesc = $"{_cpCpuBeatReward * _level} Codepoints rewarded.";
_gameState++;
}
if (_ballRect.Right <= 0)
{
_ballX = 0.5F;
_ballY = 0.5F;
_ballVelX = 0.0025F;
_ballVelY = 0.0025F;
_ballVelYStart = 0.0025F;
_playerPaddleY = 0.5F;
_cpuPaddleY = 0.5F;
_countdownHead = "You Lost!";
_countdownDesc = $"You missed out on {_codepoints} Codepoints!";
_codepoints = 0;
_timeLeftSeconds = 60;
_level = 1;
_gameState++;
return;
}
_ballX += _ballVelX;
_ballY += _ballVelY;
_timeLeftSeconds -= gameTime.ElapsedGameTime.TotalSeconds;
if(_timeLeftSeconds < 0)
{
_timeLeftSeconds = 60;
_ballVelYStart *= 2;
_ballVelX *= 2;
_codepoints += _cpLevelBeatReward * _level;
_countdownHead = $"Level {_level} Complete";
_level++;
_countdownDesc = $"Now on Level {_level} - you can earn:\n\n{_cpCpuBeatReward * _level} CP for beating the computer.\n{_cpLevelBeatReward * _level} CP for surviving.";
_gameState++;
}
if (_frames >= 7)
{
_frames = 0;
return;
}
if (_cpuPaddleY > _ballY)
{
_cpuPaddleY -= (_ballVelYStart * _cpuSpeed);
}
else if (_cpuPaddleY < _ballY)
{
_cpuPaddleY += (_ballVelYStart * _cpuSpeed);
}
_playerPaddleY = MathHelper.Clamp(_playerPaddleY, paddleHeight / 2, 1 - (paddleHeight / 2));
break;
case 2: //Countdown.
_countdownBeepTimer += gameTime.ElapsedGameTime.TotalSeconds;
if(_countdownBeepTimer>=1)
{
_writesound.Play();
_countdownBeepTimer = 0;
}
_countdown -= gameTime.ElapsedGameTime.TotalSeconds;
if(_countdown < 0)
{
_gameState--;
_countdown = 3;
}
break;
}
base.Update(gameTime);
}
/// <summary>
/// This is called when the game should draw itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
protected override void Draw(GameTime gameTime)
{
_gfx.Device.Clear(Color.Black);
_gfx.BeginDraw();
switch (_gameState)
{
case 0:
string welcome = _activity.ApplicationContext.Resources.GetString(Resource.String.WelcomeToPong);
var measure = TextRenderer.MeasureText(welcome, _bodyFont, (int)(_gfx.Width / 1.25), WrapMode.Words);
_gfx.DrawString(welcome, (_gfx.Width - (int)(_gfx.Width / 1.25)) / 2, (_gfx.Height - (int)measure.Y) / 2, Color.White, _bodyFont, TextAlignment.Center, (int)(_gfx.Width / 1.25), WrapMode.Words);
break;
case 1:
//Draw the two paddles.
_gfx.DrawRectangle(_playerRect.X, _playerRect.Y, _playerRect.Width, _playerRect.Height, Color.White);
_gfx.DrawRectangle(_cpuRect.X, _cpuRect.Y, _cpuRect.Width, _cpuRect.Height, Color.White);
//Draw the ball.
_gfx.DrawCircle(_ballRect.X + (_ballRect.Width / 2), _ballRect.Y + (_ballRect.Width / 2), _ballRect.Width / 2, Color.White);
break;
case 2:
var headMeasure = TextRenderer.MeasureText(_countdownHead, _bodyFont, (int)(_gfx.Width / 1.25), WrapMode.Words);
_gfx.DrawString(_countdownHead, (_gfx.Width - (int)(_gfx.Width / 1.25)) / 2, _gfx.Height / 4, Color.White, _bodyFont, TextAlignment.Center, (int)(_gfx.Width / 1.25), WrapMode.Words);
_gfx.DrawString(_countdownDesc, (_gfx.Width - (_gfx.Width/2)) / 2, (_gfx.Height / 4) + (int)headMeasure.Y + 30, Color.White, _scoreFont, TextAlignment.Center, _gfx.Width/2, WrapMode.Words);
string countdownText = Math.Round(_countdown).ToString();
var countdownMeasure = _timeLeftFont.MeasureString(countdownText);
_gfx.Batch.DrawString(_timeLeftFont, countdownText, new Vector2((_gfx.Width - countdownMeasure.X) / 2, (_gfx.Height - countdownMeasure.Y) / 2), Color.White);
break;
}
//Measure the "Seconds Left" counter.
string secondsleft = $"{Math.Round(_timeLeftSeconds)} Seconds Left";
//Render the seconds left counter
_gfx.DrawString(secondsleft, (_gfx.Width - (_gfx.Width / 2)) / 2, 20, Color.White, _timeLeftFont, TextAlignment.Center, _gfx.Width / 2, WrapMode.Words);
//Level text
string level = $"Level: {_level}";
var lMeasure = TextRenderer.MeasureText(level, _scoreFont, 0, WrapMode.None);
//render level text
_gfx.DrawString(level, 20, (_gfx.Height - (int)lMeasure.Y) - 20, Color.White, _scoreFont, TextAlignment.Left, 0, WrapMode.None);
//Codepoints text
string codepoints = $"{_codepoints} Codepoints";
var cMeasure = TextRenderer.MeasureText(codepoints, _scoreFont, 0, WrapMode.None);
//render codepoints text
_gfx.DrawString(codepoints, (_gfx.Width - (int)cMeasure.X)-20, (_gfx.Height - (int)lMeasure.Y) - 20, Color.White, _scoreFont, TextAlignment.Left, 0, WrapMode.None);
_gfx.EndDraw();
base.Draw(gameTime);
}
}
}

View file

@ -0,0 +1,428 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Plex.Engine.GraphicsSubsystem
{
/// <summary>
/// Encapsulates a <see cref="GraphicsDevice"/> and <see cref="SpriteBatch"/> and contains methods for easily rendering various objects using those encapsulated objects. This class cannot be inherited.
/// </summary>
/// <remarks>
/// <para>The <see cref="GraphicsContext"/> class employs scissor testing in all of its draw calls. This makes it so that any data rendering outside the scissor rectangle (defined by the <see cref="X"/>, <see cref="Y"/>, <see cref="Width"/> and <see cref="Height"/> properties) will be clipped and not rendered to the screen.</para>
/// <para>Also, apart from the <see cref="X"/> and <see cref="Y"/> properties of the graphics context, any X/Y coordinate pairs are relative to the coordinates of the scissor rectangle. So, the coordinates (0,5) refer to <see cref="X"/>+0,<see cref="Y"/>+5.</para>
/// </remarks>
/// <seealso cref="RasterizerState.ScissorTestEnable"/>
/// <seealso cref="GraphicsDevice.ScissorRectangle"/>
/// <seealso cref="GraphicsDevice"/>
/// <seealso cref="SpriteBatch"/>
/// <threadsafety static="true" instance="false"/>
public sealed class GraphicsContext
{
private static Texture2D white = null;
/// <summary>
/// Retrieves the sprite batch associated with this graphics context.
/// </summary>
public SpriteBatch Batch
{
get
{
return _spritebatch;
}
}
/// <summary>
/// Retrieves the graphics device associated with this graphics context.
/// </summary>
public GraphicsDevice Device
{
get
{
return _graphicsDevice;
}
}
/// <summary>
/// Gets or sets the X coordinate of the scissor rectangle.
/// </summary>
public int X
{
get
{
return Device.ScissorRectangle.X;
}
set
{
Device.ScissorRectangle = new Rectangle(value, Y, Width, Height);
}
}
/// <summary>
/// Gets or sets the Y coordinate of the scissor rectangle.
/// </summary>
public int Y
{
get
{
return Device.ScissorRectangle.Y;
}
set
{
Device.ScissorRectangle = new Rectangle(X, value, Width, Height);
}
}
/// <summary>
/// Gets or sets the width of the scissor rectangle.
/// </summary>
public int Width
{
get
{
return Device.ScissorRectangle.Width;
}
set
{
Device.ScissorRectangle = new Rectangle(X, Y, value, Height);
}
}
/// <summary>
/// Gets or sets the height of the scissor rectangle.
/// </summary>
public int Height
{
get
{
return Device.ScissorRectangle.Height;
}
set
{
Device.ScissorRectangle = new Rectangle(X, Y, Width, value);
}
}
/// <summary>
/// Draw an outlined polygon.
/// </summary>
/// <param name="c">The color of the polygon's outlines</param>
/// <param name="locs">The various X and Y coordinates relative to the scissor rectangle of the polygon. The size of this array must be a multiple of 2.</param>
/// <exception cref="Exception">The <paramref name="locs"/> array does not have a length which is a multiple of 2.</exception>
public void DrawPolygon(Color c, params int[] locs)
{
if ((locs.Length % 2) != 0)
throw new Exception("The locs argument count must be a multiple of 2.");
for(int i = 0; i < locs.Length; i+= 2)
{
int x = locs[i];
int y = locs[i + 1];
int x1 = locs[0];
int y1 = locs[1];
if (i < locs.Length - 2)
{
x1 = locs[i + 2];
y1 = locs[i + 3];
}
DrawLine(x, y, x1, y1, 1, c);
}
}
private GraphicsDevice _graphicsDevice;
private SpriteBatch _spritebatch;
/// <summary>
/// Creates a new instance of the <see cref="GraphicsContext"/> class.
/// </summary>
/// <param name="device">The graphics device where rendering will take place.</param>
/// <param name="batch">The sprite batch to associate with the graphics context.</param>
/// <param name="x">The starting X coordinate of the scissor rectangle.</param>
/// <param name="y">The starting Y coordinate of the scissor rectangle.</param>
/// <param name="width">The starting width of the scissor rectangle.</param>
/// <param name="height">The starting height of the scissor rectangle.</param>
public GraphicsContext(GraphicsDevice device, SpriteBatch batch, int x, int y, int width, int height)
{
if (device == null || batch == null)
throw new ArgumentNullException();
_graphicsDevice = device;
_spritebatch = batch;
if(white == null)
{
white = new Texture2D(_graphicsDevice, 1, 1);
white.SetData<byte>(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF });
}
Width = width;
Height = height;
X = x;
Y = y;
}
/// <summary>
/// Clears the canvas with the specified color.
/// </summary>
/// <param name="c">The color to render</param>
public void Clear(Color c)
{
DrawRectangle(0, 0, Width, Height, c);
}
/// <summary>
/// Draw a line between two separate points on the canvas
/// </summary>
/// <param name="x">The X coordinate of the first point</param>
/// <param name="y">The Y coordinate of the first point</param>
/// <param name="x1">The X coordinate of the second point</param>
/// <param name="y1">The Y coordinate of the second point</param>
/// <param name="thickness">The thickness of the line</param>
/// <param name="tex2">The line's texture</param>
public void DrawLine(int x, int y, int x1, int y1, int thickness, Texture2D tex2)
{
DrawLine(x, y, x1, y1, thickness, tex2, Color.White);
}
/// <summary>
/// Draw a line with a tint between two separate points on the canvas
/// </summary>
/// <param name="x">The X coordinate of the first point</param>
/// <param name="y">The Y coordinate of the first point</param>
/// <param name="x1">The X coordinate of the second point</param>
/// <param name="y1">The Y coordinate of the second point</param>
/// <param name="thickness">The thickness of the line</param>
/// <param name="tex2">The line's texture</param>
/// <param name="tint">The tint of the texture</param>
public void DrawLine(int x, int y, int x1, int y1, int thickness, Texture2D tex2, Color tint)
{
if (tint.A == 0)
return; //no sense rendering if you CAN'T SEE IT
x += X;
y += Y;
x1 += X;
y1 += Y;
int distance = (int)Vector2.Distance(new Vector2(x, y), new Vector2(x1, y1));
float rotation = GetRotation(x, y, x1, y1);
_spritebatch.Draw(tex2, new Rectangle(x, y, distance, thickness), null, tint, rotation, Vector2.Zero, SpriteEffects.None, 0);
}
/// <summary>
/// Draw a line with a tint between two separate points on the canvas
/// </summary>
/// <param name="x">The X coordinate of the first point</param>
/// <param name="y">The Y coordinate of the first point</param>
/// <param name="x1">The X coordinate of the second point</param>
/// <param name="y1">The Y coordinate of the second point</param>
/// <param name="thickness">The thickness of the line</param>
/// <param name="color">The color of the line</param>
public void DrawLine(int x, int y, int x1, int y1, int thickness, Color color)
{
if (color.A == 0)
return; //no sense rendering if you CAN'T SEE IT
x += X;
y += Y;
x1 += X;
y1 += Y;
int distance = (int)Vector2.Distance(new Vector2(x, y), new Vector2(x1, y1));
float rotation = GetRotation(x, y, x1, y1);
_spritebatch.Draw(white, new Rectangle(x, y, distance, thickness), null, color, rotation, Vector2.Zero, SpriteEffects.None, 0);
}
/// <summary>
/// Draw a rectangle with the specified color to the canvas.
/// </summary>
/// <param name="x">The X coordinate of the rectangle</param>
/// <param name="y">The Y coordinate of the rectangle</param>
/// <param name="width">The width of the rectangle</param>
/// <param name="height">The height of the rectangle</param>
/// <param name="color">The color of the rectangle</param>
public void DrawRectangle(int x, int y, int width, int height, Color color)
{
if (color.A == 0)
return; //no sense rendering if you CAN'T SEE IT
x += X;
y += Y;
_spritebatch.Draw(white, new Rectangle(x, y, width, height), color);
}
/// <summary>
/// Begin a draw call.
/// </summary>
public void BeginDraw()
{
_spritebatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend,
SamplerState.LinearClamp, Device.DepthStencilState,
RasterizerState);
}
/// <summary>
/// End the current draw call.
/// </summary>
public void EndDraw()
{
_spritebatch.End();
}
/// <summary>
/// Draw a circle to the canvas.
/// </summary>
/// <param name="x">The X coordinate of the circle</param>
/// <param name="y">The Y coordinate of the circle</param>
/// <param name="radius">The radius of the circle</param>
/// <param name="color">The color of the circle</param>
public void DrawCircle(int x, int y, int radius, Color color)
{
if (color.A == 0)
return; //no sense rendering if you CAN'T SEE IT
float step = (float) Math.PI / (radius * 4);
var rect = new Rectangle(x, y, radius, 1);
for (float theta = 0; theta < 2 * Math.PI; theta += step)
_spritebatch.Draw(white, rect, null, color, theta, Vector2.Zero, SpriteEffects.None, 0);
}
/// <summary>
/// Draw a rectangle with the specified texture and tint to the canvas.
/// </summary>
/// <param name="x">The X coordinate of the rectangle</param>
/// <param name="y">The Y coordinate of the rectangle</param>
/// <param name="width">The width of the rectangle</param>
/// <param name="height">The height of the rectangle</param>
/// <param name="tex2">The texture of the rectangle</param>
/// <param name="layout">The tint of the rectangle</param>
public void DrawRectangle(int x, int y, int width, int height, Texture2D tex2, ImageLayout layout = ImageLayout.Stretch)
{
DrawRectangle(x, y, width, height, tex2, Color.White, layout);
}
/// <summary>
/// Retrieves a new <see cref="RasterizerState"/> preferred to be used by the graphics context.
/// </summary>
public readonly RasterizerState RasterizerState = new RasterizerState { ScissorTestEnable = true, MultiSampleAntiAlias = true };
/// <summary>
/// Draw a rectangle with the specified texture, tint and <see cref="System.Windows.Forms.ImageLayout"/> to the canvas.
/// </summary>
/// <param name="x">The X coordinate of the rectangle</param>
/// <param name="y">The Y coordinate of the rectangle</param>
/// <param name="width">The width of the rectangle</param>
/// <param name="height">The height of the rectangle</param>
/// <param name="tex2">The texture of the rectangle</param>
/// <param name="tint">The tint of the texture</param>
/// <param name="layout">The layout of the texture</param>
/// <param name="opaque">Whether the rectangle should be opaque regardless of the texture data or tint's alpha value.</param>
/// <param name="premultiplied">Whether the texture data is already pre-multiplied.</param>
public void DrawRectangle(int x, int y, int width, int height, Texture2D tex2, Color tint, ImageLayout layout = ImageLayout.Stretch, bool opaque = false, bool premultiplied=true)
{
if (tint.A == 0)
return; //no sense rendering if you CAN'T SEE IT
if (tex2 == null)
return;
x += X;
y += Y;
_spritebatch.End();
var state = SamplerState.LinearClamp;
if (layout == ImageLayout.Tile)
state = SamplerState.LinearWrap;
if (opaque)
{
_spritebatch.Begin(SpriteSortMode.Immediate, BlendState.Opaque,
state, Device.DepthStencilState,
RasterizerState);
}
else
{
if (premultiplied)
{
_spritebatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend,
state, Device.DepthStencilState,
RasterizerState);
}
else
{
_spritebatch.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied,
state, Device.DepthStencilState,
RasterizerState);
}
}
switch (layout)
{
case ImageLayout.Tile:
_spritebatch.Draw(tex2, new Vector2(x,y), new Rectangle(0, 0, width, height), Color.White, 0, Vector2.Zero, 1f, SpriteEffects.None, 0);
break;
case ImageLayout.Stretch:
_spritebatch.Draw(tex2, new Rectangle(x, y, width, height), tint);
break;
case ImageLayout.None:
_spritebatch.Draw(tex2, new Rectangle(x, y, tex2.Width, tex2.Height), tint);
break;
case ImageLayout.Center:
_spritebatch.Draw(tex2, new Rectangle(x+((width - tex2.Width) / 2), y+((height - tex2.Height) / 2), tex2.Width, tex2.Height), tint);
break;
case ImageLayout.Zoom:
float scale = Math.Min(width / (float)tex2.Width, height / (float)tex2.Height);
var scaleWidth = (int)(tex2.Width * scale);
var scaleHeight = (int)(tex2.Height * scale);
_spritebatch.Draw(tex2, new Rectangle(x+(((int)width - scaleWidth) / 2), y+(((int)height - scaleHeight) / 2), scaleWidth, scaleHeight), tint);
break;
;
}
_spritebatch.End();
BeginDraw();
}
/// <summary>
/// Measure a string. Note that this method is a stub and just calls <see cref="TextRenderer.MeasureText(string, System.Drawing.Font, int, TextAlignment, WrapMode)"/>. This stub will be removed soon.
/// </summary>
/// <param name="text">The text to measure</param>
/// <param name="font">The font to measure with</param>
/// <param name="wrapWidth">The maximum width text can be before it is wrapped</param>
/// <param name="wrapMode">The wrap mode of the text</param>
/// <returns>The size of the text in pixels</returns>
public static Vector2 MeasureString(string text, SpriteFont font, int wrapWidth = int.MaxValue, WrapMode wrapMode = WrapMode.Words)
{
return TextRenderer.MeasureText(text, font, wrapWidth, wrapMode);
}
/// <summary>
/// Draw a string of text.
/// </summary>
/// <param name="text">The text to render</param>
/// <param name="x">The X coordinate of the text</param>
/// <param name="y">The Y coordinate of the text</param>
/// <param name="color">The color of the text</param>
/// <param name="font">The font of the text</param>
/// <param name="alignment">The alignment of the text</param>
/// <param name="wrapWidth">The maximum width text can be before it is wrapped.</param>
/// <param name="wrapMode">The wrap mode of the text</param>
public void DrawString(string text, int x, int y, Color color, SpriteFont font, TextAlignment alignment, int wrapWidth = int.MaxValue, WrapMode wrapMode = WrapMode.Words)
{
x += X;
y += Y;
if (color.A == 0)
return; //no sense rendering if you CAN'T SEE IT
if (string.IsNullOrEmpty(text))
return;
TextRenderer.DrawText(this, x, y, text, font, color, wrapWidth, alignment, wrapMode);
}
private float GetRotation(float x, float y, float x2, float y2)
{
float adj = x - x2;
float opp = y - y2;
return (float) Math.Atan2(opp, adj) - (float) Math.PI;
}
}
public enum ImageLayout
{
Tile,
Stretch,
None,
Zoom,
Center
}
}

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="WatercolorGames.Pong" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<uses-sdk android:minSdkVersion="23" />
<application android:label="WatercolorGames.Pong"></application>
</manifest>

View file

@ -0,0 +1,41 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WatercolorGames.Pong")]
[assembly: AssemblyProduct("WatercolorGames.Pong")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("35d5f325-e46a-410b-ab70-1b9accd0b118")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
// Add some common permissions, these can be removed if not needed
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]

View file

@ -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.xml),
an internationalization string table (Strings.xml) and some icons (drawable/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, the build action should be set
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
"Resource" that contains the tokens for each one of the resources included. For example,
for the above Resources layout, this is what the Resource class would expose:
public class Resource {
public class Drawable {
public const int Icon = 0x123;
}
public class Layout {
public const int Main = 0x456;
}
public class String {
public const int FirstString = 0xabc;
public const int SecondString = 0xbcd;
}
}
You would then use Resource.Drawable.Icon to reference the Drawable/Icon.png file, or
Resource.Layout.Main to reference the Layout/Main.axml file, or Resource.String.FirstString
to reference the first string in the dictionary file Values/Strings.xml.

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View file

@ -0,0 +1,102 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: global::Android.Runtime.ResourceDesignerAttribute("WatercolorGames.Pong.Resource", IsApplication=true)]
namespace WatercolorGames.Pong
{
[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 Icon = 2130837504;
// aapt resource value: 0x7f020001
public const int Splash = 2130837505;
static Drawable()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Drawable()
{
}
}
public partial class String
{
// aapt resource value: 0x7f030001
public const int ApplicationName = 2130903041;
// aapt resource value: 0x7f030000
public const int Hello = 2130903040;
// aapt resource value: 0x7f030002
public const int WelcomeToPong = 2130903042;
static String()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private String()
{
}
}
public partial class Style
{
// aapt resource value: 0x7f040000
public const int Theme_Splash = 2130968576;
static Style()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Style()
{
}
}
}
}
#pragma warning restore 1591

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="Hello">Hello World, Click Me!</string>
<string name="ApplicationName">ShiftOS Pong</string>
<string name="WelcomeToPong">Welcome to ShiftOS Pong.\n\nShiftOS was a game made by Philip Adams where the goal was to upgrade an experimental operating system using "Codepoints" to one usable as a daily driver.\n\nOne of the upgrades you could buy with Codepoints was a special version of the classic arcade game "Pong". This is that game.\n\nThe goal is simple - earn as many Codepoints as you can by beating the computer or surviving the level. Each level lasts one minute, and the higher the level, the more Codepoints you can earn - but the harder the game will get. Losing the ball will end your run!\n\nTap your screen to start playing.</string>
</resources>

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Splash" parent="android:Theme">
<item name="android:windowBackground">@drawable/splash</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources>

View file

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{235981A1-6BC1-428D-8882-7A0373D3FED4}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WatercolorGames.Pong</RootNamespace>
<AssemblyName>WatercolorGames.Pong</AssemblyName>
<FileAlignment>512</FileAlignment>
<AndroidApplication>true</AndroidApplication>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidSupportedAbis>armeabi-v7a%3bx86</AndroidSupportedAbis>
<AndroidStoreUncompressedFileExtensions>.m4a</AndroidStoreUncompressedFileExtensions>
<MandroidI18n />
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
<MonoGamePlatform>Android</MonoGamePlatform>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
<DefineConstants>DEBUG;TRACE;ANDROID</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>true</AndroidUseSharedRuntime>
<AndroidLinkMode>Full</AndroidLinkMode>
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
<BundleAssemblies>false</BundleAssemblies>
<AndroidCreatePackagePerAbi>false</AndroidCreatePackagePerAbi>
<EmbedAssembliesIntoApk>false</EmbedAssembliesIntoApk>
<AndroidSupportedAbis>armeabi;armeabi-v7a;x86;x86_64</AndroidSupportedAbis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
<DefineConstants>TRACE;ANDROID</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="mscorlib" />
<Reference Include="OpenTK-1.0" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
<Reference Include="MonoGame.Framework">
<HintPath>$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\Android\MonoGame.Framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Activity1.cs" />
<Compile Include="ATextRenderer.cs" />
<Compile Include="Game1.cs" />
<Compile Include="GraphicsContext.cs" />
<Compile Include="Resources\Resource.Designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\Values\Strings.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\Drawable\Icon.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\Layout\" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\Drawable\Splash.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\Values\Styles.xml" />
</ItemGroup>
<ItemGroup>
<MonoGameContentReference Include="Content\Content.mgcb" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\AndroidManifest.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{235981A1-6BC1-428D-8882-7A0373D3FED4}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WatercolorGames.Pong</RootNamespace>
<AssemblyName>WatercolorGames.Pong</AssemblyName>
<FileAlignment>512</FileAlignment>
<AndroidApplication>true</AndroidApplication>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidSupportedAbis>armeabi-v7a%3bx86</AndroidSupportedAbis>
<AndroidStoreUncompressedFileExtensions>.m4a</AndroidStoreUncompressedFileExtensions>
<MandroidI18n />
<TargetFrameworkVersion>v4.4</TargetFrameworkVersion>
<MonoGamePlatform>Android</MonoGamePlatform>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
<DefineConstants>DEBUG;TRACE;ANDROID</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
<AndroidLinkMode>None</AndroidLinkMode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\$(MonoGamePlatform)\$(Platform)\$(Configuration)\</OutputPath>
<DefineConstants>TRACE;ANDROID</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="mscorlib" />
<Reference Include="OpenTK-1.0" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
<Reference Include="MonoGame.Framework">
<HintPath>$(MonoGameInstallDirectory)\MonoGame\v3.0\Assemblies\Android\MonoGame.Framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Activity1.cs" />
<Compile Include="Game1.cs" />
<Compile Include="Resources\Resource.Designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\Values\Strings.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\Drawable\Icon.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\Layout\" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\Drawable\Splash.png" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\Values\Styles.xml" />
</ItemGroup>
<ItemGroup>
<MonoGameContentReference Include="Content\Content.mgcb" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SelectedDevice>LGE LG-H831</SelectedDevice>
<DefaultDevice>Android_Accelerated_x86_Nougat</DefaultDevice>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
DebugAnyCPU-s LGH83128e779a2

View file

View file

@ -0,0 +1 @@
097d4ff40ff596598d575b60df0f566f64384062

View file

@ -0,0 +1,59 @@
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\WatercolorGames.Pong.dll
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\WatercolorGames.Pong.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\WatercolorGames.Pong.apk
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\WatercolorGames.Pong-Signed.apk
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\MonoGame.Framework.dll
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\MonoGame.Framework.xml
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\WatercolorGames.Pong.csproj.CoreCompileInputs.cache
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\WatercolorGames.Pong.csproj.CopyComplete
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\WatercolorGames.Pong.dll
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\WatercolorGames.Pong.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\bin\WatercolorGames.Pong.apk
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\res\values\strings.xml
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\res\drawable\icon.png
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\res\drawable\splash.png
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\res\values\styles.xml
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\R.cs.flag
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\uploadflags.txt
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\Mono.Android.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\mscorlib.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\OpenTK-1.0.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\System.Core.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\System.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\System.Xml.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\System.Xml.Linq.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\System.Net.Http.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\System.Runtime.Serialization.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\System.ServiceModel.Internals.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\Mono.Security.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\System.ComponentModel.Composition.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\Mono.Android.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\mscorlib.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\OpenTK-1.0.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\System.Core.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\System.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\System.Xml.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\System.Xml.Linq.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\System.Net.Http.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\System.Runtime.Serialization.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\System.ServiceModel.Internals.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\Mono.Security.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\System.ComponentModel.Composition.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\WatercolorGames.Pong.dll.mdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\WatercolorGames.Pong.dll.mdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\WatercolorGames.Pong.dll.mdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\Mono.Android.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\Mono.Security.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\mscorlib.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\OpenTK-1.0.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\System.ComponentModel.Composition.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\System.Core.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\System.Net.Http.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\System.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\System.Runtime.Serialization.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\System.ServiceModel.Internals.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\System.Xml.Linq.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\android\assets\System.Xml.pdb
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\WatercolorGames.Pong.csprojResolveAssemblyReference.cache
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\bin\Android\AnyCPU\Debug\WatercolorGames.Pong.dll
C:\Users\Michael\source\repos\WatercolorGames.Pong\WatercolorGames.Pong\obj\Debug\linksrc\WatercolorGames.Pong.dll.mdb

View file

@ -0,0 +1,20 @@
WatercolorGames.Pong.Activity1, WatercolorGames.Pong;md5ba40d894fac23818a7eeecdb5217ef4b.Activity1
WatercolorGames.Pong.Activity1, WatercolorGames.Pong, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null;md5ba40d894fac23818a7eeecdb5217ef4b.Activity1
WatercolorGames.Pong.Activity1;md5ba40d894fac23818a7eeecdb5217ef4b.Activity1
watercolorgames.pong.Activity1;md5ba40d894fac23818a7eeecdb5217ef4b.Activity1
Microsoft.Xna.Framework.AndroidGameActivity, MonoGame.Framework;md59e336b20c5f59a4196ec0611a339f132.AndroidGameActivity
Microsoft.Xna.Framework.AndroidGameActivity, MonoGame.Framework, Version=3.6.0.1625, Culture=neutral, PublicKeyToken=null;md59e336b20c5f59a4196ec0611a339f132.AndroidGameActivity
Microsoft.Xna.Framework.AndroidGameActivity;md59e336b20c5f59a4196ec0611a339f132.AndroidGameActivity
microsoft.xna.framework.AndroidGameActivity;md59e336b20c5f59a4196ec0611a339f132.AndroidGameActivity
Microsoft.Xna.Framework.MonoGameAndroidGameView, MonoGame.Framework;md59e336b20c5f59a4196ec0611a339f132.MonoGameAndroidGameView
Microsoft.Xna.Framework.MonoGameAndroidGameView, MonoGame.Framework, Version=3.6.0.1625, Culture=neutral, PublicKeyToken=null;md59e336b20c5f59a4196ec0611a339f132.MonoGameAndroidGameView
Microsoft.Xna.Framework.MonoGameAndroidGameView;md59e336b20c5f59a4196ec0611a339f132.MonoGameAndroidGameView
microsoft.xna.framework.MonoGameAndroidGameView;md59e336b20c5f59a4196ec0611a339f132.MonoGameAndroidGameView
Microsoft.Xna.Framework.OrientationListener, MonoGame.Framework;md59e336b20c5f59a4196ec0611a339f132.OrientationListener
Microsoft.Xna.Framework.OrientationListener, MonoGame.Framework, Version=3.6.0.1625, Culture=neutral, PublicKeyToken=null;md59e336b20c5f59a4196ec0611a339f132.OrientationListener
Microsoft.Xna.Framework.OrientationListener;md59e336b20c5f59a4196ec0611a339f132.OrientationListener
microsoft.xna.framework.OrientationListener;md59e336b20c5f59a4196ec0611a339f132.OrientationListener
Microsoft.Xna.Framework.ScreenReceiver, MonoGame.Framework;md59e336b20c5f59a4196ec0611a339f132.ScreenReceiver
Microsoft.Xna.Framework.ScreenReceiver, MonoGame.Framework, Version=3.6.0.1625, Culture=neutral, PublicKeyToken=null;md59e336b20c5f59a4196ec0611a339f132.ScreenReceiver
Microsoft.Xna.Framework.ScreenReceiver;md59e336b20c5f59a4196ec0611a339f132.ScreenReceiver
microsoft.xna.framework.ScreenReceiver;md59e336b20c5f59a4196ec0611a339f132.ScreenReceiver

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="WatercolorGames.Pong" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<!--suppress UsesMinSdkAttributes-->
<uses-sdk android:minSdkVersion="23" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:label="WatercolorGames.Pong" android:name="android.app.Application" android:allowBackup="true" android:icon="@drawable/icon" android:debuggable="true">
<activity android:alwaysRetainTaskState="true" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:icon="@drawable/icon" android:label="WatercolorGames.Pong" android:launchMode="singleInstance" android:screenOrientation="fullUser" android:theme="@style/Theme.Splash" android:name="md5ba40d894fac23818a7eeecdb5217ef4b.Activity1">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<provider android:name="mono.MonoRuntimeProvider" android:exported="false" android:initOrder="2147483647" android:authorities="WatercolorGames.Pong.mono.MonoRuntimeProvider.__mono_init__" />
<!--suppress ExportedReceiver-->
<receiver android:name="mono.android.Seppuku">
<intent-filter>
<action android:name="mono.android.intent.action.SEPPUKU" />
<category android:name="mono.android.intent.category.SEPPUKU.WatercolorGames.Pong" />
</intent-filter>
</receiver>
</application>
</manifest>

Some files were not shown because too many files have changed in this diff Show more