Skip to content

Commit

Permalink
Added project FlappyNez
Browse files Browse the repository at this point in the history
  • Loading branch information
salvadorbs committed Oct 3, 2016
1 parent 3e56483 commit 8b928a1
Show file tree
Hide file tree
Showing 99 changed files with 1,586 additions and 0 deletions.
966 changes: 966 additions & 0 deletions FlappyNez/Content/Content.mgcb

Large diffs are not rendered by default.

Binary file added FlappyNez/Content/Font/kenvector_future.ttf
Binary file not shown.
Binary file added FlappyNez/Content/Font/kenvector_future_thin.ttf
Binary file not shown.
Binary file added FlappyNez/Content/Letters/letterA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterC.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterD.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterE.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterF.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterH.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterJ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterK.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterM.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterN.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterO.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterP.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterQ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterU.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterV.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterW.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterY.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added FlappyNez/Content/Letters/letterZ.png
Binary file added FlappyNez/Content/Numbers/number0.png
Binary file added FlappyNez/Content/Numbers/number1.png
Binary file added FlappyNez/Content/Numbers/number2.png
Binary file added FlappyNez/Content/Numbers/number3.png
Binary file added FlappyNez/Content/Numbers/number4.png
Binary file added FlappyNez/Content/Numbers/number5.png
Binary file added FlappyNez/Content/Numbers/number6.png
Binary file added FlappyNez/Content/Numbers/number7.png
Binary file added FlappyNez/Content/Numbers/number8.png
Binary file added FlappyNez/Content/Numbers/number9.png
Binary file added FlappyNez/Content/Planes/planeBlue1.png
Binary file added FlappyNez/Content/Planes/planeBlue2.png
Binary file added FlappyNez/Content/Planes/planeBlue3.png
Binary file added FlappyNez/Content/Planes/planeGreen1.png
Binary file added FlappyNez/Content/Planes/planeGreen2.png
Binary file added FlappyNez/Content/Planes/planeGreen3.png
Binary file added FlappyNez/Content/Planes/planeRed1.png
Binary file added FlappyNez/Content/Planes/planeRed2.png
Binary file added FlappyNez/Content/Planes/planeRed3.png
Binary file added FlappyNez/Content/Planes/planeYellow1.png
Binary file added FlappyNez/Content/Planes/planeYellow2.png
Binary file added FlappyNez/Content/Planes/planeYellow3.png
Binary file added FlappyNez/Content/Terrain/background.png
Binary file added FlappyNez/Content/Terrain/groundDirt.png
Binary file added FlappyNez/Content/Terrain/groundGrass.png
Binary file added FlappyNez/Content/Terrain/groundIce.png
Binary file added FlappyNez/Content/Terrain/groundRock.png
Binary file added FlappyNez/Content/Terrain/groundSnow.png
Binary file added FlappyNez/Content/Terrain/puffLarge.png
Binary file added FlappyNez/Content/Terrain/puffSmall.png
Binary file added FlappyNez/Content/Terrain/rock.png
Binary file added FlappyNez/Content/Terrain/rockDown.png
Binary file added FlappyNez/Content/Terrain/rockGrass.png
Binary file added FlappyNez/Content/Terrain/rockGrassDown.png
Binary file added FlappyNez/Content/Terrain/rockIce.png
Binary file added FlappyNez/Content/Terrain/rockIceDown.png
Binary file added FlappyNez/Content/Terrain/rockSnow.png
Binary file added FlappyNez/Content/Terrain/rockSnowDown.png
Binary file added FlappyNez/Content/UI/UIbg.png
Binary file added FlappyNez/Content/UI/buttonLarge.png
Binary file added FlappyNez/Content/UI/buttonSmall.png
Binary file added FlappyNez/Content/UI/medalBronze.png
Binary file added FlappyNez/Content/UI/medalGold.png
Binary file added FlappyNez/Content/UI/medalSilver.png
Binary file added FlappyNez/Content/UI/starBronze.png
Binary file added FlappyNez/Content/UI/starGold.png
Binary file added FlappyNez/Content/UI/starSilver.png
Binary file added FlappyNez/Content/UI/tap.png
Binary file added FlappyNez/Content/UI/tapLeft.png
Binary file added FlappyNez/Content/UI/tapRight.png
Binary file added FlappyNez/Content/UI/tapTick.png
Binary file added FlappyNez/Content/UI/textGameOver.png
Binary file added FlappyNez/Content/UI/textGetReady.png
14 changes: 14 additions & 0 deletions FlappyNez/Content/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

