-
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.
This is the dumbest wind sailing I've ever
- Loading branch information
Showing
6 changed files
with
105 additions
and
10 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
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,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace NovemberPirates.Components | ||
{ | ||
internal class Singleton | ||
{ | ||
} | ||
} |
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,10 @@ | ||
using System.Numerics; | ||
|
||
namespace NovemberPirates.Components | ||
{ | ||
internal class Wind | ||
{ | ||
public float WindStrength = 10; | ||
public Vector2 WindDirection = new Vector2(1, 0); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Arch.Core; | ||
using Arch.Core.Extensions; | ||
using NovemberPirates.Components; | ||
using NovemberPirates.Systems; | ||
using Raylib_CsLo; | ||
|
||
namespace NovemberPirates.Scenes.Levels.Systems | ||
{ | ||
internal class WindSystem : GameSystem | ||
{ | ||
internal override void Update(World world) | ||
{ | ||
|
||
} | ||
|
||
internal override void UpdateNoCamera(World world) | ||
{ | ||
var query = new QueryDescription().WithAll<Wind, Singleton>(); | ||
|
||
world.Query(in query, (entity) => | ||
{ | ||
var wind = entity.Get<Wind>(); | ||
var singleton = entity.Get<Singleton>(); | ||
|
||
wind.WindDirection = RayMath.Vector2Rotate(wind.WindDirection, 0.1f * Raylib.GetFrameTime()); | ||
|
||
Raylib.DrawLine(50, 50, (int)(50 + wind.WindDirection.X * 30), (int)(50 + wind.WindDirection.Y * 30), Raylib.ORANGE); | ||
}); | ||
} | ||
} | ||
} |