-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
17 changed files
with
204 additions
and
12 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,23 @@ | ||
{ "frames": [ | ||
{ | ||
"filename": "Cannon-0", | ||
"frame": { "x": 1, "y": 1, "w": 29, "h": 16 }, | ||
"rotated": false, | ||
"trimmed": false, | ||
"spriteSourceSize": { "x": 0, "y": 0, "w": 29, "h": 16 }, | ||
"sourceSize": { "w": 29, "h": 16 }, | ||
"duration": 100 | ||
} | ||
], | ||
"meta": { | ||
"app": "https://www.aseprite.org/", | ||
"version": "1.3-rc6-x64", | ||
"image": "cannon.png", | ||
"format": "RGBA8888", | ||
"size": { "w": 31, "h": 18 }, | ||
"scale": "1", | ||
"frameTags": [ | ||
{ "name": "Cannon", "from": 0, "to": 0, "direction": "forward", "color": "#000000ff" } | ||
] | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ "frames": [ | ||
{ | ||
"filename": "Ball-0", | ||
"frame": { "x": 1, "y": 1, "w": 10, "h": 10 }, | ||
"rotated": false, | ||
"trimmed": false, | ||
"spriteSourceSize": { "x": 0, "y": 0, "w": 10, "h": 10 }, | ||
"sourceSize": { "w": 10, "h": 10 }, | ||
"duration": 100 | ||
} | ||
], | ||
"meta": { | ||
"app": "https://www.aseprite.org/", | ||
"version": "1.3-rc6-x64", | ||
"image": "cannonBall.png", | ||
"format": "RGBA8888", | ||
"size": { "w": 12, "h": 12 }, | ||
"scale": "1", | ||
"frameTags": [ | ||
{ "name": "Ball", "from": 0, "to": 0, "direction": "forward", "color": "#000000ff" } | ||
] | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ "frames": [ | ||
{ | ||
"filename": "Cannon-0", | ||
"frame": { "x": 1, "y": 1, "w": 20, "h": 12 }, | ||
"rotated": false, | ||
"trimmed": false, | ||
"spriteSourceSize": { "x": 0, "y": 0, "w": 20, "h": 12 }, | ||
"sourceSize": { "w": 20, "h": 12 }, | ||
"duration": 100 | ||
} | ||
], | ||
"meta": { | ||
"app": "https://www.aseprite.org/", | ||
"version": "1.3-rc6-x64", | ||
"image": "cannonLoose.png", | ||
"format": "RGBA8888", | ||
"size": { "w": 22, "h": 14 }, | ||
"scale": "1", | ||
"frameTags": [ | ||
{ "name": "Cannon", "from": 0, "to": 0, "direction": "forward", "color": "#000000ff" } | ||
] | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,9 @@ | ||
using System.Numerics; | ||
|
||
namespace NovemberPirates.Components | ||
{ | ||
internal class Cannonball | ||
{ | ||
internal Vector2 Motion; | ||
} | ||
} |
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,11 @@ | ||
using NovemberPirates.Utilities; | ||
|
||
namespace NovemberPirates.Components | ||
{ | ||
internal class Ship | ||
{ | ||
public BoatCondition BoatCondition = BoatCondition.Good; | ||
|
||
|
||
} | ||
} |
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,27 @@ | ||
using Arch.Core; | ||
using Arch.Core.Extensions; | ||
using NovemberPirates.Components; | ||
using NovemberPirates.Utilities; | ||
using Raylib_CsLo; | ||
using System.Numerics; | ||
|
||
namespace NovemberPirates.Entities.Archetypes | ||
{ | ||
internal static class CannonballBuilder | ||
{ | ||
internal static void Create(World world, Vector2 pos, float rotation) | ||
{ | ||
var cannonballEntity = world.Create<Sprite, Cannonball>(); | ||
|
||
var cannonball = new Cannonball(); | ||
var rotationInRadians = rotation * (float)(Math.PI / 180); | ||
cannonball.Motion = RayMath.Vector2Rotate(new Vector2(1000, 0), rotationInRadians); | ||
cannonballEntity.Set(cannonball); | ||
|
||
var cannonballSprite = new Sprite(TextureKey.Cannonball, "Assets/Art/cannonball", 1f, true); | ||
cannonballSprite.Position = pos; | ||
cannonballEntity.Set(cannonballSprite); | ||
|
||
} | ||
} | ||
} |
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,26 @@ | ||
using Arch.Core; | ||
using Arch.Core.Extensions; | ||
using NovemberPirates.Components; | ||
using NovemberPirates.Systems; | ||
using Raylib_CsLo; | ||
|
||
namespace NovemberPirates.Scenes.Levels.Systems | ||
{ | ||
internal class CannonBallSystem : GameSystem | ||
{ | ||
internal override void Update(World world) | ||
{ | ||
var cannonballQuery = new QueryDescription().WithAll<Cannonball, Sprite>(); | ||
|
||
var allShips = new QueryDescription().WithAll<Ship, Sprite>(); | ||
|
||
world.Query(in cannonballQuery, (entity) => | ||
{ | ||
var cannonball = entity.Get<Cannonball>(); | ||
var sprite = entity.Get<Sprite>(); | ||
|
||
sprite.Position += cannonball.Motion * Raylib.GetFrameTime(); | ||
}); | ||
} | ||
} | ||
} |
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
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