forked from bevyengine/bevy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up Breakout logic (bevyengine#4311)
# Objective 1. Spawning walls in the Breakout example was hard to follow and error-prone. 2. The strategy used in `paddle_movement_system` was somewhat convoluted. 3. Correctly modifying the size of the arena was hard, due to implicit coupling between the bounds and the bounds that the paddle can move in. ## Solution 1. Refactor this to use a WallBundle struct with a builder; neatly demonstrating some essential patterns along the way. 2. Use clamp and avoid using weird &mut strategies. 3. Refactor logic to allow users to tweak the brick size, and automatically adjust the number of rows and columns to match. 4. Make the brick layout more like classic breakout! ![image](https://user-images.githubusercontent.com/3579909/160019864-06747361-3b5b-4944-b3fd-4978604e2ef5.png)
- Loading branch information
1 parent
a190cd5
commit 8570b65
Showing
1 changed file
with
159 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters