List of legal moves

Get help using Construct 2

Post » Mon Dec 24, 2012 12:47 am

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.
Posts: 11
Reputation: 347

Post » Mon Dec 24, 2012 7:01 am

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.

Posts: 5,591
Reputation: 85,520

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests