List of legal moves

  • I'm trying to figure out the best way to compile a list of legal moves for a board game. If this were Python I'd simply put all the x/y positions into a list. But I don't see that functionality here.

    Step 1: Legal moves in all directions.

    Step 2: Remove moves from positions already taken by another piece.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I can think of a few ways to do it. One would be to use the array object to store the list.

    Another idea would be to take advantage of object picking so that the picked objects would be the list.

    In a game of say Chess or Monopoly, every game position would be an instance of a sprite.

    Then the grand pseudo event could look like this:

    +Pick a piece

    +pick game_positions that piece can move to

    +not game_positions that already have a piece on them.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)