delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/10/25/11:45:03

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: <c97cb09 DOT 0210240548 DOT 1781c6df AT posting DOT google DOT com>
NNTP-Posting-Host: 194.164.77.251
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:<c97cb09 DOT 0210240548 DOT 1781c6df AT posting DOT google DOT com>...
> 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?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019