Skip to content

Commit 2d2720a

Browse files
authored
Character animation (#87)
* Added Sprite Sheet (#85) * Added Sprite Sheet Added a sprite sheet for the sample character and a data sheet to reference it's animation cycle * Wrote the SpriteSheet class, which will hold information about a sprite sheet. * Added XML (#86) Added a sprite sheet for the sample character and a data sheet to reference it's animation cycle * Added XML * Wrote the ComponentRenderer * Moving around an information class, working on layers. * Moved a bunch of things. * Working on cleaner deserialization. * Sprite sheet reader now functional. * Switching to the new rendering system. * Plenty of work on the animated texture system. * Fixing animation system bugs. Fixed the 1st. * Fixed a invisibility bug in the animation framework. * Added an FPS counter, disproved that bad FPS was the cause of my issues. * Fixed the error that caused creatures to not transition smoothly between tiles. * Fixed a memory leak. * Tweaked the FPS of the walking animations. * Many code tweaks.
1 parent 406175b commit 2d2720a

133 files changed

Lines changed: 1522 additions & 978 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<tilemap tileswide="3" tileshigh="4" tilewidth="64" tileheight="64">
2+
<layer number="0" name="Layer 0">
3+
<tile x="0" y="0" tile="0" rot="0" flipX="false"/>
4+
<tile x="1" y="0" tile="1" rot="0" flipX="false"/>
5+
<tile x="2" y="0" tile="2" rot="0" flipX="false"/>
6+
<tile x="0" y="1" tile="3" rot="0" flipX="false"/>
7+
<tile x="1" y="1" tile="4" rot="0" flipX="false"/>
8+
<tile x="2" y="1" tile="5" rot="0" flipX="false"/>
9+
<tile x="0" y="2" tile="6" rot="0" flipX="false"/>
10+
<tile x="1" y="2" tile="7" rot="0" flipX="false"/>
11+
<tile x="2" y="2" tile="8" rot="0" flipX="false"/>
12+
<tile x="0" y="3" tile="9" rot="0" flipX="false"/>
13+
<tile x="1" y="3" tile="10" rot="0" flipX="false"/>
14+
<tile x="2" y="3" tile="11" rot="0" flipX="false"/>
15+
</layer>
16+
</tilemap>
2.87 KB
Loading

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ SneakyTactician <SneakyTactician@outlook.com>
1111
* Job system is now client side
1212
* Job system now has enhanced support for dependencies
1313
* Job system now has enhanced support for "bound" (same worker) jobs
14+
* Graphics API reworked to support animations, as well as any future different types of rendering
1415

1516
#### Server
1617
* The newgame command now requires a 3rd parameter, the world's name
@@ -26,12 +27,16 @@ SneakyTactician <SneakyTactician@outlook.com>
2627
* Stone rubble texture has been replaced
2728
* Pickaxe icon in map when tile is queue up to be mined has changed
2829
* Added the ability to zoom in
30+
* Characters now have new texture
31+
* Characters now have animations
2932

3033
#### Sound
3134

3235
#### Bugs
3336

3437
* Fixed a mining command bug
38+
* Fixed a memory Leak
39+
3540
---
3641

3742
## [Version 0.0.9]
@@ -45,7 +50,7 @@ SneakyTactician <SneakyTactician@outlook.com>
4550
* Added internal support for sfx/sound events
4651

4752
#### Server
48-
* Seperated server loading and server starting into two seperate commands
53+
* Separated server loading and server starting into two separate commands
4954
* Now handles player connections and disconnections in a safer way
5055

5156
#### GUI

EarthWithMagic.sln

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ EndProject
3535
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MagicalLifeDedicatedServer", "MagicalLifeDedicatedServer\MagicalLifeDedicatedServer.csproj", "{38385939-AFA9-44AA-9291-20F48EBFE8E9}"
3636
EndProject
3737
Global
38+
GlobalSection(Performance) = preSolution
39+
HasPerformanceSessions = true
40+
EndGlobalSection
3841
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3942
Debug|Any CPU = Debug|Any CPU
4043
Debug|x64 = Debug|x64

MagicalLifeAPI/Asset/AssetManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using MagicalLifeAPI.Error.InternalExceptions;
22
using Microsoft.Xna.Framework.Graphics;
3+
using System;
34
using System.Collections.Generic;
45

56
namespace MagicalLifeAPI.Asset

MagicalLifeAPI/Asset/TextureLoader.cs

Lines changed: 52 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,35 @@ public class TextureLoader : IGameLoader
1717

1818
private readonly ContentManager Manager;
1919

20+
public static readonly string GUIListBoxItemBackground = "GUI/ListBoxItemBackground";
21+
public static readonly string GUIPickaxeButtonGold = "GUI/PickaxeButton_Gold";
22+
public static readonly string GUIPickaxeButtonGrey = "GUI/PickaxeButton_Grey";
23+
public static readonly string GUICursorCarrot = "GUI/CursorCarrot";
24+
public static readonly string GUIInputBox100x50 = "GUI/InputBox100x50";
25+
public static readonly string GUIMenuBackground = "GUI/MenuBackground";
26+
public static readonly string GUIMenuButton = "GUI/MenuButton";
27+
public static readonly string GUIPickaxeMapIcon = "GUI/PickaxeMapIcon";
28+
29+
public static readonly string TextureDirt1 = "Textures/Tile/Dirt_01";
30+
public static readonly string TextureDirt2 = "Textures/Tile/Dirt_02";
31+
public static readonly string TextureGrass1 = "Textures/Tile/Grass_01";
32+
public static readonly string TextureGrass2 = "Textures/Tile/Grass_02";
33+
public static readonly string TextureGrass3 = "Textures/Tile/Grass_03";
34+
public static readonly string TextureGrass4 = "Textures/Tile/Grass_04";
35+
public static readonly string TextureStone1 = "Textures/Resource/Stone_01";
36+
public static readonly string TextureStone2 = "Textures/Resource/Stone_02";
37+
public static readonly string TextureStoneRubble1 = "Textures/Items/StoneRubble_01";
38+
public static readonly string TextureStoneRubble2 = "Textures/Items/StoneRubble_02";
39+
public static readonly string TextureTestTile = "Textures/Tile/TestTile";
40+
41+
public static readonly string FontMainMenuFont12x = "Fonts/MainMenuFont12x";
42+
public static readonly string FontMainMenuFont24x = "Fonts/MainMenuFont24x";
43+
44+
public static readonly string LogoFMOD = "Logo/FMODLogo";
45+
public static readonly string LogoMonoGame = "Logo/MonoGameLogo";
46+
47+
public static readonly string AnimationBaseCharacter = "Character/Base Character/BaseCharacterSprite";
48+
2049
public TextureLoader(ContentManager manager)
2150
{
2251
this.Manager = manager;
@@ -29,40 +58,32 @@ public TextureLoader()
2958

3059
private void Prepare()
3160
{
32-
this.TexturesToLoad.Add("Basic Human");
33-
this.TexturesToLoad.Add("CursorCarrot");
34-
35-
this.TexturesToLoad.Add("MenuBackground");
36-
this.TexturesToLoad.Add("MenuButton");
37-
this.TexturesToLoad.Add("InputBox100x50");
38-
this.TexturesToLoad.Add("GUI/ListBoxItemBackground");
39-
40-
this.TexturesToLoad.Add("Stone");
41-
this.TexturesToLoad.Add("StoneRubble_01");
42-
this.TexturesToLoad.Add("StoneRubble_02");
43-
44-
this.TexturesToLoad.Add("TestTile");
45-
this.TexturesToLoad.Add("Dirt");
61+
this.TexturesToLoad.Add("Character/Character");
62+
this.TexturesToLoad.Add(GUIListBoxItemBackground);
63+
this.TexturesToLoad.Add(GUIPickaxeButtonGold);
64+
this.TexturesToLoad.Add(GUIPickaxeButtonGrey);
65+
this.TexturesToLoad.Add(GUICursorCarrot);
66+
this.TexturesToLoad.Add(GUIInputBox100x50);
67+
this.TexturesToLoad.Add(GUIMenuBackground);
68+
this.TexturesToLoad.Add(GUIMenuButton);
69+
this.TexturesToLoad.Add(GUIPickaxeMapIcon);
4670

47-
this.TexturesToLoad.Add("DirtGrassTrans1");
48-
this.TexturesToLoad.Add("DirtGrassTrans2");
49-
this.TexturesToLoad.Add("DirtGrassTrans3");
50-
this.TexturesToLoad.Add("DirtGrassTrans4");
51-
this.TexturesToLoad.Add("DirtGrassTrans5");
52-
this.TexturesToLoad.Add("DirtGrassTrans6");
53-
this.TexturesToLoad.Add("DirtGrassTrans7");
54-
this.TexturesToLoad.Add("DirtGrassTrans8");
55-
this.TexturesToLoad.Add("DirtGrassTrans9");
56-
this.TexturesToLoad.Add("DirtGrassTrans10");
57-
this.TexturesToLoad.Add("DirtGrassTrans11");
58-
this.TexturesToLoad.Add("DirtGrassTrans12");
71+
this.TexturesToLoad.Add(TextureDirt1);
72+
this.TexturesToLoad.Add(TextureDirt2);
73+
this.TexturesToLoad.Add(TextureGrass1);
74+
this.TexturesToLoad.Add(TextureGrass2);
75+
this.TexturesToLoad.Add(TextureGrass3);
76+
this.TexturesToLoad.Add(TextureGrass4);
77+
this.TexturesToLoad.Add(TextureStone1);
78+
this.TexturesToLoad.Add(TextureStone2);
79+
this.TexturesToLoad.Add(TextureStoneRubble1);
80+
this.TexturesToLoad.Add(TextureStoneRubble2);
81+
this.TexturesToLoad.Add(TextureTestTile);
5982

60-
this.TexturesToLoad.Add("Grass");
83+
this.TexturesToLoad.Add(LogoFMOD);
84+
this.TexturesToLoad.Add(LogoMonoGame);
6185

62-
this.TexturesToLoad.Add("GUI/PickaxeButton_Grey");
63-
this.TexturesToLoad.Add("GUI/PickaxeButton_Gold");
64-
this.TexturesToLoad.Add("PickaxeMapIcon");
65-
86+
this.TexturesToLoad.Add(AnimationBaseCharacter);
6687
}
6788

6889
public void InitialStartup()

MagicalLifeAPI/Components/Generic/Renderable/AbstractRenderable.cs

Lines changed: 0 additions & 26 deletions
This file was deleted.

MagicalLifeAPI/Components/Generic/Renderable/IRenderable.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

MagicalLifeAPI/Components/Generic/Renderable/StaticTexture.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

MagicalLifeAPI/Components/Tile/Renderable/AbstractConnectedTexture.cs

Lines changed: 0 additions & 153 deletions
This file was deleted.

0 commit comments

Comments
 (0)