###############################################################################

Tappy Plane by Kenney Vleugels (www.kenney.nl)

------------------------------

License (CC0)
http://creativecommons.org/publicdomain/zero/1.0/

You may use these graphics in personal and commercial projects.
Credit (Kenney or www.kenney.nl) would be nice but is not mandatory.

###############################################################################
Binary file added FlappyNez/Content/preview.png
Binary file added FlappyNez/Content/sample.png
112 changes: 112 additions & 0 deletions FlappyNez/ContentPathGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@



namespace Nez
{
class Content
{
public static class Letters
{
public const string letterA = @"Letters\letterA";
public const string letterB = @"Letters\letterB";
public const string letterC = @"Letters\letterC";
public const string letterD = @"Letters\letterD";
public const string letterE = @"Letters\letterE";
public const string letterF = @"Letters\letterF";
public const string letterG = @"Letters\letterG";
public const string letterH = @"Letters\letterH";
public const string letterI = @"Letters\letterI";
public const string letterJ = @"Letters\letterJ";
public const string letterK = @"Letters\letterK";
public const string letterL = @"Letters\letterL";
public const string letterM = @"Letters\letterM";
public const string letterN = @"Letters\letterN";
public const string letterO = @"Letters\letterO";
public const string letterP = @"Letters\letterP";
public const string letterQ = @"Letters\letterQ";
public const string letterR = @"Letters\letterR";
public const string letterS = @"Letters\letterS";
public const string letterT = @"Letters\letterT";
public const string letterU = @"Letters\letterU";
public const string letterV = @"Letters\letterV";
public const string letterW = @"Letters\letterW";
public const string letterX = @"Letters\letterX";
public const string letterY = @"Letters\letterY";
public const string letterZ = @"Letters\letterZ";
}

public static class Numbers
{
public const string number0 = @"Numbers\number0";
public const string number1 = @"Numbers\number1";
public const string number2 = @"Numbers\number2";
public const string number3 = @"Numbers\number3";
public const string number4 = @"Numbers\number4";
public const string number5 = @"Numbers\number5";
public const string number6 = @"Numbers\number6";
public const string number7 = @"Numbers\number7";
public const string number8 = @"Numbers\number8";
public const string number9 = @"Numbers\number9";
}

public static class Planes
{
public const string planeBlue1 = @"Planes\planeBlue1";
public const string planeBlue2 = @"Planes\planeBlue2";
public const string planeBlue3 = @"Planes\planeBlue3";
public const string planeGreen1 = @"Planes\planeGreen1";
public const string planeGreen2 = @"Planes\planeGreen2";
public const string planeGreen3 = @"Planes\planeGreen3";
public const string planeRed1 = @"Planes\planeRed1";
public const string planeRed2 = @"Planes\planeRed2";
public const string planeRed3 = @"Planes\planeRed3";
public const string planeYellow1 = @"Planes\planeYellow1";
public const string planeYellow2 = @"Planes\planeYellow2";
public const string planeYellow3 = @"Planes\planeYellow3";
}

public static class Terrain
{
public const string background = @"Terrain\background";
public const string groundDirt = @"Terrain\groundDirt";
public const string groundGrass = @"Terrain\groundGrass";
public const string groundIce = @"Terrain\groundIce";
public const string groundRock = @"Terrain\groundRock";
public const string groundSnow = @"Terrain\groundSnow";
public const string puffLarge = @"Terrain\puffLarge";
public const string puffSmall = @"Terrain\puffSmall";
public const string rock = @"Terrain\rock";
public const string rockDown = @"Terrain\rockDown";
public const string rockGrass = @"Terrain\rockGrass";
public const string rockGrassDown = @"Terrain\rockGrassDown";
public const string rockIce = @"Terrain\rockIce";
public const string rockIceDown = @"Terrain\rockIceDown";
public const string rockSnow = @"Terrain\rockSnow";
public const string rockSnowDown = @"Terrain\rockSnowDown";
}

public static class UI
{
public const string buttonLarge = @"UI\buttonLarge";
public const string buttonSmall = @"UI\buttonSmall";
public const string medalBronze = @"UI\medalBronze";
public const string medalGold = @"UI\medalGold";
public const string medalSilver = @"UI\medalSilver";
public const string starBronze = @"UI\starBronze";
public const string starGold = @"UI\starGold";
public const string starSilver = @"UI\starSilver";
public const string tap = @"UI\tap";
public const string tapLeft = @"UI\tapLeft";
public const string tapRight = @"UI\tapRight";
public const string tapTick = @"UI\tapTick";
public const string textGameOver = @"UI\textGameOver";
public const string textGetReady = @"UI\textGetReady";
public const string uIbg = @"UI\UIbg";
}


}
}



