Commit graph

229 commits

Author SHA1 Message Date
Jay Oster cb14f2d977
Add minimal example with winit (#45)
- Closes #44
2019-11-09 23:32:37 -08:00
Jay Oster 98983d201d Fix doc comment 2019-11-06 23:15:28 -08:00
Jay Oster d56625577d
Update READMEs (#42) 2019-11-06 22:37:16 -08:00
Jay Oster efa57289cb
Hypothesis: Removing the Travis cache should make CI builds much faster (#41) 2019-11-06 22:07:07 -08:00
Jay Oster a92adf1b12
Add explicit clippy deny all, and forbid unsafe code (where possible) (#38) 2019-11-06 21:16:25 -08:00
Thom Chiovoloni e0225c145d Add a conways game of life example (#37)
* Add a conways game of life example

* Rustfmt conway example

* Respond to review feedback (p_width/p_height)

* Use line_drawing instead of manual bresenham

* Optimize count_neibs

* Remove inline(never) leftover from when profiling

* Bring back wrapping behavior (without regressing perf)

* Fix missing bounds check
2019-11-05 23:15:58 -08:00
Jay Oster 17c6054f40 Bump version 2019-11-03 22:28:00 -08:00
Jay Oster d97f57cb79 Fix the maintenance badge 2019-11-03 22:12:56 -08:00
Jay Oster 84d35e1205
Update wgpu to 0.4.0 (#35)
- Closes #16
- Closes #32
2019-11-03 22:07:57 -08:00
Jay Oster 2d0b053cd7 flat_map 2019-11-03 16:58:58 -08:00
Jay Oster 0792d47ae7
Add badges for crates.io (#34) 2019-11-03 16:55:17 -08:00
Jay Oster f19740003f Minor doc improvement 2019-11-02 23:16:26 -07:00
Jay Oster 703773f35d
Exclude extraneous files from crate (#33) 2019-11-02 22:44:10 -07:00
Jay Oster 6a2c1426fc Add sponsors button 2019-11-02 20:17:13 -07:00
Jay Oster 28f927e153
Switch from rand_core to randomize (#31)
- For #7
2019-11-02 15:29:09 -07:00
Jay Oster 113ffafced Use TextureFormat to show the example iterates one-byte-per-pixel 2019-10-31 20:35:54 -07:00
Jay Oster de50b40d41 Add license 2019-10-30 23:30:09 -07:00
Jay Oster 27c4309223 Fix typo 2019-10-29 20:49:25 -07:00
Jay Oster 7844c15a77
Add gamepad support (#28)
* Add gamepad support

* Try to fix the build
2019-10-28 01:03:03 -07:00
Jay Oster 109d115997 Document rounding the screen size to account for non-integer HiDPI scaling factors 2019-10-27 20:36:49 -07:00
Jay Oster 4bbf9770bc Document accessing wgpu through pixels 2019-10-27 20:34:48 -07:00
Jay Oster b7e751b507 Fix typo in docs 2019-10-27 20:28:06 -07:00
Jay Oster 6392ff9481
Fix syntax in the example (#27)
- This works because `wgpu` is a dependency for `pixels`
- But this example should be demonstrating how to ony depend on `pixels` ... And whatever windowing system and event-loop you might want.
2019-10-27 20:27:42 -07:00
Jay Oster 5795fa7943
Add include_spv!() macro, donated by Ralith (#26) 2019-10-27 19:50:15 -07:00
Jay Oster 994cc9a03c Fix typo 2019-10-27 16:36:47 -07:00
Jay Oster 8bebb29a06
Fix screen scaling when window is resized (#25)
* Refactor window creation and size handling

* Require pixel aspect ratio to be > 0

* Fix screen scaling when window is resized

- Ensure the screen retains its correct pixel aspect ratio
- Updated public API on `RenderPass` ... this will continue to be unstable until the initial release
- Add build instructions for the internal shaders
2019-10-27 16:35:22 -07:00
Jay Oster cc04f14a3d
Controls should not be mutable (#24) 2019-10-26 22:03:12 -07:00
Jay Oster 31225385c7
Improve syntax slightly when handling RedrawRequested (#23) 2019-10-23 19:31:42 -07:00
Jay Oster 8801bad58a
Update public API to provide &mut [u8] instead of accepting &[u8] from the app (#22)
- Closes #19
2019-10-21 23:17:58 -07:00
Jay Oster b18690f19f
Clean up event handling with winit_input_helper (#21)
* Clean up event handling with winit_input_helper

- Closes #20

* QoL improvements
2019-10-21 22:34:12 -07:00
Jay Oster a7802453ec
Update dependencies (#17)
* Update dependencies. Fixed #14

* Fix CI

* Update locked dependencies
2019-10-20 17:32:11 -07:00
Jay Oster 3102b5b485 Update README 2019-10-15 18:43:01 -07:00
Jay Oster ea4e2aafc1
Track hidpi_factor, and properly round the physical pixel size (#15) 2019-10-15 01:09:33 -07:00
Jay Oster 6f0b1e0102
Support resize (#12)
- `Pixels` now takes ownership of the `Surface`. Deal with it. CBF to mess around with weird static lifetime requirements that don't make sense.
2019-10-14 22:17:42 -07:00
Jay Oster 383b0d83ff
Replace vk-shader-macros with pre-compiled GLSL. Fixes #9 (#10) 2019-10-13 21:43:30 -07:00
Jay Oster 076e4e519e
Implement collision detection (#8)
* Implement collision detection

* Minor cleanups.

* Add laser/player collisions

* Add laser collision with bullets and fix fire button repeating

* Add basic shield collisions

* Refactor collision and debug

* Simplify collision and debug by not tracking laser indices

- We don't care about which laser collided, because they get destroyed immediately.

* Don't track laser indicies against bullets either

* DRY and docs

* Adjust the fleet bounding box as invaders are shot
2019-10-13 19:48:20 -07:00
Jay Oster a793787292 Update README 2019-10-13 18:35:47 -07:00
Jay Oster b6fcf803e7
Invader AI (#6)
* WIP: Invader AI

- Adds debug mode for visualizing bounding boxes
- Adds rectangle and line drawing (for debug mode)
- Invaders move as a close approximation to the original game
- TODO: Demonstrates that the blit function needs to ignore black pixels (or "transparency")
- TODO: The invader movement code is really bad

* clippy and fmt

* Refactor Invader movement

* Support "transparency" in blit function

* Scale player movement to 60 pixels per second, regardless of frame rate.

* Add assertions in blit to prevent drawing out of bounds

* Add bullets, shoot with space

* Add lasers, and improve the bullet animation a little bit

* fmt
2019-10-12 14:26:47 -07:00
Jay Oster 31bc8c7614
Refactor animations (#5)
- `SpriteRef` impls `Animation`, `Sprite` does not
- Animation duration and delta time now lives on the struct that handles the animation "state machine"
- Tweak the player animation to 100ms frame duration (was 50ms)
2019-10-08 19:54:57 -07:00
Jay Oster d0a16f9a71
Add player controls and shields (#4) 2019-10-08 00:35:53 -07:00
Jay Oster d7fc1eca3c
Refactor SpriteCache and animation (#3)
* Refactor SpriteCache and animations

- Animation frames are now enumerated
- Renamed the `Sprites` trait into the more apt `Drawable`
- Moved animation to a default impl on `Drawable`
- Added the Cthulhu invader
- Clarify that `World::step_invaders()` is only needed for handling the invader grid
- Renamed `Cannon` to `Bullet`

* Improve readability of some `SpriteCache` uses.
2019-10-07 20:22:34 -07:00
Jay Oster e4249ed766 Update README 2019-10-07 01:17:36 -07:00
Jay Oster 2767d47d67 Fix for MSRV 2019-10-07 01:11:20 -07:00
Jay Oster 348533ee9a Add delta time steps and a placeholder for control inputs 2019-10-07 01:00:33 -07:00
Jay Oster 960bfb9b3f clippy 2019-10-07 00:31:49 -07:00
Jay Oster d815bb464b Refactor simple-invaders 2019-10-06 13:53:08 -07:00
Jay Oster 1e5621c820 Refactor the stepper 2019-10-06 03:31:16 -07:00
Jay Oster 63369b8fe0 Fix CI
- `--workspace` is a nightly-only arg
2019-10-06 02:41:41 -07:00
Jay Oster aa9fdf56bf Enable clippy and tests on the entire workspace 2019-10-06 02:31:29 -07:00
Jay Oster 3b7638a012 Initial simple-invaders WIP
- Currently animates two flavors of invader in their usual formation
- Lots left to do, but this is a good start
2019-10-06 02:24:07 -07:00