Skip to main content
GameDev.net gamedev.net
🔒 Locked

QIX Logic?

Started by Wyndo Apr 21, 2002 at 2:54 PM 1 replies 3.7k views
Original Post
Wyndo
Wyndo
I''ve been programming since 1987, and actually do it professionally now (although "game" programming is still primarily a hobby). I can plod through enough math and algebra to do what I need, but math has never been my strong suit. However, I''ve always wanted to write a QIX-like game (for those who don''t know, that''s an old arcade game where you draw lines up into the play area, filling in parts of the screen until the QIX (enemy) is bouncing around an area 25% or less). The reason I''ve never done this, however, is because I can''t seem to figure out how to determine the math involved in calculating which area to fill! Because the lines can be jagged and roaming, the player could in theory draw up and over, loop around the QIX and back. Basically, I have to figure out which area belongs to the QIX, and which area should be painted in for the player. I''m thinking about starting a QIX project, but I hate to do it the hard way (paint in the background, check to see if the QIX is in the painted area, and if so, undo and start painting elsewhere). Any advice? Mike Snyder Prowler Productions
CaptainJester
CaptainJester
Every turn that you make playing the game, creates a point. Take all the turn points and create a bunch of rectangles. Check each rectangle, starting with the one closest to the wall, and see if the Qix is inside it or outside it, then continue to check all of them. If the Qix is inside one rectangle, it will be inside the entire series. Once you know where it is, then you can fill the right area.

---
Make it work.
Make it fast.

"Commmmpuuuuterrrr.." --Scotty Star Trek IV:The Voyage Home
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.