kawa-kokosowa / sappho

2D Game Library
http://sappho.lillian.link/
MIT License
15 stars 1 forks source link

Create spatial partitions #105

Open kawa-kokosowa opened 7 years ago

kawa-kokosowa commented 7 years ago

I'm creating this PR early, please read the commit messages.

in the future a method will handle updating positions, which will have a side effect of moving said object having its position updated (a sprite) to the sprite group of respective spatial partition.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.4%) to 97.423% when pulling e0a2b5d8f4be5789df94b4c6784e2c946c9d8128 on feature/spatial-partitions into eb047edc09c97584b83d2343b23a0854c854f3c3 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.4%) to 97.423% when pulling 1800275a3829b149a06dfe4adb97321026c3fb84 on feature/spatial-partitions into eb047edc09c97584b83d2343b23a0854c854f3c3 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.4%) to 97.432% when pulling d61007f552aa9fabb8f27512de94a8f322ca41ed on feature/spatial-partitions into 58f72b6d04c1d0ec511026473f4475eed15c9bd5 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.1%) to 96.711% when pulling d65434ce9b45e42b4377e7ed778d0f26eced3267 on feature/spatial-partitions into 58f72b6d04c1d0ec511026473f4475eed15c9bd5 on master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.1%) to 96.711% when pulling 77b6e2be4bf557f86dc72b97c46ec4640d615351 on feature/spatial-partitions into 58f72b6d04c1d0ec511026473f4475eed15c9bd5 on master.

kawa-kokosowa commented 7 years ago

i think all that's left is to do actual group management and then it's done? it'd be nice to get it integrated into demo before merge. oh and more tests... review at any point welcome (@kcsaff?). I have a lot of stuff to clean up. Note that I should file a bug report for not having a comprehensive solution for looking up partitions for a rect which is two times the normal_partition_height or normal_partition_width, but I consider this a non-issue for now; the current method leaves room to be left as a heuristic.

kawa-kokosowa commented 7 years ago

you can use spatial partitions to selectively only update the contents of partitions that are on screen/nearby/etc. i should note of this.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-1.1%) to 96.7% when pulling 1d7e8a8d7d66d7d579ef34894563b05fe5d5e353 on feature/spatial-partitions into 58f72b6d04c1d0ec511026473f4475eed15c9bd5 on master.