Hey There,
Sorry I can't follow you on how the GitHub SFML.NET build may help me here? I have the latest build I'm sure.
As I said I'm following the book SFML Game Dev. Tutorial.
Here is where I'm at
Stopwatch clock;
Vector2f newPos; // help vector for movement
float playerspeed = 1.0f; // speed of player movement
...
public void Run()
{
while(mWindow.IsOpen())
{
clock.Restart(); //restart clock
ProcessEvents();
Update(clock.Elapsed); //pass the elapsed time
Render();
}
}
private void Update(TimeSpan deltaTime)
{
if (mIsMovingUp)
newPos.Y -= playerspeed;
if (mIsMovingDown)
newPos.Y += playerspeed;
if (mIsMovingLeft)
newPos.X -= playerspeed;
if (mIsMovingRight)
newPos.X += playerspeed;
Console.WriteLine(deltaTime.TotalSeconds);
mPlayer.Position = newPos * deltaTime.TotalSeconds;
}
I really tried to match the .NET Code with the C++ Code from the book here.
But the main issue is with
mPlayer.Position = newPos * deltaTime.TotalSeconds;
Where newPos is a Vector2f object and TotalSeconds is a property of type double.
It's not possible to multiply these two for sure.
Even tho its written that way in the Tutorial:
mPlayer.move(movement * deltaTime.asSeconds());
where movement is from sf::Vector2f and multiplied by at least any number type (int, double etc) - dunno if this might work in C++ and not in C# tho.
I have a hard time to find a fitting solution for .NET so I would appreciate if anybody could help me out here.
Thanks but I managed to build these 4 .dlls outta the Github src.
Btw. can you shortly describe me the differences between CSFML and the other SFML .dlls?
EDIT:
Funny coincidence...error message:
Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'csfml-grap
hics-2': The specified module could not be found. (Exception from HRESULT: 0x800
7007E)
at SFML.Graphics.RenderWindow.sfRenderWindow_createUnicode(VideoMode Mode, In
tPtr Title, Styles Style, ContextSettings& Params)
at SFML.Graphics.RenderWindow..ctor(VideoMode mode, String title, Styles styl
e, ContextSettings settings)
at SFML.Graphics.RenderWindow..ctor(VideoMode mode, String title)
at Tutorial_Game.Game..ctor() in c:\Users\FalkeXY\Desktop\SFML_Game_Dev\Game\
Game.cs:line 30
at Tutorial_Game.Program.Main(String[] args) in c:\Users\FalkeXY\Desktop\SFML
_Game_Dev\Game\Program.cs:line 14
Press any key to continue . . .