Skip to content

Commit

Permalink
feat: tiles rendered
Browse files Browse the repository at this point in the history
  • Loading branch information
cherrynik committed Jun 16, 2024
1 parent 863347f commit 94e8988
Show file tree
Hide file tree
Showing 25 changed files with 91 additions and 13,301 deletions.
7 changes: 0 additions & 7 deletions MonoGame.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Monogame.ImGuiNet", "src\Li
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UI", "src\Libs\UI\UI.csproj", "{B7BAA8DC-A62F-4746-B6C4-9908C0AFD30A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ldtk", "src\Libs\Ldtk\Ldtk.csproj", "{86EA0012-5A82-4173-A3BC-95803A89CC1D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -96,10 +94,6 @@ Global
{B7BAA8DC-A62F-4746-B6C4-9908C0AFD30A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7BAA8DC-A62F-4746-B6C4-9908C0AFD30A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7BAA8DC-A62F-4746-B6C4-9908C0AFD30A}.Release|Any CPU.Build.0 = Release|Any CPU
{86EA0012-5A82-4173-A3BC-95803A89CC1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{86EA0012-5A82-4173-A3BC-95803A89CC1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{86EA0012-5A82-4173-A3BC-95803A89CC1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{86EA0012-5A82-4173-A3BC-95803A89CC1D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5E3B6238-A92E-4703-8527-1C2410D7906A} = {F5258F7E-B0BA-466D-8CF8-4DAB84722BE3}
Expand All @@ -118,6 +112,5 @@ Global
{57F0A75A-5AD6-4187-9DC6-3CBA44333061} = {FC0D63F3-9B01-46BD-9435-A7E26C905825}
{56FF7C50-4B5F-4480-A5BE-BA95925152A1} = {FE9CE932-6F98-4455-A80F-2A0CDB6DB46E}
{B7BAA8DC-A62F-4746-B6C4-9908C0AFD30A} = {7AE4DC46-59EB-4F69-9240-C7363F0778AA}
{86EA0012-5A82-4173-A3BC-95803A89CC1D} = {FE9CE932-6F98-4455-A80F-2A0CDB6DB46E}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using LightInject;
using GameDesktop.CompositionRoots.Components;
using GameDesktop.CompositionRoots.Entities;
using Ldtk;
using LDtk;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Myra.Graphics2D.UI;
Expand Down Expand Up @@ -106,12 +106,12 @@ private static void RegisterEntryPoint(IServiceRegistry serviceRegistry)
var preRender = new Feature(factory.GetInstance<World>(),
factory.GetInstance<SystemsEngine>(),
new CharacterMovementAnimationSystem(factory.GetInstance<World>()),
new CameraFollowingSystem(factory.GetInstance<World>()),
new TilesRenderingSystem(factory.GetInstance<World>(), factory.GetInstance<SpriteBatch>(),
factory.GetInstance<LdtkData>()));
new CameraFollowingSystem(factory.GetInstance<World>()));

var render = new Feature(factory.GetInstance<World>(),
factory.GetInstance<SystemsEngine>(),
new TilesRenderingSystem(factory.GetInstance<World>(), factory.GetInstance<SpriteBatch>(),
factory.GetInstance<LDtkFile>()),
new RenderCharacterMovementAnimationSystem(factory.GetInstance<World>(),
factory.GetInstance<SpriteBatch>()));
#if DEBUG
Expand Down Expand Up @@ -169,7 +169,7 @@ private static void RegisterEntryPoint(IServiceRegistry serviceRegistry)
Left = -30,
Top = -20,
TextAlign = TextHorizontalAlignment.Right,
Text = "Pre-alpha v0.2.4"
Text = "Pre-alpha v0.3.0"
}));
serviceRegistry.RegisterSingleton<Func<GameVersion>>(factory => factory.GetInstance<GameVersion>);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using GameDesktop.Resources.Internal;
using Ldtk;
using LDtk;
using LightInject;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
Expand All @@ -29,9 +30,9 @@ private static void RegisterLdtk(IServiceRegistry serviceRegistry)
Environment.GetEnvironmentVariable(EnvironmentVariable.AppBaseDirectory),
"Content/TileMaps/Test.ldtk"
);
var ldtkJson = File.ReadAllText(fileName);

return LdtkData.FromJson(ldtkJson);
var file = LDtkFile.FromFile(fileName);
return file;
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/Apps/GameDesktop/Content/TileMaps/Test.ldtk

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 94e8988

Please sign in to comment.