hape42 / dailygammon

DailyGammon-app is free and ad-free client for the long-running DailyGammon web-based application.
https://hape42.de/RoadMap
16 stars 6 forks source link

Have additional designs #9

Closed kagsteiner closed 1 year ago

kagsteiner commented 2 years ago

I'm longing for more designs; maybe one in the nice blue tones that Backgammon Galaxy has, or one that emulates a wooden board. If I understand the code correctly, the app is not directly rendering the HTML incl graphics from DG but paints checkers, board etc, so this should be possible.

(this would also be a good beginner task for me :-) )

(ideally we might create a design object and adjust the code so that adding more designs gets easier)

hape42 commented 2 years ago

Basically a good idea.

But do not underestimate the effort ! In the group SupportingFiles/Images/ there is an Asset Catalog. This is also called "Asset", there are, besides a few images, 4 directories. Each directory contains all images for a board. for example: pt_dk_up_b3 pt_dk_up_y3 pt_lt_up0 die_b3

If you want to create additional boards, you copy best so a complete directory and change each image. So that it remains also downward compatible, you must keep strictly to the naming convention and the height and width of the respective picture.

hape42 commented 2 years ago

Unfortunately, I didn't program this very flexibly. At the moment it is set to 4 possible boards. IMG_7BFD4E5EE5F6-1

To be able to add and select more boards, we have to change the display in the setup.

Here we need something that you can scroll. I will think of something.

kagsteiner commented 2 years ago

Yes, I've seen the directory, quite a lot of files - 0..15 for two colors, for 2 directions. Plus quite a few if-then-else for the four designs and the page you've shown above. Still, I want this and I can build this, now :-) (hopefully)

hape42 commented 2 years ago

I just remembered:

When you select a board, you also set a so-called TintColor.

You can easily test the effects yourself by changing the board.

Buttons, many texts etc are displayed in the TintColor.

Since we change from static 4 borads to an open number of boards I will think about what to do.

In any case, the person who designs a new board must also specify a scheme color.

kagsteiner commented 1 year ago

Probably the right solution would be to introduce a "BoardDesign" object that knows how to render checkers, points in both colors, dice, background and replace the rendering code to use it. Would be a huge amount of work, particularly if we would simplify from "independent images for 'one checker on point' to '15 checkers on point'" to dynamically rendering the individual checkers with different y coordinates.

hape42 commented 1 year ago

The topic fits well with the project I just started. I plan to split the monster "PlayMatch" of more than 2500 lines of code into meaningful methods / classes. One method I will outsource will be "drawBoard". I can take that into account right away that it will be eagl if the graphic elements are fetched from an "assets container" (like until now) or in the future will be drawn only when displaying.

I myself have no know how of drawing or rendering . But I can take care of the interfaces.

It will be a huge construction site. 💪

Translated with www.DeepL.com/Translator (free version)

kagsteiner commented 1 year ago

... One method I will outsource will be "drawBoard". I can take that into account right away that it will be eagl if the graphic elements are fetched from an "assets container" (like until now) or in the future will be drawn only when displaying.

This would be very cool to have; drawing should be no big issue then. When can I have the outsourced drawBoard? :-)

hape42 commented 1 year ago

Challenge accepted.😎 You develop the code around the basic elements to characters like checkers, points, dices, doubling cubes indicators.

In time, I'll implement this so that there will be a layer that controls whether the schema fetches images from the asset catalog or is provided by your routines. Deal?

hape42 commented 1 year ago

The issue was moved to Roadmap