From: trapforcannedmeatproduct AT hotmail DOT com (R. Charles Henry) Newsgroups: comp.os.msdos.djgpp Subject: Re: using the mouse in a program. Date: 25 Oct 2002 08:30:27 -0700 Organization: http://groups.google.com/ Lines: 17 Message-ID: <8ed56b42.0210250730.726db105@posting.google.com> References: NNTP-Posting-Host: 194.164.77.251 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1035559827 8847 127.0.0.1 (25 Oct 2002 15:30:27 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: 25 Oct 2002 15:30:27 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com kevinplaxton AT yahoo DOT co DOT uk (Kevin Plaxton) wrote in message news:... > If I wanted to make the game "Breakout", how would I use the mouse to > move the paddle? It goes left and right, but not up and down. union REGS mouse; int across; /* horizontal position of paddle */ mouse.x.ax = 0x0B; /* initialise to tell BIOS what info required */ int86(0x33, &mouse, &mouse); /* ask how far the mouse moved since last look */ mdy=mouse.x.cx; /* the vertical mouse movement returned in cx */ across+=mdy; /* add / remove movement from 'across' variable */ see: http://www.brackeen.com/home/vga/mouse.html HTH?