From: "A. Sinan Unur" Newsgroups: comp.os.msdos.djgpp Subject: Re: Thanks, HELP! mouse problems Date: Sat, 17 May 1997 16:02:44 -0400 Organization: Cornell University Lines: 28 Sender: asu1 AT cornell DOT edu (Verified) Message-ID: <337E0EE4.1DB7F3F2@cornell.edu> References: <01bc6257$9ed88cc0$LocalHost AT stachowiak> NNTP-Posting-Host: cu-dialup-0065.cit.cornell.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Helix wrote: > > First of all I would like to thank all the people who helped me out last > time on my tile based game question. I got a new hard drive and forgot to > copy all the letters from it, therefore I did not have the return address > and could not thank them. > I ended up creating a array of values, where each value represented a > terrain. Using this I could redraw only certain squares when the character > moved. (not the whole map) > > Second, I've come across another snag. It concerns using the mouse routines > in Allegro. > > if ((mouse_b & 1) & (mouse_x > fx) & (mouse_x < lx) & (mouse_y > fy) & > (mouse_y < ly)) > CityBackPix(); > > This is a sample from my code, It basically says that if the mouse pointer > is within a certain range and the mouse button is pressed do the > CityBackPic function. The problem is that it only works if I also no. the problem is that you are using bitwise and rather than logical and. replace the &'s with &&'s. -- ---------------------------------------------------- A. Sinan Unur mailto:asu1 AT cornell DOT edu http://www.people.cornell.edu/pages/asu1