125 changes: 125 additions & 0 deletions FlappyNez/ContentPathGenerator.tt
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<#@ template language="C#" hostSpecific="true" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Globalization" #>
<#@ import namespace="System.Text.RegularExpressions" #>

<# var sourceFolders = new string[] { "Content/bin/DesktopGL", "Content" }; #>


namespace Nez
{
class Content
{
<#

// loop through all of our sourceFolders
foreach( var sourceFolder in sourceFolders )
{
var directories = Directory.GetDirectories( Host.ResolvePath( sourceFolder ) );
// loop through all the directories in our sourceFolder
foreach( var dir in directories )
{
var dirName = new DirectoryInfo( dir ).Name.ToLower();
if( dirName == "bin" || dirName == "obj" )
continue;

// dont delve into directories that don't contan xnb files
var xnbFiles = Directory.GetFiles( dir, "*.xnb", SearchOption.AllDirectories );
if( xnbFiles.Length == 0 )
continue;

// start off the recursive directory printing
printDirectoryClass( dir, 2, sourceFolder );
}

// handle any files in the root sourceFolder
printContentFiles( Host.ResolvePath( sourceFolder ), 2, Host.ResolvePath( sourceFolder ) );
}

#>

}
}



<#+
// recursively creates a class for each directory
void printDirectoryClass( string dir, int depth, string sourceFolder )
{
var dirInfo = new DirectoryInfo( dir );
var firstIndent = new string( '\t', depth );
var className = generateClassName( dirInfo.Name, true );
WriteLine( "{0}public static class {1}\n{2}{{", firstIndent, className, firstIndent );

// handle subdirectories
foreach( var subdir in Directory.GetDirectories( dir ) )
printDirectoryClass( subdir, depth + 1, sourceFolder );

// handle files
printContentFiles( dir, depth + 1, sourceFolder );

WriteLine( "{0}}}\n", firstIndent );
}


// prints a const string for each file in the directory
void printContentFiles( string dir, int depth, string sourceFolder )
{
var firstIndent = new string( '\t', depth );

foreach( var file in Directory.GetFiles( dir, "*.xnb" ) )
{
// clear out all of the path up to the sourceFolder so we get just the relative path to the Content folder
var finalPath = file.Substring( file.IndexOf( sourceFolder ) + sourceFolder.Length )
.Replace( ".xnb", string.Empty );
var fileInfo = new FileInfo( file );
var fileName = fileInfo.Name.Replace( ".xnb", string.Empty );
var className = generateClassName( fileName, false );

if( finalPath[0] == '/' || finalPath[0] == '\\' )
finalPath = finalPath.Substring( 1 );

WriteLine( "{0}public const string {1} = @\"{2}\";", firstIndent, className, finalPath );
}
}


