@@ -1,130 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E957B4E2-A0C1-44BF-AF7C-11BE14F5CB29}</ProjectGuid>
<RootNamespace>Kengine</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(SolutionDir)/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>sfml-window-d.lib;sfml-system-d.lib;sfml-graphics-d.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="app\window.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="player\Player.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="app\window.h" />
<ClInclude Include="player\Player.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E957B4E2-A0C1-44BF-AF7C-11BE14F5CB29}</ProjectGuid>
<RootNamespace>Kengine</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(SolutionDir)/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>sfml-window-d.lib;sfml-system-d.lib;sfml-graphics-d.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="app\Game.cpp" />
<ClCompile Include="app\GameState.cpp" />
<ClCompile Include="app\window.cpp" />
<ClCompile Include="gameStates\testState.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="player\Player.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="app\Game.h" />
<ClInclude Include="app\GameState.h" />
<ClInclude Include="app\window.h" />
<ClInclude Include="gameStates\testState.h" />
<ClInclude Include="player\Player.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
@@ -1,36 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="app\window.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="player\Player.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="app\window.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="player\Player.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="player\Player.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="app\GameState.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="app\Game.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="app\window.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="gameStates\testState.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="player\Player.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="app\GameState.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="app\Game.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="app\window.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="gameStates\testState.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerWorkingDirectory>$(ProjectDir)</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
@@ -1,24 +1,31 @@
#include "window.h"

kengine::Window::Window(int width, int height, std::string title)
{
m_width = width;
m_height = height;
m_title = title;
sf::Window::create(sf::VideoMode(m_width, m_height), m_title.c_str());
}

kengine::Window::~Window()
{
sf::Window::close();
}

