Commit graph

20 commits

Author SHA1 Message Date
Gered 2bb4365e08 add some derivations for BlitMethod enum 2022-05-23 14:46:58 -04:00
Gered 41c37fe874 add helper method for testing if a vector is almost the zero vector 2022-05-23 14:14:34 -04:00
Gered 9072879f4f fix incorrect return type. mutable component should be returned 2022-05-22 17:50:16 -04:00
Gered db261d2356 add 'Resume' state that game states go through when they wake up again
this is to provide an easy way for game states to react to the specific
scenario where they were previously paused and then are re-awakened and
may want to perform (re-)initialization like they may have done in a
previous 'Pending' state (which is only set when states are first
created)
2022-05-22 10:50:12 -04:00
Gered 2c2ba24e6b add method to create Palettes with specific initial color RGB value
for all colors, instead of always initializing new palettes to black
2022-05-21 20:09:27 -04:00
Gered 264c71677b add helper/debug method to draw a palette to a bitmap 2022-05-21 16:40:09 -04:00
Gered a4e98ce108 "clean up" imports, re-export under separate top-level crates 2022-05-20 22:12:55 -04:00
Gered f0930c90d7 allow for multiple states to be popped at once 2022-05-16 20:36:42 -04:00
Gered 4d7f84281b cleanup. return errors instead of panics
the panics were originally added to aid with testing during some rework.
i'm 99% certain these two scenarios cannot occur anymore anyway
2022-05-16 19:00:48 -04:00
Gered ee9474b231 add state swapping support 2022-05-16 18:59:38 -04:00
Gered af09c61796 fix state transitions for dead/pending so they happen faster
this removes some "dead" frames when pushing/popping states during the
transition between them where there would be at least 1 tick where
no update/render would be called because the top state would be still
in a "dead" or "pending" state
2022-05-15 20:43:54 -04:00
Gered e2888ca710 formatting 2022-05-15 20:39:56 -04:00
Gered 340dd445d7 minor adjustments 2022-05-15 19:31:56 -04:00
Gered 7c8e1dc21c add balls_v2 example 2022-05-15 16:34:25 -04:00
Gered 2f23bc5ce1 add is_empty method to States
this is intended to allow a game loop to determine if the state
manager is actually doing anything or not, allowing the game loop to
exit out when it determines if there are no states and no more pending
states.
2022-05-15 14:41:23 -04:00
Gered 4e291f33dc add contains_key convenience component store method 2022-05-15 14:40:06 -04:00
Gered 2470919d17 ComponentSystems update/render functions now only take context argument
most apps would almost certainly want to add an Entities instance
to whatever context they were going to be passing in to these functions,
but removing the explicit dependency directly to ComponentSystems itself
removes some ownership issues.
2022-05-15 12:27:12 -04:00
Gered a05be17821 update gitignore 2022-05-15 12:14:12 -04:00
Gered 4c5c397d9e add "balls" example 2022-05-15 12:13:29 -04:00
Gered 38e6826440 initial commit 2022-05-15 12:11:46 -04:00