Skip to content

Move Constants into a config file #12

@aylusltd

Description

@aylusltd

As an example:
In sprites.py

for row in app.screen.grid:
        for s in row:
            r = random.randint(0,12)
            start_cluster= r == 0
            continue_cluster= r < 5
            neighbor = app.screen.neighbor_has(feature="rock", i=s.row,j=s.column)
            if ((start_cluster or (continue_cluster and neighbor)) and s.square_type == "grass" and not s.occupied):
                s.add_feature("rock", app)

start_cluster should not be hard-coded to occur 1 in 12 times.
continue_cluster occurs 5/12 times.

These numbers were chosen randomly based on personal use to make the map look interesting, and should be in a config yaml somewhere, and able to be easily overwritten for different environments (e.g. related to the altitude/dungeon ticket)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions