-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibone.cpp
More file actions
50 lines (43 loc) · 733 Bytes
/
Copy pathlibone.cpp
File metadata and controls
50 lines (43 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "libone.hh"
snakebody::snakebody(int x, int y)
{
pos_x = x;
pos_y = y;
}
Libone::Libone(const int &x, const int &y)
{
WINDOW *my_win;
user_x = x;
user_y = y;
initscr();
nodelay(stdscr, true);
keypad(stdscr, true);
curs_set(0);
getmaxyx(stdscr, gety, getx);
check_size(user_x, user_y, getx, gety);
refresh();
start();
my_win = window_create(user_y, user_x);
wrefresh(my_win);
create_snake();
view_snake(my_win);
directions = 'l';
wrefresh(my_win);
nodelay(my_win, true);
food(my_win);
heavygo(my_win);
}
Libone::~Libone()
{
endwin();
}
void Libone::talk(int x, int y)
{
}
extern "C"
{
Nibbler* create_lib(const int x, const int y)
{
return new Libone(x, y);
}
}