Added support for multiple boards


Introduction

Hello! This is just a short update to show some of the progress that I've made over the past few days. If you have no idea what this project is, you might wish to peruse my first devlog before continuing.

The majority of this post is me rambling incoherently, so I'll provide the results below so you can skip the rambling section if you so choose.


Technical rambling

Previously, I had a single class called circle. Here's the description of that class taken from the header file.

class circle {
   private:
      Vector2 centre;
      float initial_radius;
      float current_radius;
      float mouse_over_growth_mult;
      bool frozen;
      Color col;
   public:
      circle(Vector2 centre, float radius);
      circle();
      Vector2 get_centre() const;
      void set_centre(Vector2 centre);
      void set_initial_radius(float radius);
      float get_initial_radius() const;
      void set_current_radius(float radius);
      float get_current_radius() const;
      void set_mouse_over_growth_mult(float mult);
      float get_mouse_over_growth_mult() const;
      bool is_mouse_over() const;
      void set_color(Color col);
      Color get_color() const;
      bool is_frozen() const;
      void set_frozen(bool b);
};

Most of the methods and variables in this class are pretty self-explanatory. The only issue with this class was that it was the only class in the project, so circles essentially existed in isolation.

To elaborate further on what I mean by this, consider the game of chess. It consists of a board (which itself consists of 64 squares) and pieces, each of which have their own unique behaviour.

From a technical point of view, we need the computer to draw each of these 64 squares on screen to display the chessboard, but we also want to "group" these squares together to represent the fact that they actually combine to form the chessboard.

One reason we want to group them in this way is that if we, say, wanted to move the entire board to a different point on the screen, we don't want to have to manually adjust the positions of each individual board square every single time.

In Rokkaku, the "board" is essentially the collection of vertices (or circles). It would certainly be possible to introduce a standard board shape (i.e. alignment of vertices) just like chess has the standard 8x8 square grid. The most canonical way to align the vertices is at the corners of a regular polygon, which is precisely how the vertices are initially drawn to the screen. However, unlike chess and Rokkaku's pencil-and-paper variant Sim (which both have static boards), Rokkaku has a dynamic board. This means that the player is free to move around the vertices at will to whatever configuration they can imagine. This is equivalent to allowing chess players to move the individual squares on a chess board, hence breaking its initial square grid structure.

In chess, the idea of introducing a dynamic board (although interesting) probably doesn't provide a tangible gameplay advantage. However, in Rokkaku, this certainly seems advantageous. Revelations and new moves are much more likely to appear when the board is viewed in a different way.

So... what have you been doing?

I have spent quite a bit of time over the past few days cleaning up my codebase by introducing a new class specifically for the board. Having completed this task, adding new board functionality is much, much easier, and I hope to have Rokkaku playable (locally) soon so that people can give it a spin.

This board class essentially groups a bunch of game functionality that already existed into a sensible place, as well as some new stuff. It's still a bit rough and could definitely do with cleaning up a little bit, so I will continue to keep busy. Godspeed and Happy Valentine's Day!

Get Takaku

Leave a comment

Log in with itch.io to leave a comment.