Hey it's not working but I wanna sleep

main
Braydon Kains 6 years ago
parent eb3f1163aa
commit 44da525a5e

@ -1,155 +1,169 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|x64"> <ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion> <VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{8A067FEB-7D3A-45FB-BED3-77A1965E41D8}</ProjectGuid> <ProjectGuid>{8A067FEB-7D3A-45FB-BED3-77A1965E41D8}</ProjectGuid>
<RootNamespace>Assignment3Project</RootNamespace> <RootNamespace>Assignment3Project</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
<ImportGroup Label="Shared"> <ImportGroup Label="Shared">
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <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" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <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" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <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" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <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" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Allegro_AddonImage>true</Allegro_AddonImage> <Allegro_AddonImage>true</Allegro_AddonImage>
<Allegro_AddonTTF>true</Allegro_AddonTTF> <Allegro_AddonTTF>true</Allegro_AddonTTF>
<Allegro_AddonPrimitives>true</Allegro_AddonPrimitives> <Allegro_AddonPrimitives>true</Allegro_AddonPrimitives>
<Allegro_AddonAudio>true</Allegro_AddonAudio> <Allegro_AddonAudio>true</Allegro_AddonAudio>
<Allegro_AddonAcodec>true</Allegro_AddonAcodec> <Allegro_AddonAcodec>true</Allegro_AddonAcodec>
<Allegro_AddonFont>true</Allegro_AddonFont> <Allegro_AddonFont>true</Allegro_AddonFont>
<Allegro_AddonColor>true</Allegro_AddonColor> <Allegro_AddonColor>true</Allegro_AddonColor>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile> <Allegro_AddonImage>true</Allegro_AddonImage>
<WarningLevel>Level3</WarningLevel> <Allegro_AddonTTF>true</Allegro_AddonTTF>
<Optimization>Disabled</Optimization> <Allegro_AddonPrimitives>true</Allegro_AddonPrimitives>
<SDLCheck>true</SDLCheck> <Allegro_AddonAudio>true</Allegro_AddonAudio>
<ConformanceMode>true</ConformanceMode> <Allegro_AddonAcodec>true</Allegro_AddonAcodec>
</ClCompile> <Allegro_AddonFont>true</Allegro_AddonFont>
</ItemDefinitionGroup> <Allegro_AddonColor>true</Allegro_AddonColor>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> </PropertyGroup>
<ClCompile> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<WarningLevel>Level3</WarningLevel> <ClCompile>
<Optimization>Disabled</Optimization> <WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck> <Optimization>Disabled</Optimization>
<ConformanceMode>true</ConformanceMode> <SDLCheck>true</SDLCheck>
</ClCompile> <ConformanceMode>true</ConformanceMode>
</ItemDefinitionGroup> </ClCompile>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> </ItemDefinitionGroup>
<ClCompile> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<WarningLevel>Level3</WarningLevel> <ClCompile>
<Optimization>MaxSpeed</Optimization> <WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking> <Optimization>Disabled</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions> <SDLCheck>true</SDLCheck>
<SDLCheck>true</SDLCheck> <ConformanceMode>true</ConformanceMode>
<ConformanceMode>true</ConformanceMode> </ClCompile>
</ClCompile> <Link>
<Link> <SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding> </Link>
<OptimizeReferences>true</OptimizeReferences> </ItemDefinitionGroup>
</Link> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</ItemDefinitionGroup> <ClCompile>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <WarningLevel>Level3</WarningLevel>
<ClCompile> <Optimization>MaxSpeed</Optimization>
<WarningLevel>Level3</WarningLevel> <FunctionLevelLinking>true</FunctionLevelLinking>
<Optimization>MaxSpeed</Optimization> <IntrinsicFunctions>true</IntrinsicFunctions>
<FunctionLevelLinking>true</FunctionLevelLinking> <SDLCheck>true</SDLCheck>
<IntrinsicFunctions>true</IntrinsicFunctions> <ConformanceMode>true</ConformanceMode>
<SDLCheck>true</SDLCheck> </ClCompile>
<ConformanceMode>true</ConformanceMode> <Link>
</ClCompile> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<Link> <OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding> </Link>
<OptimizeReferences>true</OptimizeReferences> </ItemDefinitionGroup>
</Link> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</ItemDefinitionGroup> <ClCompile>
<ItemGroup> <WarningLevel>Level3</WarningLevel>
<ClInclude Include="cursor.h" /> <Optimization>MaxSpeed</Optimization>
<ClInclude Include="enums.h" /> <FunctionLevelLinking>true</FunctionLevelLinking>
<ClInclude Include="game.h" /> <IntrinsicFunctions>true</IntrinsicFunctions>
<ClInclude Include="game_screen.h" /> <SDLCheck>true</SDLCheck>
<ClInclude Include="screen.h" /> <ConformanceMode>true</ConformanceMode>
<ClInclude Include="start_screen.h" /> </ClCompile>
</ItemGroup> <Link>
<ItemGroup> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<ClCompile Include="cursor.cpp" /> <OptimizeReferences>true</OptimizeReferences>
<ClCompile Include="game.cpp" /> </Link>
<ClCompile Include="game_screen.cpp" /> </ItemDefinitionGroup>
<ClCompile Include="main.cpp" /> <ItemGroup>
<ClCompile Include="start_screen.cpp" /> <ClInclude Include="cursor.h" />
</ItemGroup> <ClInclude Include="enums.h" />
<ItemGroup> <ClInclude Include="game.h" />
<None Include="packages.config" /> <ClInclude Include="game_screen.h" />
</ItemGroup> <ClInclude Include="screen.h" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ClInclude Include="ship.h" />
<ImportGroup Label="ExtensionTargets"> <ClInclude Include="start_screen.h" />
<Import Project="..\packages\AllegroDeps.1.7.0.0\build\native\AllegroDeps.targets" Condition="Exists('..\packages\AllegroDeps.1.7.0.0\build\native\AllegroDeps.targets')" /> </ItemGroup>
<Import Project="..\packages\Allegro.5.2.4.0\build\native\Allegro.targets" Condition="Exists('..\packages\Allegro.5.2.4.0\build\native\Allegro.targets')" /> <ItemGroup>
</ImportGroup> <ClCompile Include="cursor.cpp" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <ClCompile Include="game.cpp" />
<PropertyGroup> <ClCompile Include="game_screen.cpp" />
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ClCompile Include="main.cpp" />
</PropertyGroup> <ClCompile Include="ship.cpp" />
<Error Condition="!Exists('..\packages\AllegroDeps.1.7.0.0\build\native\AllegroDeps.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\AllegroDeps.1.7.0.0\build\native\AllegroDeps.targets'))" /> <ClCompile Include="start_screen.cpp" />
<Error Condition="!Exists('..\packages\Allegro.5.2.4.0\build\native\Allegro.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Allegro.5.2.4.0\build\native\Allegro.targets'))" /> </ItemGroup>
</Target> <ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\AllegroDeps.1.7.0.0\build\native\AllegroDeps.targets" Condition="Exists('..\packages\AllegroDeps.1.7.0.0\build\native\AllegroDeps.targets')" />
<Import Project="..\packages\Allegro.5.2.4.0\build\native\Allegro.targets" Condition="Exists('..\packages\Allegro.5.2.4.0\build\native\Allegro.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\AllegroDeps.1.7.0.0\build\native\AllegroDeps.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\AllegroDeps.1.7.0.0\build\native\AllegroDeps.targets'))" />
<Error Condition="!Exists('..\packages\Allegro.5.2.4.0\build\native\Allegro.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Allegro.5.2.4.0\build\native\Allegro.targets'))" />
</Target>
</Project> </Project>

