Untitled
unknown
plain_text
a year ago
1.2 kB
4
Indexable
#ifndef START_SCREEN_H #define START_SCREEN_H #include "Square.h" #include "Texture.h" #include "Button.h" enum BOARD {THREE, FOUR, FIVE}; enum BOT {AI, PLAYER}; class StartScreen { Square startScreen; Texture title; Button three; Button four; Button five; Button ai; Button no_ai; Button start; bool display; public: StartScreen(){ startScreen = Square(-1, 1, 2, Color(0,0,0)); title = Texture("tictactoeSmaller.png", -0.6, 0.7, 1.2, 0.4); three = Button("3 x 3", -0.15, 0.2); four = Button("4 x 4", -0.5, 0.2); five = Button("5 x 5", 0.2, 0.2); ai = Button("Play with ai", -0.65, -0.05); no_ai = Button("Two player", 0.05, -0.05); start = Button("Start Game!", -0.25, -0.5); display = true; } void startedGame(float x, float y){ if (start.contains(x, y)){ start.pressedButton(); display = false; } } bool getDisplay(){ return display; } void draw(){ startScreen.drawPolygon(); title.draw(); three.draw(); four.draw(); five.draw(); ai.draw(); no_ai.draw(); start.draw(); } }; #endif
Editor is loading...
Leave a Comment