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