@ -1,75 +1,81 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Filter Include="Source Files"> <Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter> </Filter>
<Filter Include="Header Files"> <Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions> <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
</Filter> </Filter>
<Filter Include="Resource Files"> <Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> <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> <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter> </Filter>
<Filter Include="Header Files\Engine"> <Filter Include="Header Files\Engine">
<UniqueIdentifier>{b3cfe90b-396f-4928-8b95-6b453c9cdee6}</UniqueIdentifier> <UniqueIdentifier>{b3cfe90b-396f-4928-8b95-6b453c9cdee6}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="Header Files\Screens"> <Filter Include="Header Files\Screens">
<UniqueIdentifier>{079f6f25-ed43-4671-bb66-1a1c580b5f6b}</UniqueIdentifier> <UniqueIdentifier>{079f6f25-ed43-4671-bb66-1a1c580b5f6b}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="Header Files\Assignment3"> <Filter Include="Header Files\Assignment3">
<UniqueIdentifier>{e9904f71-fa80-4ab4-a0ee-7fc1c8c3f92e}</UniqueIdentifier> <UniqueIdentifier>{e9904f71-fa80-4ab4-a0ee-7fc1c8c3f92e}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="Source Files\EngineImplement"> <Filter Include="Source Files\EngineImplement">
<UniqueIdentifier>{60b0cc02-34f3-4b2f-a55d-aae1f622f730}</UniqueIdentifier> <UniqueIdentifier>{60b0cc02-34f3-4b2f-a55d-aae1f622f730}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="Source Files\ScreensImplement"> <Filter Include="Source Files\ScreensImplement">
<UniqueIdentifier>{df34ca78-eaef-42da-84e1-e081ee065499}</UniqueIdentifier> <UniqueIdentifier>{df34ca78-eaef-42da-84e1-e081ee065499}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="Source Files\Assignment3Implement"> <Filter Include="Source Files\Assignment3Implement">
<UniqueIdentifier>{d177d104-1e60-4cd4-81d4-232c379ac302}</UniqueIdentifier> <UniqueIdentifier>{d177d104-1e60-4cd4-81d4-232c379ac302}</UniqueIdentifier>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="cursor.h"> <ClInclude Include="cursor.h">
<Filter>Header Files\Engine</Filter> <Filter>Header Files\Engine</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="game.h"> <ClInclude Include="game.h">
<Filter>Header Files\Engine</Filter> <Filter>Header Files\Engine</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="game_screen.h"> <ClInclude Include="game_screen.h">
<Filter>Header Files\Screens</Filter> <Filter>Header Files\Screens</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="screen.h"> <ClInclude Include="screen.h">
<Filter>Header Files\Engine</Filter> <Filter>Header Files\Engine</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="enums.h"> <ClInclude Include="enums.h">
<Filter>Header Files\Assignment3</Filter> <Filter>Header Files\Assignment3</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="start_screen.h"> <ClInclude Include="start_screen.h">
<Filter>Header Files\Screens</Filter> <Filter>Header Files\Screens</Filter>
</ClInclude> </ClInclude>
</ItemGroup> <ClInclude Include="ship.h">
<ItemGroup> <Filter>Header Files\Assignment3</Filter>
<ClCompile Include="main.cpp"> </ClInclude>
<Filter>Source Files</Filter> </ItemGroup>
</ClCompile> <ItemGroup>
<ClCompile Include="game_screen.cpp"> <ClCompile Include="main.cpp">
<Filter>Source Files\ScreensImplement</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="cursor.cpp"> <ClCompile Include="game_screen.cpp">
<Filter>Source Files\EngineImplement</Filter> <Filter>Source Files\ScreensImplement</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="game.cpp"> <ClCompile Include="cursor.cpp">
<Filter>Source Files\EngineImplement</Filter> <Filter>Source Files\EngineImplement</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="start_screen.cpp"> <ClCompile Include="game.cpp">
<Filter>Source Files\ScreensImplement</Filter> <Filter>Source Files\EngineImplement</Filter>
</ClCompile> </ClCompile>
</ItemGroup> <ClCompile Include="start_screen.cpp">
<ItemGroup> <Filter>Source Files\ScreensImplement</Filter>
<None Include="packages.config" /> </ClCompile>
</ItemGroup> <ClCompile Include="ship.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project> </Project>

@ -0,0 +1,19 @@
#include "bullet.h"
Bullet::Bullet() {
speed = 1.0;
height = 20;
width = 5;
}
void Bullet::reset_pos(float x, float y) {
x_pos = x;
y_pos = y;
}
void Bullet::draw() {
al_draw_filled_rectangle(x_pos, y_pos, x_pos + width, y_pos + height, al_map_rgb(0,0,0));
}
void Bullet::move(Direction dir) {
}

@ -0,0 +1,14 @@
#pragma once
#include <allegro5/allegro.h>
#include <allegro5/allegro_primitives.h>
#include "game_element.h"
class Bullet : public GameElement {
public:
Bullet();
void reset_pos(float x, float y);
void draw();
void move(Direction dir);
};

@ -5,4 +5,15 @@ enum State {
Gameplay, Gameplay,
End, End,
Exit Exit
};
enum Direction {
U,
D,
L,
R,
UR,
UL,
DR,
DL
}; };

@ -1,6 +1,4 @@
#include "game.h" #include "game.h"
#include "start_screen.h"
#include "game_screen.h"
using std::string; using std::string;
using std::map; using std::map;
@ -13,12 +11,13 @@ Game::Game() {
void Game::init() { void Game::init() {
score = 0; score = 0;
state = Start; state = Start;
//sprites.insert(pair<string, ALLEGRO_BITMAP*>("Title", al_load_bitmap("logo.bmp"))); sprites.insert(pair<string, ALLEGRO_BITMAP*>("Ship", al_load_bitmap("placeholder.bmp")));
//al_reserve_samples(4); //al_reserve_samples(4);
//samples.insert(pair<string, ALLEGRO_SAMPLE*>("Theme", al_load_sample("rasputin.wav"))); //samples.insert(pair<string, ALLEGRO_SAMPLE*>("Theme", al_load_sample("rasputin.wav")));
font = al_create_builtin_font(); font = al_create_builtin_font();
} }
@ -30,7 +29,22 @@ void Game::reset() {
//Run the game state machine //Run the game state machine
void Game::run() { void Game::run() {
//Load screens //Load screens
StartScreen start_screen(sprites);
GameScreen game_screen(sprites, samples);
while (state != Exit) {
switch (state) {
case Start:
start_screen.run(font);
state = start_screen.next_state;
break;
case Gameplay:
game_screen.reset();
game_screen.run(font);
state = start_screen.next_state;
break;
}
}
//Garbage collection //Garbage collection
map<string, ALLEGRO_BITMAP*>::iterator it; map<string, ALLEGRO_BITMAP*>::iterator it;

@ -11,7 +11,8 @@
#include <map> #include <map>
#include "enums.h" #include "enums.h"
#include "screen.h" #include "start_screen.h"
#include "game_screen.h"
//Game state machine, contains data global to game //Game state machine, contains data global to game
class Game { class Game {

@ -0,0 +1,16 @@
#pragma once
#include "enums.h"
class GameElement {
public:
float x_pos;
float y_pos;
float speed;
int height;
int width;
virtual void reset_pos(float x, float y) = 0;
virtual void move() = 0;
virtual void draw(Direction dir) = 0;
};

@ -20,7 +20,7 @@ using std::map;
using std::pair; using std::pair;
enum KEYS { enum KEYS {
KEYUP, KEYDOWN, KEYSPACE, KEYCTRL, KEYH, KEYM, KEYESC KEYUP, KEYDOWN, KEYLEFT, KEYRIGHT, KEYSPACE, KEYCTRL, KEYH, KEYM, KEYESC
}; };
GameScreen::GameScreen(std::map<std::string, ALLEGRO_BITMAP*> _sprites, std::map<std::string, ALLEGRO_SAMPLE*> _samples) { GameScreen::GameScreen(std::map<std::string, ALLEGRO_BITMAP*> _sprites, std::map<std::string, ALLEGRO_SAMPLE*> _samples) {
@ -30,8 +30,9 @@ GameScreen::GameScreen(std::map<std::string, ALLEGRO_BITMAP*> _sprites, std::map
} }
//Resets game to default values, and uses new given values //Resets game to default values, and uses new given values
void GameScreen::reset(int _lines, int _max_catchers, int _difficulty) { void GameScreen::reset() {
ship.set_sprite(sprites["Ship"]);
ship.reset_pos(SCREEN_W / 2, SCREEN_H / 8);
} }
//If a sample needs to be played while it is still being played, it will be stopped first. //If a sample needs to be played while it is still being played, it will be stopped first.
@ -50,7 +51,7 @@ void GameScreen::run(ALLEGRO_FONT* font) {
al_register_event_source(event_queue, al_get_keyboard_event_source()); al_register_event_source(event_queue, al_get_keyboard_event_source());
ALLEGRO_TIMER* timer = NULL; ALLEGRO_TIMER* timer = NULL;
timer = al_create_timer(1.0 / FPS); //Universally a "tick" in the context of the game is 1/10 of a second. timer = al_create_timer(1.0 / FPS);
al_register_event_source(event_queue, al_get_timer_event_source(timer)); al_register_event_source(event_queue, al_get_timer_event_source(timer));
redraw(font); redraw(font);
@ -64,10 +65,40 @@ void GameScreen::run(ALLEGRO_FONT* font) {
while (!exit_screen) { while (!exit_screen) {
ALLEGRO_EVENT ev; ALLEGRO_EVENT ev;
al_wait_for_event(event_queue, &ev); al_wait_for_event(event_queue, &ev);
if (ev.type == ALLEGRO_EVENT_TIMER) { if (ev.type == ALLEGRO_EVENT_TIMER) { //Check per frame
if (keys[KEYUP]) { if (keys[KEYUP]) {
//Up is pressed! if (keys[KEYRIGHT]) {
ship.move(UR);
}
else if (keys[KEYLEFT]) {
ship.move(UL);
}
else {
ship.move(U);
}
} }
else if (keys[KEYDOWN]) {
if (keys[KEYRIGHT]) {
ship.move(DR);
}
else if (keys[KEYLEFT]) {
ship.move(DL);
}
else {
ship.move(D);
}
}
else if (keys[KEYLEFT]) {
ship.move(L);
}
else if (keys[KEYRIGHT]) {
ship.move(R);
}
//Global refresh
al_clear_to_color(al_map_rgb(0, 0, 0));
redraw(font);
al_flip_display();
} }
if (ev.type == ALLEGRO_EVENT_KEY_DOWN) { if (ev.type == ALLEGRO_EVENT_KEY_DOWN) {
switch (ev.keyboard.keycode) { switch (ev.keyboard.keycode) {
@ -77,6 +108,12 @@ void GameScreen::run(ALLEGRO_FONT* font) {
case ALLEGRO_KEY_UP: case ALLEGRO_KEY_UP:
keys[KEYUP] = true; keys[KEYUP] = true;
break; break;
case ALLEGRO_KEY_RIGHT:
keys[KEYRIGHT] = true;
break;
case ALLEGRO_KEY_LEFT:
keys[KEYLEFT] = true;
break;
case ALLEGRO_KEY_SPACE: case ALLEGRO_KEY_SPACE:
keys[KEYSPACE] = true; keys[KEYSPACE] = true;
break; break;
@ -94,36 +131,38 @@ void GameScreen::run(ALLEGRO_FONT* font) {
keys[KEYCTRL] = true; keys[KEYCTRL] = true;
break; break;
} }
if (ev.type == ALLEGRO_EVENT_KEY_UP) { }
switch (ev.keyboard.keycode) { else if (ev.type == ALLEGRO_EVENT_KEY_UP) {
case ALLEGRO_KEY_DOWN: switch (ev.keyboard.keycode) {
keys[KEYDOWN] = false; case ALLEGRO_KEY_DOWN:
break; keys[KEYDOWN] = false;
case ALLEGRO_KEY_UP: break;
keys[KEYUP] = false; case ALLEGRO_KEY_UP:
break; keys[KEYUP] = false;
case ALLEGRO_KEY_SPACE: break;
keys[KEYSPACE] = false; case ALLEGRO_KEY_RIGHT:
break; keys[KEYRIGHT] = false;
case ALLEGRO_KEY_M: break;
keys[KEYM] = false; case ALLEGRO_KEY_LEFT:
break; keys[KEYLEFT] = false;
case ALLEGRO_KEY_H: break;
keys[KEYH] = false; case ALLEGRO_KEY_SPACE:
break; keys[KEYSPACE] = false;
case ALLEGRO_KEY_ESCAPE: break;
keys[KEYESC] = false; case ALLEGRO_KEY_M:
break; keys[KEYM] = false;
case ALLEGRO_KEY_LCTRL: break;
case ALLEGRO_KEY_RCTRL: case ALLEGRO_KEY_H:
keys[KEYCTRL] = false; keys[KEYH] = false;
break; break;
} case ALLEGRO_KEY_ESCAPE:
keys[KEYESC] = false;
break;
case ALLEGRO_KEY_LCTRL:
case ALLEGRO_KEY_RCTRL:
keys[KEYCTRL] = false;
break;
} }
//Global refresh
al_clear_to_color(al_map_rgb(0, 0, 0));
redraw(font);
al_flip_display();
} }
} }
if (next_state != Exit) { //If the game loop was exited naturally rather than forced by Esc if (next_state != Exit) { //If the game loop was exited naturally rather than forced by Esc
@ -137,7 +176,7 @@ void GameScreen::run(ALLEGRO_FONT* font) {
//Redraw all elements of the screen //Redraw all elements of the screen
void GameScreen::redraw(ALLEGRO_FONT* font) { void GameScreen::redraw(ALLEGRO_FONT* font) {
ship.draw();
} }
void GameScreen::back() { void GameScreen::back() {

@ -1,23 +1,24 @@
#pragma once #pragma once
#include <allegro5/allegro.h> #include <allegro5/allegro.h>
#include <allegro5/allegro_audio.h> #include <allegro5/allegro_audio.h>
#include "screen.h" #include "screen.h"
#include "ship.h"
//Main screen for gameplay //Main screen for gameplay
class GameScreen : public Screen { class GameScreen : public Screen {
public: public:
std::map<std::string, ALLEGRO_BITMAP*> sprites; std::map<std::string, ALLEGRO_BITMAP*> sprites;
std::map<std::string, ALLEGRO_SAMPLE*> samples; std::map<std::string, ALLEGRO_SAMPLE*> samples;
unsigned int selected;
int max_catchers;
int catchers;
int score; int score;
int difficulty; int level;
bool music; bool music;
Ship ship;
GameScreen(std::map<std::string, ALLEGRO_BITMAP*> _sprites, std::map<std::string, ALLEGRO_SAMPLE*> _samples); GameScreen(std::map<std::string, ALLEGRO_BITMAP*> _sprites, std::map<std::string, ALLEGRO_SAMPLE*> _samples);
void reset(int _lines, int _max_catchers, int _difficulty); void reset();
void run(ALLEGRO_FONT* font); void run(ALLEGRO_FONT* font);
void redraw(ALLEGRO_FONT* font); void redraw(ALLEGRO_FONT* font);
void back(); void back();

@ -27,6 +27,9 @@ int main() {
if (!al_install_keyboard()) { if (!al_install_keyboard()) {
fprintf(stderr, "Could not install keyboard!"); fprintf(stderr, "Could not install keyboard!");
} }
if (!al_init_primitives_addon()) {
fprintf(stderr, "Could not initialize primitives addon!");
}
ALLEGRO_DISPLAY* display = NULL; ALLEGRO_DISPLAY* display = NULL;
display = al_create_display(SCREEN_W, SCREEN_H); display = al_create_display(SCREEN_W, SCREEN_H);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

@ -0,0 +1,58 @@
#include "ship.h"
Ship::Ship() {
speed = 1.0;
height = 40;
width = 40;
}
void Ship::reset_pos(float x, float y) {
x_pos = x;
y_pos = y;
}
void Ship::set_sprite(ALLEGRO_BITMAP* _sprite) {
sprite = _sprite;
}
void Ship::draw() {
al_draw_bitmap(sprite, x_pos, y_pos, NULL);
}
void Ship::move(Direction dir) {
float factor = 4 * speed;
switch (dir) {
case U:
y_pos -= factor;
break;
case D:
y_pos += factor;
break;
case R:
x_pos += factor;
break;
case L:
x_pos -= factor;
break;
case UR:
x_pos += factor;
y_pos -= factor;
break;
case UL:
x_pos -= factor;
y_pos -= factor;
break;
case DR:
x_pos += factor;
y_pos += factor;
break;
case DL:
x_pos -= factor;
y_pos += factor;
break;
}
}
void Ship::fire() {
}

@ -0,0 +1,18 @@
#pragma once
#include <allegro5/allegro.h>
#include "enums.h"
#include "game_element.h"
class Ship : public GameElement {
public:
ALLEGRO_BITMAP* sprite;
Ship();
void reset_pos(float x, float y);
void set_sprite(ALLEGRO_BITMAP* _sprite);
void draw();
void move(Direction dir);
void fire();
};

@ -64,12 +64,14 @@ void StartScreen::run(ALLEGRO_FONT * font) {
void StartScreen::redraw(ALLEGRO_FONT* font) { void StartScreen::redraw(ALLEGRO_FONT* font) {
//al_draw_bitmap(sprites["Title"], SCREEN_W / 2 - 240, 20, NULL); //logo //al_draw_bitmap(sprites["Title"], SCREEN_W / 2 - 240, 20, NULL); //logo
//Instructions
al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2, SCREEN_H / 2 + 10, ALLEGRO_ALIGN_CENTER, "Mr. Manager wants to run a teambuilding exercise for his employees.");
al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2, SCREEN_H / 2 + 20, ALLEGRO_ALIGN_CENTER, "Help Mr.Manager place his 5 catchers at the end of his");
al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2, SCREEN_H / 2 + 30, ALLEGRO_ALIGN_CENTER, "conveyor belts to make sure no other employees fall off.");
al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2, SCREEN_H / 2 + 40, ALLEGRO_ALIGN_CENTER, "Try to catch enough to help the team bond!");
//Instructions
al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2, SCREEN_H / 2 + 10, ALLEGRO_ALIGN_CENTER, "This is going to be a shootemup.");
al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2, SCREEN_H / 2 + 20, ALLEGRO_ALIGN_CENTER, "Eventually.");
al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2, SCREEN_H / 2 + 30, ALLEGRO_ALIGN_CENTER, "We'll see.");
al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2, SCREEN_H / 2 + 40, ALLEGRO_ALIGN_CENTER, "idek.");
/*
//Keys and their associated functions //Keys and their associated functions
al_draw_bitmap(sprites["KeyUp"], SCREEN_W / 8, SCREEN_H / 2 + 60, NULL); al_draw_bitmap(sprites["KeyUp"], SCREEN_W / 8, SCREEN_H / 2 + 60, NULL);
al_draw_bitmap(sprites["KeyUp"], SCREEN_W / 8 + 34, SCREEN_H / 2 + 60, ALLEGRO_FLIP_VERTICAL); al_draw_bitmap(sprites["KeyUp"], SCREEN_W / 8 + 34, SCREEN_H / 2 + 60, ALLEGRO_FLIP_VERTICAL);
@ -92,6 +94,7 @@ void StartScreen::redraw(ALLEGRO_FONT* font) {
al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2 + 70, SCREEN_H / 2 + 110, ALLEGRO_ALIGN_LEFT, "+"); al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2 + 70, SCREEN_H / 2 + 110, ALLEGRO_ALIGN_LEFT, "+");
al_draw_bitmap(sprites["KeyM"], SCREEN_W / 2 + 78, SCREEN_H / 2 + 100, NULL); al_draw_bitmap(sprites["KeyM"], SCREEN_W / 2 + 78, SCREEN_H / 2 + 100, NULL);
al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2 + 113, SCREEN_H / 1.3 - 20, ALLEGRO_ALIGN_LEFT, "Toggle Music"); al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2 + 113, SCREEN_H / 1.3 - 20, ALLEGRO_ALIGN_LEFT, "Toggle Music");
*/
al_draw_text(font, al_map_rgb(255, 255, 255), 0, SCREEN_H - 10, ALLEGRO_ALIGN_LEFT, "Copyright 2019 Braydon Kains"); al_draw_text(font, al_map_rgb(255, 255, 255), 0, SCREEN_H - 10, ALLEGRO_ALIGN_LEFT, "Copyright 2019 Braydon Kains");
} }

Binary file not shown.
Loading…
Cancel
Save