Using array to add initial value for checkerboard?

0 favourites
  • 5 posts
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • Hey everyone im back working on my projects again and im looking at my checker game im in the process of making. I have a good understanding I think of how im doing this with the array, but im reaching out to see if it's indeed correct. So Im using the array grid to layout my checker board and now im setting up getting the system to know whats on the board.

    As you can see, I setup my board, got the grid coordinates and now im in my eventsheet to set up what's empty, the red pieces and the white pieces.

    would I need to add their own variable to put as a "Value"? for the pieces?

    Example. Set XY at (X:0 Y:1 Value:1 (white piece)?

  • You can. You could do something like empty=0, white=1, and red=2.

    It’s a tad tedious to populate and update the board from the pieces locations though. An alternate approach would be to use overlap checks or picking to see what pieces are at certain locations.

  • You can fill the cells in the table (on your first screenshot) with 1 and 0. Then just load it into the array with AJAX instead of doing a bunch of "set value" actions.

    And I agree with R0J0, making checkers game in C3 with an array won't be fun. I would probably use sprites with instance variables to store their position on the board, and overlapping checks to test if they can move to a certain cell.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay, we will try

  • Thanks dop2000R0J0hound. I will take both of yours advice.

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