Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!van-bc!icecave!colin_fox From: colin_fox@icecave.wimsey.bc.ca (Colin Fox) Message-ID: Organization: Animatrix Newsgroups: comp.graphics Subject: Re: Programming a Mah-Jongg type game Date: 21 May 91 01:00:37 PDT >Howdy everyone, > > First off, I know that this question probably belongs in a group like >rec.games.programmer, but since we don't get that group here at our site, >please, no flames! > > Now for my question - I know that everyone and his cousin has written a >Mah-jongg/Taipei type of tile-removal game at one time, and I'm trying to >do the same (a rite of passage, if you will). However, I'm stuck on the >problem of figuring out how to redraw tiles whenever a tile is deleted. The >problem is that since the tiles are stacked several levels high, and seen >from >an angle, they can overlap each other in weird ways - and I'm hard pressed to >figure out which tiles to redraw and in what manner. At first I had thought >that this would be a pretty simple problem, but it's turning out to be more >difficult than I had imagined. > > So, if you understand my problem, could you please tell me whether this >is >really an easy thing to do, and I'm just missing something? Or is it truly a >complicated procedure, not to be tried by a mere amateur? Any hints, ideas, >algorithms, or (especially) source code would be greatly appreciated. > > Oh, and I'm using SunView right now, not that it should matter much - but >I could also use X or MS-Windows. >-- >! Sung Han @ Commonwealth Edison Corp., Chicago, Illinois >! >! sung@ceco.ceco.com, or >! uunet!ceco.ceco.com!sung Well, the simplest way is probably to record the array of pieces as a 3d array, and simply redraw all tiles that have a location with a greater screen Y position (counting from the top of the display), and that also have an equal or greater height than the piece you just removed. +-------------------------------------+----------------------------------+ | colin_fox@icecave.wimsey.bc.ca | | +-------------------------------------+ "What?! I can't be overdrawn! | | Informal home of SIGGRAPH Vancouver,| I still have cheques left!!" | | and proud of it! | | +-------------------------------------+----------------------------------+