void kengine::Window::windowEvents()
{
sf::Event event;
while (this->pollEvent(event))
{
if (event.type == sf::Event::Closed)
this->close();
}
#include "window.h"

kengine::Window::Window()
{
m_width = 640;
m_height = 400;
m_title = "Temp";
sf::Window::create(sf::VideoMode(m_width, m_height), m_title.c_str());
}

kengine::Window::Window(int width, int height, std::string title)
{
m_width = width;
m_height = height;
m_title = title;
sf::Window::create(sf::VideoMode(m_width, m_height), m_title.c_str());
}

kengine::Window::~Window()
{
sf::Window::close();
}

void kengine::Window::windowEvents()
{
while (pollEvent(m_event))
{
if (m_event.type == sf::Event::Closed)
close();
}
}
@@ -1,24 +1,27 @@
#pragma once
#include <iostream>
#include "SFML/Graphics.hpp"
#include "SFML/Window.hpp"

namespace kengine {

class Window : public sf::RenderWindow
{

public:
Window(int width, int height, std::string title);
~Window();

void windowEvents();

private:
int m_width, m_height;
std::string m_title;
sf::RenderWindow m_window;

};

#pragma once
#include <iostream>
#include "SFML/Graphics.hpp"
#include "SFML/Window.hpp"

namespace kengine
{

class Window : public sf::RenderWindow
{

public:
Window();
Window(int width, int height, std::string title);
~Window();

void windowEvents();

private:
int m_width, m_height;
std::string m_title;
sf::RenderWindow m_window;
sf::Event m_event;

};

}
@@ -1,30 +1,43 @@
#include "SFML/Graphics.hpp"
#include <iostream>
#include "app/window.h"
#include "player/Player.h"

int main()
{

kengine::Window window(800, 600, "BAJS");
kengine::Player player("images/test.png", 1, 1);
player.setSize(100, 100);

sf::Clock deltaClock;

while (window.isOpen())
{
player.checkInput();
window.windowEvents();
window.clear();
window.draw(player.getPlayerSprite());
window.display();

sf::Time dt = deltaClock.restart();

std::cout << "DT as MS: " << dt.asMilliseconds() << std::endl;

}

return 0;
#include "SFML/Graphics.hpp"
#include <iostream>
#include "app/Window.h"
#include "player/Player.h"
#include "app/Game.h"
#include "app/GameState.h"
#include "gameStates/testState.h"

int main()
{


kengine::Game game;

testState state;

game.pushState(&state);
game.gameLoop();

//
// old code below
//

//Make the game class make its own window
/*kengine::Window window(800, 600, "BAJS"); //Try using pointer on window
kengine::Player player("images/test.png", 1, 1);
player.setSize(100, 100);*/

/*while (window.isOpen())
{
player.checkInput();
window.windowEvents();
window.clear();
window.draw(player.getPlayerSprite());
window.display();
sf::Time dt = deltaClock.restart();
std::cout << "DT as MS: " << dt.asMilliseconds() << std::endl;
}*/

return 0;
}
@@ -1,49 +1,49 @@
#include "Player.h"

kengine::Player::Player()
{
m_playerSprite.setColor(sf::Color(40, 40, 40, 255));

m_imageSize.x = m_playerSprite.getLocalBounds().width;
m_imageSize.y = m_playerSprite.getLocalBounds().height;
}

kengine::Player::Player(std::string imagePath, float factorX, float factorY)
{
if (!m_playerTexture.loadFromFile(imagePath))
{
//Couldn't load texture from file
}

m_playerSprite.setTexture(m_playerTexture);
m_playerSprite.setScale(factorX, factorY);

m_imageSize.x = m_playerSprite.getLocalBounds().width;
m_imageSize.y = m_playerSprite.getLocalBounds().height;
}

kengine::Player::~Player()
{

}

void kengine::Player::checkInput()
{
if (sf::Keyboard::isKeyPressed(sf::Keyboard::A)) movePlayer(sf::Vector2f(m_playerSprite.getPosition().x - 1, m_playerSprite.getPosition().y));
if (sf::Keyboard::isKeyPressed(sf::Keyboard::D)) movePlayer(sf::Vector2f(m_playerSprite.getPosition().x + 1, m_playerSprite.getPosition().y));
if (sf::Keyboard::isKeyPressed(sf::Keyboard::W)) movePlayer(sf::Vector2f(m_playerSprite.getPosition().x, m_playerSprite.getPosition().y - 1));
if (sf::Keyboard::isKeyPressed(sf::Keyboard::S)) movePlayer(sf::Vector2f(m_playerSprite.getPosition().x, m_playerSprite.getPosition().y + 1));
}

void kengine::Player::movePlayer(sf::Vector2f position)
{
m_playerSprite.setPosition(position);
}

void kengine::Player::setSize(int width, int height)
{
m_playerWidth = width;
m_playerHeight = height;

m_playerSprite.setScale(m_playerWidth / m_imageSize.x, m_playerHeight / m_imageSize.y);
#include "Player.h"

kengine::Player::Player()
{
m_playerSprite.setColor(sf::Color(0, 255, 0, 255));

m_imageSize.x = m_playerSprite.getLocalBounds().width;
m_imageSize.y = m_playerSprite.getLocalBounds().height;
}

kengine::Player::Player(std::string imagePath, float factorX, float factorY)
{
if (!m_playerTexture.loadFromFile(imagePath))
{
//Couldn't load texture from file
}

m_playerSprite.setTexture(m_playerTexture);
m_playerSprite.setScale(factorX, factorY);

m_imageSize.x = m_playerSprite.getLocalBounds().width;
m_imageSize.y = m_playerSprite.getLocalBounds().height;
}

kengine::Player::~Player()
{

}

void kengine::Player::checkInput()
{
if (sf::Keyboard::isKeyPressed(sf::Keyboard::A)) movePlayer(sf::Vector2f(m_playerSprite.getPosition().x - 1, m_playerSprite.getPosition().y));
if (sf::Keyboard::isKeyPressed(sf::Keyboard::D)) movePlayer(sf::Vector2f(m_playerSprite.getPosition().x + 1, m_playerSprite.getPosition().y));
if (sf::Keyboard::isKeyPressed(sf::Keyboard::W)) movePlayer(sf::Vector2f(m_playerSprite.getPosition().x, m_playerSprite.getPosition().y - 1));
if (sf::Keyboard::isKeyPressed(sf::Keyboard::S)) movePlayer(sf::Vector2f(m_playerSprite.getPosition().x, m_playerSprite.getPosition().y + 1));
}

void kengine::Player::movePlayer(sf::Vector2f position)
{
m_playerSprite.setPosition(position);
}

void kengine::Player::setSize(int width, int height)
{
m_playerWidth = width;
m_playerHeight = height;

m_playerSprite.setScale(m_playerWidth / m_imageSize.x, m_playerHeight / m_imageSize.y);
}
@@ -1,30 +1,31 @@
#pragma once
#include "SFML/Window.hpp"
#include "SFML/Graphics.hpp"
#include <iostream>

namespace kengine {

class Player
{
public:
Player();
Player(std::string imagePath, float factorX, float factorY);
~Player();

void checkInput();
void movePlayer(sf::Vector2f position);

sf::Sprite getPlayerSprite() { return m_playerSprite; }
sf::Vector2f getSize() { return sf::Vector2f(m_playerSprite.getGlobalBounds().width, m_playerSprite.getGlobalBounds().height); }
void setSize(int width, int height);

private:
sf::Sprite m_playerSprite;
sf::Texture m_playerTexture;
int m_playerWidth, m_playerHeight;
sf::Vector2f m_imageSize;

};

#pragma once
#include "SFML/Window.hpp"
#include "SFML/Graphics.hpp"
#include <iostream>

namespace kengine
{

class Player
{
public:
Player();
Player(std::string imagePath, float factorX, float factorY);
~Player();

void checkInput();
void movePlayer(sf::Vector2f position);

sf::Sprite getPlayerSprite() { return m_playerSprite; }
sf::Vector2f getSize() { return sf::Vector2f(m_playerSprite.getGlobalBounds().width, m_playerSprite.getGlobalBounds().height); }
void setSize(int width, int height);

private:
sf::Sprite m_playerSprite;
sf::Texture m_playerTexture;
int m_playerWidth = 0, m_playerHeight = 0;
sf::Vector2f m_imageSize;

};

}
@@ -1,2 +1,22 @@
 main.cpp
c:\users\admin\documents\edward\kengine\kengine\main.cpp(1): fatal error C1083: Cannot open include file: 'SFML/Graphics.hpp': No such file or directory
Build started 2016-02-01 21:27:10.
1>Project "C:\Users\user\Documents\Kengine\Kengine\Kengine.vcxproj" on node 2 (Build target(s)).
1>ClCompile:
D:\Microsoft Visual Studio\VC\bin\x86_amd64\CL.exe /c /ZI /nologo /W3 /WX- /sdl /Od /D _MBCS /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"x64\Debug\\" /Fd"x64\Debug\vc140.pdb" /Gd /TP /errorReport:prompt app\Game.cpp app\GameState.cpp app\window.cpp gameStates\testState.cpp main.cpp player\Player.cpp
Player.cpp
1>c:\users\user\documents\kengine\kengine\player\player.h(2): fatal error C1083: Cannot open include file: 'SFML/Window.hpp': No such file or directory
main.cpp
1>c:\users\user\documents\kengine\kengine\main.cpp(1): fatal error C1083: Cannot open include file: 'SFML/Graphics.hpp': No such file or directory
testState.cpp
1>c:\users\user\documents\kengine\kengine\app\window.h(3): fatal error C1083: Cannot open include file: 'SFML/Graphics.hpp': No such file or directory
window.cpp
1>c:\users\user\documents\kengine\kengine\app\window.h(3): fatal error C1083: Cannot open include file: 'SFML/Graphics.hpp': No such file or directory
GameState.cpp
1>c:\users\user\documents\kengine\kengine\app\window.h(3): fatal error C1083: Cannot open include file: 'SFML/Graphics.hpp': No such file or directory
Game.cpp
1>c:\users\user\documents\kengine\kengine\app\window.h(3): fatal error C1083: Cannot open include file: 'SFML/Graphics.hpp': No such file or directory
Generating Code...
1>Done Building Project "C:\Users\user\Documents\Kengine\Kengine\Kengine.vcxproj" (Build target(s)) -- FAILED.

Build FAILED.

Time Elapsed 00:00:02.26
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
Debug|x64|C:\Users\Admin\Documents\EDWARD\Kengine\|
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit
Debug|x64|C:\Users\user\Documents\Kengine\|
BIN +120 KB (730%) Kengine/x64/Debug/vc140.idb
Binary file not shown.
BIN +104 KB (390%) Kengine/x64/Debug/vc140.pdb
Binary file not shown.
@@ -1,2 +1,2 @@
# Kengine
Kengine is a engine using SFML with others...
# Kengine
Kengine is a engine using SFML with others...
@@ -1,2 +1,2 @@
* Texture and sprites: http://www.sfml-dev.org/tutorials/2.0/graphics-sprite.php
* Texture and sprites: http://www.sfml-dev.org/tutorials/2.0/graphics-sprite.php
* Look up a proper game loop and try to integrate.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.