Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Twine Sugarcube Image Border

I'm trying to create a sort of Turn Based Strategy game. For this I've divided my map into 64 pieces, however I can't figure out how to mark each section as being in player or enemy possession. The idea I had was to use either red or blue borders, but I literally can't find anything about doing that.

I'm using Sugarcube 2

Comments

  • You could use CSS to determine the border color using class identifiers, like so:
    .player {
    border: 3px solid blue;
    }
    .enemy {
    border: 3px solid red;
    }
    

    And JavaScript to switch out the classes depending on the conditions. Using the .getElementsByClassName("board-piece") would be a good place to start.

    In the HTML of your game, you'd have each board piece with something like this:
    <a class="board-piece player"></a>
    
Sign In or Register to comment.