Skip to content
Alexey Golubev edited this page Dec 14, 2021 · 3 revisions

Game use ini config file placed in ./resources/config.ini
All default values you can find in src/consts.rs.

Let's walk through supported sections.

score or Leaderboard section

This section contains only three keys (users, scores and times). All values is separated by , character and have same length.

Keys

  • users — list of user names (Vec<String>; default: [])
  • scores — list of user scores (Vec<u32>; default: [])
  • times — list of user played time in format: (Vec<String>; default: []; format: hour:minutes:seconds)

Example

[score]
users = user1,user2,user3
scores = 9000,8780,8300
times = 00:09:10,00:11:30,00:05:42

game or Gameplay configuration section

Keys

  • show_highscore_at_start — (true|false; default: false)
  • magnetization — figure in "hand" attract to game field (true|false; default: false)
  • blend — figure in "hand" blend with game field (true|false; default: true)
  • alpha — blend factor ([0, 255]; default: 150)
  • fps — game fps (default: 60)
  • username — default username (used with ask_username; default: user)
  • ask_username — need to ask username to add in leaderboard or take name from previous param (true|false; default: true)
  • state — current game state ([a-zA-Z0-9+~]{36}; for details see src/save.rs)

Example

[game]
show_highscore_at_start = false
magnetization = false
blend = true
alpha = 150
fps = 60
username = user
ask_username = true
state = abMGcdHkh4abKK2abWBaaaaq4aaaaaaaaanG

audio or Game audio section

Keys

  • enable_sound — on|off sound effects (true|false; default: true)
  • enable_music — on|off background music (true|false; default: true)
  • volume_sound — sound effects volume ([0, 128]; default: 20)
  • volume_music — background music volume ([0, 128]; default: 128)

Example

[audio]
enable_sound = true
enable_music = true
volume_sound = 20
volume_music = 128

color or Game palette section

All value present by three values aka R, G, B

Keys

  • game_background — background color (default: 100, 100, 100)
  • field_background — game field color (default: 170, 170, 170)
  • font — main font color (default: 200, 200, 200)
  • light — second font color (default: 255, 255, 255)
  • border — border color of game menus (default: 210, 210, 210)
  • fig<N> — color of Nth-figure (default: see example)

Example

[color]
game_background = 100, 100, 100
field_background = 170, 170, 170
font = 200, 200, 200
light = 255, 255, 255
border = 210, 210, 210
fig1 = 230, 100, 100
fig2 = 230, 210, 100
fig3 = 100, 230, 100
fig4 = 230, 100, 200
fig5 = 100, 230, 200
fig6 = 100, 200, 230
fig7 = 100, 100, 230
fig8 = 210, 100, 230