diff --git a/AnimationGenerator/AnimationGenerator.csproj b/AnimationGenerator/AnimationGenerator.csproj
new file mode 100644
index 0000000..d249b5e
--- /dev/null
+++ b/AnimationGenerator/AnimationGenerator.csproj
@@ -0,0 +1,70 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {B1938BD7-A474-427F-91F1-F8A1875B28CE}
+ Exe
+ AnimationGenerator
+ AnimationGenerator
+ v4.6.1
+ 512
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ False
+ C:\Program Files (x86)\MonoGame\v3.0\Assemblies\DesktopGL\MonoGame.Framework.dll
+
+
+ C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools\MonoGame.Framework.Content.Pipeline.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {69dadc27-fbeb-4625-9212-6eb5bed5102a}
+ QURO.AnimationLibrary
+
+
+
+
+ PreserveNewest
+
+
+
+
\ No newline at end of file
diff --git a/AnimationGenerator/App.config b/AnimationGenerator/App.config
new file mode 100644
index 0000000..731f6de
--- /dev/null
+++ b/AnimationGenerator/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/AnimationGenerator/Content/boardMap.xml b/AnimationGenerator/Content/boardMap.xml
new file mode 100644
index 0000000..4189def
--- /dev/null
+++ b/AnimationGenerator/Content/boardMap.xml
@@ -0,0 +1,76 @@
+
+
+
+
+ - block00 0 16 16
+
+ - block0_bounce116 0 16 16
+
+ - block0_bounce232 0 16 16
+
+ - block0_flash48 0 16 16
+
+ - block0_pop64 0 16 16
+
+ - block0_squish80 0 16 16
+
+ - block10 16 16 16
+
+ - block1_bounce116 16 16 16
+
+ - block1_bounce232 16 16 16
+
+ - block1_flash48 16 16 16
+
+ - block1_pop64 16 16 16
+
+ - block1_squish80 16 16 16
+
+ - block20 32 16 16
+
+ - block2_bounce116 32 16 16
+
+ - block2_bounce232 32 16 16
+
+ - block2_flash48 32 16 16
+
+ - block2_pop64 32 16 16
+
+ - block2_squish80 32 16 16
+
+ - block30 48 16 16
+
+ - block3_bounce116 48 16 16
+
+ - block3_bounce232 48 16 16
+
+ - block3_flash48 48 16 16
+
+ - block3_pop64 48 16 16
+
+ - block3_squish80 48 16 16
+
+ - block40 64 16 16
+
+ - block4_bounce116 64 16 16
+
+ - block4_bounce232 64 16 16
+
+ - block4_flash48 64 16 16
+
+ - block4_pop64 64 16 16
+
+ - block4_squish80 64 16 16
+
+ - soloCursor16 80 23 23
+
+ - soloCursor_pulse39 80 23 23
+
+ - tiledBG_default0 80 16 16
+
+ - twinCursor0 103 39 23
+
+ - twinCursor_pulse39 103 39 23
+
+
+
\ No newline at end of file
diff --git a/AnimationGenerator/Content/boardMapNames.cs b/AnimationGenerator/Content/boardMapNames.cs
new file mode 100644
index 0000000..95b63b6
--- /dev/null
+++ b/AnimationGenerator/Content/boardMapNames.cs
@@ -0,0 +1,50 @@
+/*
+ * Class auto generated by TexturePacker
+ *
+ * Contains references to each image within the sprite sheet.
+ *
+ * https://www.codeandweb.com/texturepacker
+ * $TexturePacker:SmartUpdate:9c249f83b4f96ec61c8a09e8200742d5:d881ff5ec3da86acaaa577e6ab9bd7aa:05477a09d9d5a6dca0fdadde24fc3000$
+ *
+ */
+namespace TexturePackerSpriteDefinitions
+{
+ public class SpriteNames
+ {
+ public const string Block0 = "block0";
+ public const string Block0_bounce1 = "block0_bounce1";
+ public const string Block0_bounce2 = "block0_bounce2";
+ public const string Block0_flash = "block0_flash";
+ public const string Block0_pop = "block0_pop";
+ public const string Block0_squish = "block0_squish";
+ public const string Block1 = "block1";
+ public const string Block1_bounce1 = "block1_bounce1";
+ public const string Block1_bounce2 = "block1_bounce2";
+ public const string Block1_flash = "block1_flash";
+ public const string Block1_pop = "block1_pop";
+ public const string Block1_squish = "block1_squish";
+ public const string Block2 = "block2";
+ public const string Block2_bounce1 = "block2_bounce1";
+ public const string Block2_bounce2 = "block2_bounce2";
+ public const string Block2_flash = "block2_flash";
+ public const string Block2_pop = "block2_pop";
+ public const string Block2_squish = "block2_squish";
+ public const string Block3 = "block3";
+ public const string Block3_bounce1 = "block3_bounce1";
+ public const string Block3_bounce2 = "block3_bounce2";
+ public const string Block3_flash = "block3_flash";
+ public const string Block3_pop = "block3_pop";
+ public const string Block3_squish = "block3_squish";
+ public const string Block4 = "block4";
+ public const string Block4_bounce1 = "block4_bounce1";
+ public const string Block4_bounce2 = "block4_bounce2";
+ public const string Block4_flash = "block4_flash";
+ public const string Block4_pop = "block4_pop";
+ public const string Block4_squish = "block4_squish";
+ public const string SoloCursor = "soloCursor";
+ public const string SoloCursor_pulse = "soloCursor_pulse";
+ public const string TiledBG_default = "tiledBG_default";
+ public const string TwinCursor = "twinCursor";
+ public const string TwinCursor_pulse = "twinCursor_pulse";
+ }
+}
\ No newline at end of file
diff --git a/AnimationGenerator/Program.cs b/AnimationGenerator/Program.cs
new file mode 100644
index 0000000..32bc993
--- /dev/null
+++ b/AnimationGenerator/Program.cs
@@ -0,0 +1,160 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Xml;
+using QURO.AnimationLibrary;
+using Microsoft.Xna.Framework;
+using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate;
+
+namespace AnimationGenerator
+{
+ class Program
+ {
+ public static Dictionary loadedFrames;
+ public static AnimationSet output;
+
+ public static void Main(string[] args)
+ {
+ using(XmlReader xmlRead = XmlReader.Create("Content/boardMap.xml"))
+ {
+ loadedFrames = IntermediateSerializer.Deserialize>(xmlRead, null);
+ }
+
+ output = new AnimationSet();
+
+ Frame[] soloCursor_pulse_frames = new Frame[]
+ {
+ new Frame(loadedFrames["soloCursor"], 20f / 60f),
+ new Frame(loadedFrames["soloCursor_pulse"], 20f / 60f),
+ };
+ output.Add(new Animation("soloCursor_pulse", soloCursor_pulse_frames, true));
+
+ Frame[] twinCursor_pulse_frames = new Frame[]
+ {
+ new Frame(loadedFrames["twinCursor"], 20f / 60f),
+ new Frame(loadedFrames["twinCursor_pulse"], 20f / 60f),
+ };
+ output.Add(new Animation("twinCursor_pulse", twinCursor_pulse_frames, true));
+
+ Frame[] block_default_frames = new Frame[]
+ {
+ new Frame(loadedFrames["block0"], 0),
+ };
+ output.Add(new Animation("block_default", block_default_frames, false));
+
+ Frame[] block_matched_frames = new Frame[]
+ {
+ new Frame(loadedFrames["block0"], 0),
+ new Frame(loadedFrames["block0_flash"], 0)
+ };
+ output.Add(new Animation("block_matched", block_matched_frames, true));
+
+ Frame[] block_pop_frames = new Frame[]
+ {
+ new Frame(loadedFrames["block0_pop"], 0),
+ };
+ output.Add(new Animation("block_pop", block_pop_frames, false));
+
+ Frame[] block_fall_frames = new Frame[]
+ {
+ new Frame(loadedFrames["block0"], 0),
+ new Frame(loadedFrames["block0_bounce1"], 0),
+ new Frame(loadedFrames["block0_bounce2"], 0),
+ };
+ output.Add(new Animation("block_fall", block_fall_frames, false));
+
+ Frame[] block_squished_frames = new Frame[]
+ {
+ new Frame(loadedFrames["block0_squish"], 0),
+ };
+ output.Add(new Animation("block_squished", block_squished_frames, false));
+
+ Frame[] block_bounce_frames = new Frame[]
+ {
+ new Frame(loadedFrames["block0_bounce2"], 1f / 60f),
+ new Frame(loadedFrames["block0"], 1f / 60f),
+ new Frame(loadedFrames["block0_squish"], 1f / 60f),
+ new Frame(loadedFrames["block0"], 1f / 60f),
+ new Frame(loadedFrames["block0_bounce1"], 2f / 60f),
+ new Frame(loadedFrames["block0"], 1f / 60f),
+ };
+ output.Add(new Animation("block_bounce", block_bounce_frames, false));
+
+ Frame[] tiledBG_default_frames = new Frame[]
+ {
+ new Frame(loadedFrames["tiledBG_default"], 0),
+ };
+ output.Add(new Animation("tiledBG_default", tiledBG_default_frames, false));
+
+ var xmlSettings = new XmlWriterSettings();
+ xmlSettings.Indent = true;
+ using(XmlWriter writer = XmlWriter.Create("output.xml"))
+ {
+ IntermediateSerializer.Serialize(writer, output, null);
+ }
+
+ }
+ /*
+ public Animation TwinCursor_pulse => new Animation("twinCursor_pulse", textureAtlas, twinCursor_pulse_frames, FrameTimerUtility.FramesToSeconds(20), true);
+ private readonly string[] twinCursor_pulse_frames = new string[]
+ {
+ SpriteNames.TwinCursor,
+ SpriteNames.TwinCursor_pulse
+ };
+
+ //red blocks
+ public Animation Block_default => new Animation("block_default", textureAtlas, block_default_frames, defaultDelay, false);
+ private readonly string[] block_default_frames = new string[]
+ {
+ SpriteNames.Block0
+ };
+
+ public Animation Block_matched => new Animation("block_matched", textureAtlas, block_matched_frames, defaultDelay, true);
+ private readonly string[] block_matched_frames = new string[]
+ {
+ SpriteNames.Block0,
+ SpriteNames.Block0_flash
+ };
+
+ public Animation Block_pop => new Animation("block_pop", textureAtlas, block_pop_frames, defaultDelay, true);
+ private readonly string[] block_pop_frames = new string[]
+ {
+ SpriteNames.Block0_pop
+ };
+
+ public Animation Block_fall => new Animation("block_fall", textureAtlas, block_fall_frames, defaultDelay, false);
+ private readonly string[] block_fall_frames = new string[]
+ {
+ SpriteNames.Block0,
+ SpriteNames.Block0_bounce1,
+ SpriteNames.Block0_bounce2,
+ };
+
+ public Animation Block_squished => new Animation("block_squished", textureAtlas, block_squished_frames, defaultDelay, false);
+ private readonly string[] block_squished_frames = new string[]
+ {
+ SpriteNames.Block0_squish
+ };
+
+ public Animation Block_bounce => new Animation("block_bounce", textureAtlas, block_bounce_frames, defaultDelay, false);
+ private readonly string[] block_bounce_frames = new string[]
+ {
+ SpriteNames.Block0_bounce2,
+ SpriteNames.Block0,
+ SpriteNames.Block0_squish,
+ SpriteNames.Block0,
+ SpriteNames.Block0_bounce1,
+ SpriteNames.Block0_bounce1,
+ SpriteNames.Block0
+ };
+
+ public Animation TiledBG_default => new Animation("tiledBG_default", textureAtlas, tiledBG_default_frames, defaultDelay, false);
+ private readonly string[] tiledBG_default_frames = new string[]
+ {
+ SpriteNames.TiledBG_default
+ };
+ */
+ }
+}
diff --git a/AnimationGenerator/Properties/AssemblyInfo.cs b/AnimationGenerator/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..19aceef
--- /dev/null
+++ b/AnimationGenerator/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 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("AnimationGenerator")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("AnimationGenerator")]
+[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("b1938bd7-a474-427f-91f1-f8a1875b28ce")]
+
+// 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")]
diff --git a/AnimationLibrary/AnimatedSprite.cs b/AnimationLibrary/AnimatedSprite.cs
index a4d4793..a347414 100644
--- a/AnimationLibrary/AnimatedSprite.cs
+++ b/AnimationLibrary/AnimatedSprite.cs
@@ -17,7 +17,7 @@ namespace QURO.AnimationLibrary
}
}
public int CurrentFrameIndex { get; set; }
- public Rectangle CurrentFrame => CurrentAnimation.Frames[CurrentFrameIndex];
+ public Frame CurrentFrame => CurrentAnimation.Frames[CurrentFrameIndex];
private float timer;
@@ -27,13 +27,13 @@ namespace QURO.AnimationLibrary
{
SpriteSheet = spriteSheet;
CurrentAnimation = startingAnimation;
- timer = CurrentAnimation.Delay;
+ timer = CurrentFrame.Delay;
}
public void Reset()
{
CurrentFrameIndex = 0;
- timer = CurrentAnimation.Delay;
+ timer = CurrentFrame.Delay;
}
public void Update(GameTime gameTime)
@@ -53,7 +53,7 @@ namespace QURO.AnimationLibrary
CurrentFrameIndex = 0;
}
}
- timer = CurrentAnimation.Delay;
+ timer = CurrentFrame.Delay;
}
else
{
@@ -64,12 +64,12 @@ namespace QURO.AnimationLibrary
public void Draw(SpriteBatch spriteBatch, Vector2 position, Color tint)
{
- spriteBatch.Draw(SpriteSheet, position, CurrentFrame, tint);
+ spriteBatch.Draw(SpriteSheet, position, CurrentFrame.SourceRect, tint);
}
public void Draw(SpriteBatch spriteBatch, Vector2 position, Vector2 spriteOffset, Color tint)
{
- Rectangle sourceRect = CurrentFrame;
+ Rectangle sourceRect = CurrentFrame.SourceRect;
sourceRect.Offset(spriteOffset);
spriteBatch.Draw(SpriteSheet, position, sourceRect, tint);
diff --git a/AnimationLibrary/Animation.cs b/AnimationLibrary/Animation.cs
index 2bb0fae..0c1f378 100644
--- a/AnimationLibrary/Animation.cs
+++ b/AnimationLibrary/Animation.cs
@@ -6,12 +6,31 @@ namespace QURO.AnimationLibrary
{
public string Name { get; set; }
public bool IsLooping { get; set; }
- public float Delay { get; set; }
- public Rectangle[] Frames { get; set; }
+ public Frame[] Frames { get; set; }
public bool IsStillImage => Frames.Length <= 1;
public Animation() { }
+
+ public Animation(string name, Frame[] frames, bool loop)
+ {
+ Name = name;
+ Frames = frames;
+ IsLooping = loop;
+ }
+
+ public Animation(string name, Rectangle[] sourceRects, float delay, bool loop)
+ {
+ Name = name;
+
+ Frames = new Frame[sourceRects.Length];
+ for(int index = 0; index < sourceRects.Length; index++)
+ {
+ Frames[index] = new Frame(sourceRects[index], delay);
+ }
+
+ IsLooping = loop;
+ }
}
}
diff --git a/AnimationLibrary/AnimationSet.cs b/AnimationLibrary/AnimationSet.cs
index 31e40a3..9f603ee 100644
--- a/AnimationLibrary/AnimationSet.cs
+++ b/AnimationLibrary/AnimationSet.cs
@@ -5,5 +5,25 @@ namespace QURO.AnimationLibrary
public class AnimationSet
{
public Dictionary Anims;
+
+ public AnimationSet()
+ {
+ Anims = new Dictionary();
+ }
+
+ public void Add(Animation anim)
+ {
+ Anims.Add(anim.Name, anim);
+ }
+
+ public void Remove(Animation anim)
+ {
+ Anims.Remove(anim.Name);
+ }
+
+ public void Remove(string animName)
+ {
+ Anims.Remove(animName);
+ }
}
}
diff --git a/AnimationLibrary/Frame.cs b/AnimationLibrary/Frame.cs
new file mode 100644
index 0000000..8bf58e7
--- /dev/null
+++ b/AnimationLibrary/Frame.cs
@@ -0,0 +1,18 @@
+using Microsoft.Xna.Framework;
+
+namespace QURO.AnimationLibrary
+{
+ public class Frame
+ {
+ public Rectangle SourceRect { get; set; }
+ public float Delay { get; set; }
+
+ public Frame() { }
+
+ public Frame(Rectangle sourceRectangle, float delay)
+ {
+ SourceRect = sourceRectangle;
+ Delay = delay;
+ }
+ }
+}
diff --git a/AnimationLibrary/QURO.AnimationLibrary.csproj b/AnimationLibrary/QURO.AnimationLibrary.csproj
index 3982b3c..2dde226 100644
--- a/AnimationLibrary/QURO.AnimationLibrary.csproj
+++ b/AnimationLibrary/QURO.AnimationLibrary.csproj
@@ -7,8 +7,8 @@
{69DADC27-FBEB-4625-9212-6EB5BED5102A}
Library
Properties
- AnimationLibrary
- AnimationLibrary
+ QURO.AnimationLibrary
+ QURO.AnimationLibrary
v4.5
512
@@ -48,6 +48,7 @@
+
diff --git a/PuzzSwap.sln b/PuzzSwap.sln
index ba068e5..025044d 100644
--- a/PuzzSwap.sln
+++ b/PuzzSwap.sln
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PuzzSwap", "PuzzSwap\PuzzSw
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QURO.AnimationLibrary", "AnimationLibrary\QURO.AnimationLibrary.csproj", "{69DADC27-FBEB-4625-9212-6EB5BED5102A}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnimationGenerator", "AnimationGenerator\AnimationGenerator.csproj", "{B1938BD7-A474-427F-91F1-F8A1875B28CE}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +23,10 @@ Global
{69DADC27-FBEB-4625-9212-6EB5BED5102A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69DADC27-FBEB-4625-9212-6EB5BED5102A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69DADC27-FBEB-4625-9212-6EB5BED5102A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B1938BD7-A474-427F-91F1-F8A1875B28CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B1938BD7-A474-427F-91F1-F8A1875B28CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B1938BD7-A474-427F-91F1-F8A1875B28CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B1938BD7-A474-427F-91F1-F8A1875B28CE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE