Hopson97 / Asciimon

Pokemon-inspired game created using Rust for terminals which support ANSI escape commands.
124 stars 11 forks source link

Magic numbers #18

Closed Hopson97 closed 6 years ago

Hopson97 commented 6 years ago

The game is using way to many meaningless numbers, particularly when creating rendering sections.

Any ideas for improving this?

This is what I am talking about:

        game.renderer
            .add_render_section("game", Vector2D::new(0, 7), GAME_AREA_SIZE);

        game.renderer
            .add_render_section("logo", Vector2D::new(0, 0), Vector2D::new(50, 6));

        game.renderer.add_render_section(
            "input",
            Vector2D::new(50, 0),
            Vector2D::new(GAME_AREA_SIZE.x - 50, 6),
        );

        game.renderer.add_render_section(
            "console",
            Vector2D::new(GAME_AREA_SIZE.x + 1, 0),
            Vector2D::new(32, 52),
        );
dmitmel commented 6 years ago

21