Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Qix tipe of game

    Beginners
    2
    3
    469
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mel0022 last edited by

      hi, i can't quite understand how to create a game like qix , if anyone has any idea how to do it, can you explain it to me? the main problem is understanding how to close the conquered areas
      M.

      1 Reply Last reply Reply Quote 0
      • vinicity
        vinicity F last edited by vinicity

        As it happens, I'm actually working on a Qix game too. In the end I went for the following approach:

        • Lower the resolution, since the algorithms required are quite resource intensive.
        • Keep the play area as a one-dimensional array (which makes it easy to display on screen using the uploadImage() function.
        • The various states a pixel can have (border, active line, empty space, etc.) are represented as different colours in the array, so you can always look at a specific coordinate in the array and see if it for instance is inside the empty playfield area or not by reading its colour.
        • When the drawn line of the player comes back to a non-empty pixel, we should fill. What I do then is a Flood fill from the Qix enemy's position with a special colour, and then go through the whole play area and set all the pixels that still have the "empty space" colour as filled, and the "special colour" as non-filled.

        It's hard to explain, but I basically used this article, and tried to do the same thing:
        https://www.idogendel.com/en/archives/738

        For the Flood fill algorithm I used the Wikipedia page, the pseudo code in the "Span Filling" section was quite straightforward:
        https://en.wikipedia.org/wiki/Flood_fill

        This is of course just one way of doing it, there are many others. Feel free to ask if you have more questions.

        M 1 Reply Last reply Reply Quote 3
        • M
          mel0022 @vinicity last edited by

          @vinicity omg ty

          1 Reply Last reply Reply Quote 0
          • First post
            Last post