Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Game of life example incorrectly resizes the window #1985

Closed
pushfoo opened this issue Feb 24, 2024 · 0 comments
Closed

Bug: Game of life example incorrectly resizes the window #1985

pushfoo opened this issue Feb 24, 2024 · 0 comments

Comments

@pushfoo
Copy link
Member

pushfoo commented Feb 24, 2024

Bug Report

This was originally found by @Xexxar and reported on Discord while testing the 3.12 branch.

System Info:

Arcade versions known to be affected: 2.6, the tip of development
OS versions tested: Debian 11 and Arch Linux

Actual behavior:

The Game of Life - Shader Version example resizes the window to be (WIDTH / CELL_SIZE, HEIGHT / CELL_SIZE) pixels in size.

Expected behavior:

The window stays at the full size, but draws the pixels at the correct size.

Steps to reproduce/example code:

For version 2.6: python -m arcade.experimental.examples.game_of_life_colors
For version 3.0: python -m arcade.examples.gl.game_of_life_colors

Root Cause

The window is set to the halved size rather than the texture:

class GameOfLife(arcade.Window):
def __init__(self, width, height):
super().__init__(width, height, "Game of Life - Shader Version")
self.frame = 0
# Configure the size of the playfield (cells)
self.size = width // CELL_SIZE, height // CELL_SIZE

pushfoo added a commit to pushfoo/arcade that referenced this issue Feb 24, 2024
einarf pushed a commit that referenced this issue Feb 24, 2024
* Fix window sizing in game of life example (#1985)

* Clean up import order and spacing

* Use more style-compliant main check for running the shader game of life

* Fix grammar in comment

* Update comments and docstrings on implementation

* Rephrase top-level example docstring for clarity

* phrasing tweak
@einarf einarf closed this as completed Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants