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

Add Pixel Scaling & Allow Setting UPS #2

Closed
wants to merge 5 commits into from

Conversation

nixpulvis
Copy link

@nixpulvis nixpulvis commented Oct 9, 2019

This fixes two main issues I had with this implementation of Conway's Game of Life and makes a few other small changes. Mainly:

  1. The scaling feature was blurry, so I've removed it, and implemented a simple set of for loops to draw extra pixels instead. This means that SCALE is now a u32.
  2. I've added an explicit EventSettings to allow setting the UPS, aka updates per second. This makes high scale games much more fun to watch.
  3. I've also made it default to fullscreen. I'm happy to undo this, but I feel it really highlights how awesome this game is.

I've had to downgrade the version of image to still render at 1920x1080 correctly. When I get some more time I can look into what's changes with the latest versions.

P.S. Playing this game at 1920x1080 is very very fun, thanks for making this.

1920x1080

Cargo.toml Outdated
@@ -13,6 +13,6 @@ unstable = []
[dependencies]

rand = "0.6.5"
piston_window = "0.87.0"
image = "0.21.0"
piston_window = "0.64.0"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These downgrades are pretty severe.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I need to spend a few minutes looking into why things render at the wrong scale with the latest versions. As things are with this PR (at least on my setups) at SCALE = 1 each cell is exactly one pixel. Which is what I want.

Copy link
Author

@nixpulvis nixpulvis Oct 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it seems it's just my laptop screen that's blurry with the latest versions. I wouldn't be at all surprised if this is a bug (or some half worked feature) in piston, or glutin.

Copy link
Author

@nixpulvis nixpulvis Oct 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed with a patch to the underlying window in 1e6bf29. I'm not 100% sure why there's a draw_size and size to be perfectly honest, so I'll need to dig more into this still.

crazymykl added a commit that referenced this pull request Jan 23, 2025
This makes the pixels nice and crispy.

Supercedes #2.
crazymykl added a commit that referenced this pull request Jan 23, 2025
This makes the pixels nice and crispy.

Supercedes #2.
crazymykl added a commit that referenced this pull request Jan 23, 2025
This makes the pixels nice and crispy.

Supercedes #2.
@crazymykl
Copy link
Owner

Fixed by #7.

@crazymykl crazymykl closed this Jan 23, 2025
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

Successfully merging this pull request may close these issues.

2 participants