From 2a355a51ba49298ef994ef233c40c087cadb60d0 Mon Sep 17 00:00:00 2001 From: Braydon Kains Date: Mon, 31 Dec 2018 03:13:16 -0500 Subject: [PATCH] Start Screen and art completed --- TrustFall/TrustFall.sln | 31 ++++ TrustFall/TrustFall/Assets/MrMan.bmp | Bin 0 -> 1738 bytes TrustFall/TrustFall/Assets/MrMan2.bmp | Bin 0 -> 4922 bytes .../TrustFall/Assets/MrMcPlaceholder.bmp | Bin 0 -> 306 bytes TrustFall/TrustFall/Assets/logo.bmp | Bin 0 -> 216056 bytes TrustFall/TrustFall/MrMan.bmp | Bin 0 -> 4922 bytes TrustFall/TrustFall/MrManager.bmp | Bin 0 -> 4922 bytes TrustFall/TrustFall/TrustFall.vcxproj | 156 ++++++++++++++++++ TrustFall/TrustFall/TrustFall.vcxproj.filters | 66 ++++++++ TrustFall/TrustFall/cursor.cpp | 102 ++++++++++++ TrustFall/TrustFall/cursor.h | 29 ++++ TrustFall/TrustFall/enums.h | 12 ++ TrustFall/TrustFall/game.cpp | 38 +++++ TrustFall/TrustFall/game.h | 31 ++++ TrustFall/TrustFall/game_screen.cpp | 42 +++++ TrustFall/TrustFall/game_screen.h | 15 ++ TrustFall/TrustFall/key_up.bmp | Bin 0 -> 10922 bytes TrustFall/TrustFall/logo.bmp | Bin 0 -> 216056 bytes TrustFall/TrustFall/main.cpp | 61 +++++++ TrustFall/TrustFall/packages.config | 5 + TrustFall/TrustFall/screen.h | 19 +++ TrustFall/TrustFall/small_key_up.bmp | Bin 0 -> 2882 bytes TrustFall/TrustFall/spacebar.bmp | Bin 0 -> 2882 bytes TrustFall/TrustFall/start_screen.cpp | 85 ++++++++++ TrustFall/TrustFall/start_screen.h | 16 ++ 25 files changed, 708 insertions(+) create mode 100644 TrustFall/TrustFall.sln create mode 100644 TrustFall/TrustFall/Assets/MrMan.bmp create mode 100644 TrustFall/TrustFall/Assets/MrMan2.bmp create mode 100644 TrustFall/TrustFall/Assets/MrMcPlaceholder.bmp create mode 100644 TrustFall/TrustFall/Assets/logo.bmp create mode 100644 TrustFall/TrustFall/MrMan.bmp create mode 100644 TrustFall/TrustFall/MrManager.bmp create mode 100644 TrustFall/TrustFall/TrustFall.vcxproj create mode 100644 TrustFall/TrustFall/TrustFall.vcxproj.filters create mode 100644 TrustFall/TrustFall/cursor.cpp create mode 100644 TrustFall/TrustFall/cursor.h create mode 100644 TrustFall/TrustFall/enums.h create mode 100644 TrustFall/TrustFall/game.cpp create mode 100644 TrustFall/TrustFall/game.h create mode 100644 TrustFall/TrustFall/game_screen.cpp create mode 100644 TrustFall/TrustFall/game_screen.h create mode 100644 TrustFall/TrustFall/key_up.bmp create mode 100644 TrustFall/TrustFall/logo.bmp create mode 100644 TrustFall/TrustFall/main.cpp create mode 100644 TrustFall/TrustFall/packages.config create mode 100644 TrustFall/TrustFall/screen.h create mode 100644 TrustFall/TrustFall/small_key_up.bmp create mode 100644 TrustFall/TrustFall/spacebar.bmp create mode 100644 TrustFall/TrustFall/start_screen.cpp create mode 100644 TrustFall/TrustFall/start_screen.h diff --git a/TrustFall/TrustFall.sln b/TrustFall/TrustFall.sln new file mode 100644 index 0000000..caf1981 --- /dev/null +++ b/TrustFall/TrustFall.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27703.2042 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TrustFall", "TrustFall\TrustFall.vcxproj", "{C6900ECF-254F-4751-A968-DDA699CCD5A6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C6900ECF-254F-4751-A968-DDA699CCD5A6}.Debug|x64.ActiveCfg = Debug|x64 + {C6900ECF-254F-4751-A968-DDA699CCD5A6}.Debug|x64.Build.0 = Debug|x64 + {C6900ECF-254F-4751-A968-DDA699CCD5A6}.Debug|x86.ActiveCfg = Debug|Win32 + {C6900ECF-254F-4751-A968-DDA699CCD5A6}.Debug|x86.Build.0 = Debug|Win32 + {C6900ECF-254F-4751-A968-DDA699CCD5A6}.Release|x64.ActiveCfg = Release|x64 + {C6900ECF-254F-4751-A968-DDA699CCD5A6}.Release|x64.Build.0 = Release|x64 + {C6900ECF-254F-4751-A968-DDA699CCD5A6}.Release|x86.ActiveCfg = Release|Win32 + {C6900ECF-254F-4751-A968-DDA699CCD5A6}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {33B495B4-3A19-4588-AA7F-6E664C8E0C19} + EndGlobalSection +EndGlobal diff --git a/TrustFall/TrustFall/Assets/MrMan.bmp b/TrustFall/TrustFall/Assets/MrMan.bmp new file mode 100644 index 0000000000000000000000000000000000000000..b2765edfdc22ba73fe39b368493e4786ab02ce6f GIT binary patch literal 1738 zcmc&yxeWqA3^X870RWdc|5zPyXE%Y(^@Z? zpE3@0Z0JZk*SWhj_d{YKYZ~9O7T* yjc0lL=zi-9O-|lf%FmXYRsZRkOgBp|g<5n^^k=Y_nd$XBnCbZ}9(%L6XMF&B{UQ?p literal 0 HcmV?d00001 diff --git a/TrustFall/TrustFall/Assets/MrMan2.bmp b/TrustFall/TrustFall/Assets/MrMan2.bmp new file mode 100644 index 0000000000000000000000000000000000000000..afc0be1584f05f8e2fa1c939a33ad88f13f59d0f GIT binary patch literal 4922 zcmeH_y$-@46ot`8(8b-w$p>)k;^g9UxViaszFEB~+EDI+o?d90n3A;8kMje>=62b; zZoK6EkmvM$Htx{z_s+TF**_hSS985Te{=SC%Lv=yU@W0#=x)O$el8)r*eeYdU110@ zSeELQtDD#2`eBB(?pQbl|)7j?mF9e}2KjnfI5T+7rJXMk6wwB11 z50}-MMzoF5PxCfLlkik*A)uno;9+^B2Bb#(&CXm;V)qEhSoV%CIpCr>q F`v7Gdqk8}V literal 0 HcmV?d00001 diff --git a/TrustFall/TrustFall/Assets/MrMcPlaceholder.bmp b/TrustFall/TrustFall/Assets/MrMcPlaceholder.bmp new file mode 100644 index 0000000000000000000000000000000000000000..2d5683fb14d97df76a2b67de4159dee5b3e2bf5a GIT binary patch literal 306 zcmV-20nPr2P)>M5ADj8TplfR}mJhKdrye@vEz->FuN-(UVlgj&>g>$_d@`kHud(jQn1T;X6Fs~=uj}Wa#~ve0000cZYkSX+}wZ`=9r}|M~6TKYwk1{a5?zAOG?8_P^~v|Md2s?eA}I|7_p?<-gzl z`0I~?{w4*afE17dQsBiE_>+F5fE17dQa}nw0VyB_q<|EV0#ZN7?=fh#+Tur4T<4VeWL>G(kDS;-fQ*5i41(Jho*ged<;fC@>K}N zeRKNI`yo?5v#XqX=xK+aPz`3GDh)%F8JGoi#+Tur3aS07VR%&Er~te4NsyTLT0L0k%4dZ&@_f>FyHxA2*!Q0bG~i6A2Rhb6K(3DryYJm zHLN#|N|lBo$_&ix`q|#WCR&yLnp3C%^I_o;_oG;La`s^0TmAmfPd_tMgZa*{K0TT> zIOp3oHn660Ka@3ng3 zL?l!F=aeP8iN<54JhMINO+L&h1auc0x6nTdI@~QD$Hk)EQrfe>NnBNA-;g zuuGo=iFvQp6DKn8tsa`jPz~lgzjDHGPJ5)S{12i`G$-XJYdfJD%q>;QhbS{JKTrPo z>8GC8q9Zo<%9vJdGZK1!eUP0 z0e&XhV9OJKbwV|u4O+447DALEm~u~ssDZRPN>o|L>Yo{n!E~d zHz$O@+pFc1DFFT1ij!zE@8uG~z(?^jRDKZ{66XZF-6=@h_{%T94F0(_J^54QkBj!{ z5f^GWp&It;k4lxQA<7Vp)8tivyE!5J-Cix9OabW6R-8nWc`ug;20n_Pq4JBskT@sU z?Kwg0aq}iWE}BJq-O35ouvdRnszeS^hG42po?{fkpF2XkuA%_+XDd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b!x z-2U4Sx5>wc_A(|$wY@iN{tw5lPml8t+|t=teEat8Qx@lGxHtB3>Brxvs@IPA)a0E+ zt-lIVJG~n|ShnWw+ywZ+{KQxHS9Ze|B9%B)Tcm&#kOERb3P=GdAO)m=6p#W^Knh3! zDIf);fE17dQa}nw0VyB_q<|EV0#ZN)k;^g9UxViaszFEB~+EDI+o?d90n3A;8kMje>=62b; zZoK6EkmvM$Htx{z_s+TF**_hSS985Te{=SC%Lv=yU@W0#=x)O$el8)r*eeYdU110@ zSeELQtDD#2`eBB(?pQbl|)7j?mF9e}2KjnfI5T+7rJXMk6wwB11 z50}-MMzoF5PxCfLlkik*A)uno;9+^B2Bb#(&CXm;V)qEhSoV%CIpCr>q F`v7Gdqk8}V literal 0 HcmV?d00001 diff --git a/TrustFall/TrustFall/MrManager.bmp b/TrustFall/TrustFall/MrManager.bmp new file mode 100644 index 0000000000000000000000000000000000000000..af46ac571ceddc13f7a70b286052c8279b5c6057 GIT binary patch literal 4922 zcmeHDF-`~VDjMEFN5|{<8ANNatavV$h20ebM%tXmaqQe29_}uu z`MgAZitpy*JDaX%{`F#-u5a65Z!4W<9AyzpJOtQl*dlq-gh~R8 zz?_xc03e-FabOj6u-hVwvq|6)Nx;DxxDWJj^Ez}pW-=7lB&`t5W$LN#cYjST-fioe z9-Ob2_|>l(qddp;#kAe{3#xTUz~jm4TZw33py2tpta9u+FV#bwfrcQm=}O z+U*k*O)e23LHb}{MJn5Mg;2C zS@hR9#T0A-JSdnQPXE7rZJECRP#K}h^GXn1Vge;~youEZBV+)ydKSgaxI#v&0Kf#E jTlg$(AuB};$)(P + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {C6900ECF-254F-4751-A968-DDA699CCD5A6} + TrustFall + 10.0.17134.0 + + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + MultiByte + + + Application + true + v141 + MultiByte + + + Application + false + v141 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + true + true + true + true + true + true + true + + + + Level3 + Disabled + true + true + + + Windows + + + + + Level3 + Disabled + true + true + + + + + Level3 + MaxSpeed + true + true + true + true + + + true + true + + + + + Level3 + MaxSpeed + true + true + true + true + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + 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}. + + + + + \ No newline at end of file diff --git a/TrustFall/TrustFall/TrustFall.vcxproj.filters b/TrustFall/TrustFall/TrustFall.vcxproj.filters new file mode 100644 index 0000000..b9d8f93 --- /dev/null +++ b/TrustFall/TrustFall/TrustFall.vcxproj.filters @@ -0,0 +1,66 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + {208c3bdc-70a1-468f-abb5-27de77aca6f5} + + + {39102eef-101d-459c-91bd-eb99f53a680c} + + + {9584aa99-4970-43df-9c74-abb55fe47b48} + + + {c35524f9-e2af-4389-8842-332f6f7a1048} + + + {bc95f981-5965-4a34-8f2e-afba2627bb4b} + + + + + + + + Source Files + + + Source Files\EngineImplement + + + Source Files\EngineImplement + + + Source Files\ScreensImplement + + + + + Header Files\Engine + + + Header Files\TrustFall + + + Header Files\Engine + + + Header Files\Engine + + + Header Files\Screens + + + \ No newline at end of file diff --git a/TrustFall/TrustFall/cursor.cpp b/TrustFall/TrustFall/cursor.cpp new file mode 100644 index 0000000..160d131 --- /dev/null +++ b/TrustFall/TrustFall/cursor.cpp @@ -0,0 +1,102 @@ +#include +#include +#include +#include + +#include "cursor.h" + +using std::string; +using std::vector; + +template +Cursor::Cursor() +{ + active = false; +} + +template +void Cursor::activate(std::vector _items) +{ + items = _items; + selected = 0; + active = true; +} + +template +void Cursor::deactivate() +{ + active = false; +} + +template +void Cursor::draw(float _x_start, float _y_start, float _y_offset, ALLEGRO_FONT* _font) { + vector items_text = get_item_strings(); + + x_start = _x_start; + y_start = _y_start; + y_offset = _y_offset; + font = _font; + + for (int i = 0; i < items_text.size(); i++) { + al_draw_text(font, al_map_rgb(255, 255, 255), x_start, y_start + (y_offset*i), ALLEGRO_ALIGN_LEFT, items_text.at(i).c_str()); + } + + update_selector(); +} + +template +void Cursor::down() +{ + if (selected < items.size() - 1) { + selected++; + redraw(); + } +} + +template +void Cursor::up() +{ + if (selected > 0) { + selected--; + redraw(); + } +} + +template +T Cursor::get_selected() { + return items.at(selected); +} + +template +void Cursor::redraw() +{ + al_clear_to_color(al_map_rgb(0, 0, 0)); + draw(x_start, y_start, y_offset, font); +} + +template +void Cursor::update_selector() { + ALLEGRO_COLOR white = al_map_rgb(255, 255, 255); + float offset = y_offset * selected; + float x1 = x_start - 5; + float y1 = y_start + offset; + float x2 = x_start - 5; + float y2 = y_start + 5 + offset; + float x3 = x_start - 1; + float y3 = y_start + 2.5 + offset; + + al_draw_filled_triangle(x1, y1, x2, y2, x3, y3, white); +} + +template Cursor::Cursor(); +template void Cursor::activate(std::vector _options); +template void Cursor::deactivate(); +template void Cursor::draw(float x_start, float y_start, float _y_offset, ALLEGRO_FONT* font); +template void Cursor::redraw(); +template void Cursor::up(); +template void Cursor::down(); +template string Cursor::get_selected(); +template void Cursor::update_selector(); +vector Cursor::get_item_strings() { + return items; +} diff --git a/TrustFall/TrustFall/cursor.h b/TrustFall/TrustFall/cursor.h new file mode 100644 index 0000000..8409560 --- /dev/null +++ b/TrustFall/TrustFall/cursor.h @@ -0,0 +1,29 @@ +#pragma once +#include + +template +class Cursor { +public: + std::vector items; + int selected; + bool active; + + Cursor(); + + void activate(std::vector _items); + void deactivate(); + void draw(float _x_start, float _y_start, float _y_offset, ALLEGRO_FONT* _font); + void up(); + void down(); + T get_selected(); + +private: + float x_start; + float y_start; + float y_offset; + ALLEGRO_FONT* font; + + std::vector get_item_strings(); + void update_selector(); + void redraw(); +}; \ No newline at end of file diff --git a/TrustFall/TrustFall/enums.h b/TrustFall/TrustFall/enums.h new file mode 100644 index 0000000..bccad62 --- /dev/null +++ b/TrustFall/TrustFall/enums.h @@ -0,0 +1,12 @@ +#pragma once + +#define SCREEN_W 640 +#define SCREEN_H 480 + +enum State { + Start, + Gameplay, + Help, + End, + Exit +}; \ No newline at end of file diff --git a/TrustFall/TrustFall/game.cpp b/TrustFall/TrustFall/game.cpp new file mode 100644 index 0000000..1c9e89a --- /dev/null +++ b/TrustFall/TrustFall/game.cpp @@ -0,0 +1,38 @@ +#include "game.h" +#include "start_screen.h" + +using std::string; +using std::map; +using std::pair; + +Game::Game() { +} + +void Game::init() { + score = 0; + state = Start; + sprites.insert(pair("Title", al_load_bitmap("logo.bmp"))); + sprites.insert(pair("Mr. Man", al_load_bitmap("MrMan.bmp"))); + sprites.insert(pair("Mr. Manager", al_load_bitmap("MrManager.bmp"))); + sprites.insert(pair("KeyUp", al_load_bitmap("small_key_up.bmp"))); + sprites.insert(pair("Spacebar", al_load_bitmap("spacebar.bmp"))); + + font = al_create_builtin_font(); +} + +void Game::reset() { + score = 0; + state = Start; +} + +void Game::run() { + while (state != Exit) { + switch (state) { + case Start: + StartScreen start_screen(sprites); + start_screen.run(font); + state = start_screen.next_state; + break; + } + } +} \ No newline at end of file diff --git a/TrustFall/TrustFall/game.h b/TrustFall/TrustFall/game.h new file mode 100644 index 0000000..b9acaac --- /dev/null +++ b/TrustFall/TrustFall/game.h @@ -0,0 +1,31 @@ +#pragma once +#include +#include +#include + +#include +#include +#include + +#include "enums.h" + +class Game { +public: + //Allegro elements + ALLEGRO_FONT* font; + + //Game elements + State state; + + int score; + + std::map sprites; + + Game(); + + void init(); + void run(); + +private: + void reset(); +}; \ No newline at end of file diff --git a/TrustFall/TrustFall/game_screen.cpp b/TrustFall/TrustFall/game_screen.cpp new file mode 100644 index 0000000..59c318e --- /dev/null +++ b/TrustFall/TrustFall/game_screen.cpp @@ -0,0 +1,42 @@ +#include "game_screen.h" + +#include +#include + +using std::vector; +using std::string; + +GameScreen::GameScreen(std::map _sprites) { + sprites = _sprites; +} + +void GameScreen::run(ALLEGRO_FONT * font) { + ALLEGRO_EVENT_QUEUE* event_queue = NULL; + event_queue = al_create_event_queue(); + al_register_event_source(event_queue, al_get_keyboard_event_source()); + + redraw(font); + al_flip_display(); + + bool exit_screen = false; + while (!exit_screen) { + ALLEGRO_EVENT ev; + al_wait_for_event(event_queue, &ev); + + if (ev.type == ALLEGRO_EVENT_KEY_DOWN) { + + } + } +} + +void GameScreen::redraw(ALLEGRO_FONT* font) { + +} + +void GameScreen::back() { + next_state = Exit; +} + +void GameScreen::cont() { + next_state = End; +} \ No newline at end of file diff --git a/TrustFall/TrustFall/game_screen.h b/TrustFall/TrustFall/game_screen.h new file mode 100644 index 0000000..ece3708 --- /dev/null +++ b/TrustFall/TrustFall/game_screen.h @@ -0,0 +1,15 @@ +#pragma once +#include "screen.h" +#include "cursor.h" + +class GameScreen : public Screen { +public: + std::map sprites; + + GameScreen(std::map _sprites); + + void run(ALLEGRO_FONT* font); + void redraw(ALLEGRO_FONT* font); + void back(); + void cont(); +}; \ No newline at end of file diff --git a/TrustFall/TrustFall/key_up.bmp b/TrustFall/TrustFall/key_up.bmp new file mode 100644 index 0000000000000000000000000000000000000000..b97a2c1327804fae1a04c312714ac71ddd99d74d GIT binary patch literal 10922 zcmeI0F;2r!07HROu(L5B4#3ofiG_2pv2i3W2~krb%LMno|9_f9qEcHscHVb0_VDs~ ze|3C)44-eq`|0$)zPdeLe;o3=hw**9Fnk=IU*CUp>G#cS@oOiqY5Y$1o@NfSM>Xx= zxX{PjI8{+ucRZ*g>VLC6Ono30QLCt|DcSl8w}@IrWlhP}SGYygDk^JAw!XqGqE=B^ zQ?m6HZV|PL%9@g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fcwgE`t7)5dEb!x z-2U4Sx5>wc_A(|$wY@iN{tw5lPml8t+|t=teEat8Qx@lGxHtB3>Brxvs@IPA)a0E+ zt-lIVJG~n|ShnWw+ywZ+{KQxHS9Ze|B9%B)Tcm&#kOERb3P=GdAO)m=6p#W^Knh3! zDIf);fE17dQa}nw0VyB_q<|EV0#ZN +#include +#include +#include +#include +#include +#include + +#include + +#include "game.h" + +using std::string; + +int main() +{ + //Allegro setup + if (!al_init()) { + fprintf(stderr, "failed to initialize allegro!\n"); + return -1; + } + if (!al_init_font_addon()) { + fprintf(stderr, "failed to initialize font!\n"); + return -1; + } + if (!al_init_primitives_addon()) { + fprintf(stderr, "failed to initialize primitives!\n"); + return -1; + } + if (!al_init_image_addon()) { + fprintf(stderr, "failed to initialize image addon!\n"); + return -1; + } + if (!al_install_audio()) { + fprintf(stderr, "failed to initialize audio!\n"); + return -1; + } + if (!al_init_acodec_addon()) { + fprintf(stderr, "failed to initialize audio codecs!\n"); + return -1; + } + if (!al_install_keyboard()) { + fprintf(stderr, "failed to initialize allegro!\n"); + return -1; + } + if (!al_reserve_samples(1)) { + fprintf(stderr, "failed to reserve samples!\n"); + return -1; + } + + ALLEGRO_DISPLAY* display = al_create_display(SCREEN_W, SCREEN_H); + al_clear_to_color(al_map_rgb(0, 0, 0)); + + Game main_game; + main_game.init(); + main_game.run(); + + al_destroy_display(display); + + return 0; +} \ No newline at end of file diff --git a/TrustFall/TrustFall/packages.config b/TrustFall/TrustFall/packages.config new file mode 100644 index 0000000..0c6bbd7 --- /dev/null +++ b/TrustFall/TrustFall/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/TrustFall/TrustFall/screen.h b/TrustFall/TrustFall/screen.h new file mode 100644 index 0000000..0a0c2eb --- /dev/null +++ b/TrustFall/TrustFall/screen.h @@ -0,0 +1,19 @@ +#pragma once +#include +#include +#include +#include +#include + +#include "enums.h" + +class Screen { +public: + State next_state; + std::map sprites; + + virtual void run(ALLEGRO_FONT* font) = 0; + virtual void redraw(ALLEGRO_FONT* font) = 0; + virtual void back() = 0; + virtual void cont() = 0; +}; \ No newline at end of file diff --git a/TrustFall/TrustFall/small_key_up.bmp b/TrustFall/TrustFall/small_key_up.bmp new file mode 100644 index 0000000000000000000000000000000000000000..a885e66ece0fb26c6cae19349e7c1c4dbd7f3304 GIT binary patch literal 2882 zcmeH`F&4rw2!_#7FW}_j?jf=`xp)pYH&5uTYFl@cOVc&&p^Rr< z?|B~U+`ys4Ups))8D|OPC0%Zh(f00JkvOb209Hc}BU@Z1=wiQ1Z2MMoEp)b4rfbqQ z;eV4>10(&NXl0ZpT*!!>ODQ(Rf?(o&YSf#>!Sif7X)RKFE8CPNbRGdycS@5V@bn28 zX5X0Q>7IDpaIkZ_jpsaW``8Aa!-VZ-PvQkkxGijf7bNXAvNgbne6!K}@4EC7BGmxi DK9ln^ literal 0 HcmV?d00001 diff --git a/TrustFall/TrustFall/spacebar.bmp b/TrustFall/TrustFall/spacebar.bmp new file mode 100644 index 0000000000000000000000000000000000000000..66bb9fe735d1e2364f81f3d075609136ad879c8f GIT binary patch literal 2882 zcmZ?rb>e0KgDN1I1H^Jr%*Y@C7C*toz@V%L!C(O(;p84v3}X{ZGZCwBRNZI@jE2B) v4T1kO0N}8qfw@p485l;*Mh}6Z8z#WSg64&H% +#include + +using std::vector; +using std::string; + +StartScreen::StartScreen(std::map _sprites) { + vector menu_options; + menu_options.push_back("Start"); + menu_options.push_back("Quit"); + menu.activate(menu_options); + + sprites = _sprites; +} + +void StartScreen::run(ALLEGRO_FONT * font) { + ALLEGRO_EVENT_QUEUE* event_queue = NULL; + event_queue = al_create_event_queue(); + al_register_event_source(event_queue, al_get_keyboard_event_source()); + + redraw(font); + menu.draw(300.0, 400.0, 20.0, font); + al_flip_display(); + + bool exit_screen = false; + while (!exit_screen) { + ALLEGRO_EVENT ev; + al_wait_for_event(event_queue, &ev); + + if (ev.type == ALLEGRO_EVENT_KEY_DOWN) { + switch (ev.keyboard.keycode) { + case ALLEGRO_KEY_UP: + menu.up(); + break; + case ALLEGRO_KEY_DOWN: + menu.down(); + break; + case ALLEGRO_KEY_ENTER: + cont(); + exit_screen = true; + break; + case ALLEGRO_KEY_BACKSPACE: + back(); + exit_screen = true; + break; + } + redraw(font); + al_flip_display(); + } + } +} + +void StartScreen::redraw(ALLEGRO_FONT* font) { + al_draw_bitmap(sprites["Title"], 0, 20, NULL); + al_draw_bitmap(sprites["Mr. Manager"], SCREEN_W / 2 - 24, 150, NULL); + for (int i = 1; i < 7; i++) { + al_draw_bitmap(sprites["Mr. Man"], SCREEN_W / 8 * i + 14, SCREEN_H / 2 - 40, NULL); + } + + al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2, SCREEN_H / 2 + 20, 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 + 30, ALLEGRO_ALIGN_CENTER, "Help Mr.Manager place his employees at the end of his"); + al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2, SCREEN_H / 2 + 40, ALLEGRO_ALIGN_CENTER, "conveyor belts to make sure no other employees fall off."); + + al_draw_bitmap(sprites["KeyUp"], SCREEN_W / 3, SCREEN_H / 2 + 60, NULL); + al_draw_bitmap(sprites["KeyUp"], SCREEN_W / 3 + 34, SCREEN_H / 2 + 60, ALLEGRO_FLIP_VERTICAL); + al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2, SCREEN_H / 1.5 - 10, ALLEGRO_ALIGN_LEFT, "Up and down - Move cursor"); + + al_draw_bitmap(sprites["Spacebar"], SCREEN_W / 3 + 20, SCREEN_H / 2 + 100, NULL); + al_draw_text(font, al_map_rgb(255, 255, 255), SCREEN_W / 2, SCREEN_H / 1.3 - 20, ALLEGRO_ALIGN_LEFT, "Spacebar - Place employee"); +} + +void StartScreen::back() { + next_state = Exit; +} + +void StartScreen::cont() { + if (menu.get_selected() == "Start") { + next_state = Gameplay; + } + else { + next_state = Exit; + } +} \ No newline at end of file diff --git a/TrustFall/TrustFall/start_screen.h b/TrustFall/TrustFall/start_screen.h new file mode 100644 index 0000000..e417fe1 --- /dev/null +++ b/TrustFall/TrustFall/start_screen.h @@ -0,0 +1,16 @@ +#pragma once +#include "screen.h" +#include "cursor.h" + +class StartScreen : public Screen { +public: + Cursor menu; + std::map sprites; + + StartScreen(std::map _sprites); + + void run(ALLEGRO_FONT* font); + void redraw(ALLEGRO_FONT* font); + void back(); + void cont(); +}; \ No newline at end of file