| | | |

Logging My Work on “The Game”… Sort Of…

Although I have not worked on “the game” quite as much as I would have liked to, it is a whole heck of a lot more than I’ve ever worked on it before!

Honestly, I’ve not documented much here on the blog like I had intended. I am mostly using Evernote to keep track of what I’m working on, problems, and technical information.

Right now, the game menu screen is disabled and it goes right into playing a new 2 player game. And, right now, the game type is Pass and Play. This way I can test game play of a whole game on one device! I can put on my player 1 hat, then my player 2 hat!

I’ve got most of the tile dragging from the player’s tray and to and from the game board working fine. There are a couple bugs with it that still need to be fixed though.

I’ve also got it so if you try to drag a tile to somewhere on the screen where a tile isn’t supposed to go, the tile will snap back to its starting position.

The “Recall” button will return any tiles dragged out of the tray during the turn back to the tray.

Note: that these snapping and returning elements are being done using sprite animation in Sprite Kit.

The “Play” button now works (basic functionality):

  • It changes the state of tiles moved out of the tray or moved around by the player during their turn.
  • It does Not yet check the validity of the words formed by the player or do any sort of scoring yet.
  • It still does not know when it is the end of a game.
  • There is nothing built in yet for multi-player over the network yet.
  • Finally, it toggles to the next player. Once the last player makes their move, it will swing around and it will be the first player’s turn again!
  • I now made the “Play” button actually start out with the caption of “Pass” at the beginning of a player’s turn. I still need to add some code that will change the caption to “Play” once the user moves some tiles out onto the board. The caption should change back to “Pass” if the user moves all the tiles back to the tray they might have moved out.

 

I also now made the “Recall” button start with the caption of “Shuffle”. So, this button will have two functions:

  • Initially, shuffling the tiles in the tray.
  • And, when one or more tiles have been moved out of the tray during a turn, the ability to Recall all the tiles the user dragged out during their turn.
  • I still need to put in code to handle these differences.
  • Right now, it just has the “recall” functionality.

The UI is now displaying which player is currently having their turn.

I modified how tiles are added to the user’s tray, so, as the move tiles out of different spots on the tray, on their next move, if there are any tiles left to add to the tray, it will add them to the spots that are now empty.

Starting to look more at the look of the app…

  • I’ve been working on adjusting how letters are displayed on the tile.
  • Once I get it just right, I’m going to start working on code to display the point value of the tile (a lot like the way Scrabble does it).
  • I’m starting to look into working with Textures. I want to see how to:
    • Draw lines to it (to do a border).
    • Draw rounded corners on a rectangle.
    • Do a gradient background.

I have just barely started to begin setting of stuff to track word composition in the game and handle game scoring.

It is really nice to be getting to a point where I’m now doing more than just writing and testing code to drag tiles around on the screen!

I’ve been testing my work on an iPad, hooked up to my iMac, run from the latest version of XCode.

 

Similar Posts