Skip to content
Snippets Groups Projects
Commit 9443e89d authored by Grodvalt Enikő Ágnes's avatar Grodvalt Enikő Ágnes
Browse files

athelyez fuggveny, jatekmester class (rossz)

parent 32e7b796
Branches master
No related tags found
No related merge requests found
......@@ -54,20 +54,8 @@ void App::event_loop() {
}
else if(ev.type == ev_key)
{
if(ev.keycode == key_enter)
action("enter");
if(ev.keycode == key_pgdn)
action("checkbox_-10");
else if(ev.keycode == key_pgup)
action("checkbox_10");
else if(ev.keycode == key_up)
action("checkbox_1");
else if(ev.keycode == key_down)
action("checkbox_-1");
/*if(ev.keycode == key_enter)
action("enter");*/
}
if (focus!=-1) {
widgets[focus]->handle(ev);
......
......@@ -3,12 +3,12 @@
#include "app.hpp"
#include "pont.hpp"
#include "korong.hpp"
//#include "jatekmester.hpp"
#include <vector>
#include <string>
#include <fstream>
#include <iostream>
#include <cmath>
using namespace std;
using namespace genv;
......@@ -49,15 +49,21 @@ public:
jatekos.push_back(new Korong(this, xj, y, 25, 1));
ellenfel.push_back(new Korong(this, xe, y, 25, 0));
}
//gameManager = new JatekMester(pontok, jatekos, ellenfel);
}
void action(string id)
{}
{
}
protected:
vector<vector<Pont*>> pontok;
vector<Korong*> jatekos;
vector<Korong*> ellenfel;
//JatekMester* gameManager;
};
int main()
......
......@@ -44,3 +44,8 @@ void Pont::handle(event ev)
}
}
}
vector<int> Pont::koordinata() const
{
return {_x, _y};
}
......@@ -15,6 +15,7 @@ public:
virtual void draw() override;
virtual void handle(genv::event ev) override;
virtual bool is_selected(int mouse_x, int mouse_y) override;
std::vector<int> koordinata() const;
};
#endif // PONT_HPP
#include "widgets.hpp"
#include "graphics.hpp"
#include "app.hpp"
using namespace genv;
Widget::Widget(App *parent, int x, int y, int sx, int sy) :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment