-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nolemretaW
committed
Jun 6, 2023
1 parent
260e2b4
commit 6d5a32b
Showing
9 changed files
with
91 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Chroma.Shine\Chroma.Shine.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Chroma" Version="0.58.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System.Numerics; | ||
using Chroma; | ||
using Chroma.ContentManagement; | ||
using Chroma.ContentManagement.FileSystem; | ||
using Chroma.Graphics; | ||
|
||
namespace Animation | ||
{ | ||
public class GameCore : Game | ||
{ | ||
private SpriteSheet _spriteSheet; | ||
private SpriteSheetAnimation _spriteSheetAnimation; | ||
|
||
public GameCore() : base(new(false, false)) | ||
{ | ||
|
||
} | ||
|
||
protected override IContentProvider InitializeContentPipeline() | ||
{ | ||
return new FileSystemContentProvider( | ||
Path.Combine(AppContext.BaseDirectory, "../../../../_common") | ||
); | ||
} | ||
|
||
protected override void LoadContent() | ||
{ | ||
_spriteSheet = new SpriteSheet(Content.Load<Texture>("Textures/Spritesheet.png"), 128, 128); | ||
_spriteSheet.Position = new Vector2(30, 40); | ||
_spriteSheetAnimation = new SpriteSheetAnimation(_spriteSheet, 1, 24, 0.5f); | ||
_spriteSheetAnimation.Repeat = true; | ||
_spriteSheetAnimation.Play(); | ||
} | ||
|
||
protected override void Update(float delta) | ||
{ | ||
_spriteSheetAnimation.Update(delta); | ||
} | ||
|
||
protected override void Draw(RenderContext context) | ||
{ | ||
_spriteSheetAnimation.Draw(context); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using Animation; | ||
|
||
new GameCore().Run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
Chroma.ShineExample/GameCore.cs → Chroma.Shine.Examples/Collision/GameCore.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using Collision; | ||
|
||
new GameCore().Run(); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.