-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathANGRYBIR.CPP
More file actions
89 lines (81 loc) · 1.18 KB
/
ANGRYBIR.CPP
File metadata and controls
89 lines (81 loc) · 1.18 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include<stdio.h>
#include<conio.h>
#include <dos.h>
#include <graphics.h>
int px=25,py=25;
int posX, posY, posKlik;
void bdrag();
union REGS in, out;
void detect ()
{
while (!kbhit () )
{
int x,y;
in.x.ax = 3;
int86 (0X33,&in,&out);
if (out.x.bx == 1)
{
x = out.x.cx;
y = out.x.dx;
cprintf ("\nLeft || X - %d Y - %d", x, y);
}
px=x;
py=y;
delay (200); // Otherwise due to quick computer response 100s of words will get print
}
}
void show_mouse(void)
{
asm{
mov ax,1h
int 33h
}
}
void set_mouse(void)
{
asm{
mov ax,4h
mov cx,0
mov dx,479
int 33h
}
}
void read_mouse(void)
{
asm{
mov ax,3h
int 33h
mov posX,cx
mov posY,dx
mov posKlik,bx
}
}
void main()
{
clrscr();
textbackground(BLACK);
textcolor(WHITE);
_setcursortype(_NOCURSOR);
gotoxy(px,py);
printf("%c",1);
show_mouse();
set_mouse();
read_mouse();
gotoxy(posX,posY);
detect ();
bdrag();
cprintf("%d:%d",px,py);
getche();
}
void bdrag()
{
if(px<=195&&py<=28)
{
gotoxy(px,py);
clrscr();
//detect();
printf("%c",1);
//delay(300);
//clrscr();
}
}