string stripInvalidPathChars( string input )
{
var invalidChars = Path.GetInvalidPathChars();
return new string( input.Where( m => !invalidChars.Contains( m ) ).ToArray<char>() );
}


string stripInvalidFilenameChars( string input )
{
var invalidChars = Path.GetInvalidFileNameChars();
return new string( input.Where( m => !invalidChars.Contains( m ) ).ToArray<char>() );
}


// attempts to generate a proper path name
string generateClassName( string className, bool uppercaseFirstChar )
{
// handle upper or lower casing the first char in the className
if( uppercaseFirstChar && char.IsLower( className[0] ) )
className = char.ToUpper( className[0] ) + className.Substring( 1 );
else if( !uppercaseFirstChar && char.IsUpper( className[0] ) )
className = char.ToLower( className[0] ) + className.Substring( 1 );

// remove invalid characters
var regex = new Regex( @"[^\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nd}\p{Nl}\p{Mn}\p{Mc}\p{Cf}\p{Pc}\p{Lm}]" );
className = regex.Replace( className, "" );

// class name doesn't begin with a letter, insert an underscore
if( !char.IsLetter( className, 0 ) )
className = className.Insert( 0, "_" );

return className.Replace( " ", string.Empty );
}
#>
33 changes: 33 additions & 0 deletions FlappyNez/Entities/Plane.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using Microsoft.Xna.Framework;
using Nez;
using Nez.Sprites;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;

namespace FlappyNez.Entities
{
class Plane : Component, ITriggerListener, IUpdatable
{
public override void onAddedToEntity()
{

}

void IUpdatable.update()
{

}

void ITriggerListener.onTriggerEnter(Collider other, Collider self)
{

}


void ITriggerListener.onTriggerExit(Collider other, Collider self)
{

}
}
}
101 changes: 101 additions & 0 deletions FlappyNez/FlappyNez.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" 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)' == '' ">x86</Platform>
<ProjectGuid>{AF7D4E7B-804A-476A-8CF9-DA21521F1827}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>FlappyNez</RootNamespace>
<AssemblyName>FlappyNez</AssemblyName>
<MonoGamePlatform>DesktopGL</MonoGamePlatform>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\DesktopGL\x86\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;LINUX</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\DesktopGL\x86\Release\</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<PlatformTarget>x86</PlatformTarget>
<DefineConstants>TRACE;LINUX</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="MonoGame.Framework, Version=3.5.1.1679, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MonoGame.Framework.DesktopGL.3.5.1.1679\lib\net40\MonoGame.Framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NVorbis, Version=0.8.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MonoGame.Framework.DesktopGL.3.5.1.1679\lib\net40\NVorbis.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="OpenTK, Version=1.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\packages\MonoGame.Framework.DesktopGL.3.5.1.1679\lib\net40\OpenTK.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Compile Include="ContentPathGenerator.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>ContentPathGenerator.tt</DependentUpon>
</Compile>
<Compile Include="Entities\Plane.cs" />
<Compile Include="Game.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Rock.cs" />
<Compile Include="Scenes\Level.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Icon.png" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Icon.ico" />
</ItemGroup>
<ItemGroup>
<MonoGameContentReference Include="Content\Content.mgcb" />
</ItemGroup>
<ItemGroup>
<Content Include="ContentPathGenerator.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>ContentPathGenerator.cs</LastGenOutput>
</Content>
<Content Include="OpenTK.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" />
<ItemGroup>
<ProjectReference Include="..\Nez\Nez-PCL\Nez.csproj">
<Project>{60B7197D-D0D5-405C-90A2-A56903E9B039}</Project>
<Name>Nez</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
</Project>
Loading

0 comments on commit 8b928a1

Please sign in to comment.