home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / programm / 2601 < prev    next >
Encoding:
Internet Message Format  |  1992-09-13  |  2.5 KB

  1. Path: sparky!uunet!news.univie.ac.at!alijku11!k3021e7
  2. Organization: Johannes Kepler University Linz - Computing Center
  3. Date: Monday, 14 Sep 1992 11:33:56 CDT
  4. From: <K3021E7@ALIJKU11.BITNET>
  5. Message-ID: <92258.113356K3021E7@ALIJKU11.BITNET>
  6. Newsgroups: comp.programming
  7. Subject: Algorithms for STYX (=Maniax)
  8. Lines: 49
  9.  
  10. This one is to all who ever saw the C64 game STYX or the Amiga game Maniax
  11. or know what they're about.
  12. I'm trying to program a game of this sort, as simple as possible, and in C.
  13. I thought it might be simple, but I encountered problems where even my
  14. beloved "Algorithms in C" - Sedgewick couldn't help me.
  15.  
  16. THE GAME: You are controlling a point which draws a line after it. You can't go
  17.  back. You can't cross your own line. When you hit a BORDER line, the polygone
  18. you made gets filled and your former line now becomes the new BORDER line.
  19. You can move only horizontally and vertically, not diagonal.
  20. There is SOMETHING evil. In the old C64 version there were some lines that
  21. moved around, in the Amiga Maniax it's a few sprites.
  22. Once the evil thing hits your line (or even yourself), you're lost.
  23. You win if you manage to fill 75% of the screen.
  24.  
  25. THE PROBLEMS: Once the player hits a border line, the interior of the polygon
  26. has to be filled. Since it CAN happen that the filled part is more than 50% of
  27. the rest, you can't just fill the smaller polygon but you must fill the one
  28. were the bad creature ISN'T inside.
  29. So HOW TO DETECT IF let's say just ONE POINT (the coords of the monster)
  30. IS IN THE POLYGON ?
  31.  
  32. The next problem is - when you have two lines exactly beside each other
  33. (which means, no room in between), a normal flood fill algorithm would
  34. stop. In this game, the colour should "FLOW THROUGH" the corridor.
  35. I think I need to reprogram the normal Flood Fill Algorithm with a few
  36. changes, but how does the normal Flood Fill work ???
  37.  
  38. The next problem: The game has to finish when 75% of the screen are covered.
  39. How do I calculate the interior of some WEIRD polygon ?
  40. I'd have to split it up into something rectangular, but HOW should I do this
  41. algorithmically ???
  42.  
  43. One more problem: How can I detect if the monster hit my line ? If the thing
  44. should look like in the C64 version, this might become difficult because I'd
  45. have to check EACH single pixel. However, this isn't necessary. I can also use
  46. sprites or something like this which would make it a lot easier.
  47.  
  48. So does anybody have an idea of how to solve at least ONE of those problems ?
  49.  
  50. Oh, by the way - I'm using Lattice on an Amiga 500+.
  51.  
  52. Thanks in advance to you all,
  53. please please please e-mail me,
  54. Michael "Iglo"
  55.  
  56.  
  57.  
  58.  
  59.