Results 1 to 1 of 1

Thread: Simple game, complex programming... please see...

  1. #1
    Dreamlax
    Guest

    Simple game, complex programming... please see...

    There was a game I played once, played on a chess board. You have 8 rooks, and in order to remove pieces, you had to surround it. Here's an example. * is one side and # is the other:

    Code:
    This is a capture
     * | * | * |   | * | * | * | * 
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
       |   | # | * | # |   |   |
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
     # | # |   | # |   | # | # | #
    
    This would also be a capture
     * | * | * |   | * | * | * | * 
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
       |   |   | # |   |   |   |
    ---|---|---|---|---|---|---|---
       |   |   | * |   |   |   |
    ---|---|---|---|---|---|---|---
       |   |   | # |   |   |   |
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
     # | # |   | # |   | # | # | #
    
    And so is this
     * | * | * |   |   | * | * | * 
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
       |   | # | * | * | # |   |
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
       |   |   |   |   |   |   |
    ---|---|---|---|---|---|---|---
     # | # |   | # | # |   | # | #
    You can't jump over pieces either.

    Anyway, I've sorted out the movement of the pieces (in programming), but when you select a piece, I would like a shape (taking up one square) on the X or Y axis if the X,Y coordinates of the mouse are closer to the axis.

    It's hard to explain, but if the mouse is closer to the Y axis, the shape would snap to the Y axis, and if the mouse moves closer to the X axis (than it is to the Y axis) it should snap there.

    You 'COULD' have a look at the game I have so far, but if you don't like reading uncommented and 1-space-nesting programs, you shouldn't really. The reason why it is called Granddad's Game is because the game is for him... You also might find a lot of one-line functions but that's because it looks nicer (I'm Mr. Cosmetic).

    Any help would be.... y'know..... appreciated.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width