I have a psuedo board game type thing I am working on and I am wondering the best way to track any sort of figures going across the board. I am not sure the best method, but I thought of using a list to have all of the positions of the board, then apply an offset for each other player so they don't fall on the exact same spot on the board tiles. However, my attempt to use a list has not been successful -- it doesn't seem to want to be used a way to dump in xpos and ypos values as I had hoped. Tends to just get an error about "Image xpos 157 ypos 8 was not found" which is a weird error to me. Anyway, here I am...
Code: Select all
## This likely doesn't work, but this is what I had in mind...
default board_tiles = {
1:"xpos 157 ypos 8",
2:"xpos 207 ypos 8"
}
## and so on...
default p1_pos = 1 ## This number will change based on dice rolls and such, so I just add to it
default p1_figure = "board_tiles[p1_pos]"
default p2_pos = 1
default p2_figure = "board_tiles[p2_pos]"
screen player_figures:
add "Example_Figure_001.jpg":
anchor (0.5, 0.5)
p1_figure
add "Example_Figure_002.jpg":
anchor (0.5, 0.5)
p2_figure
xoffset (5)