feat(examples): add ducking in plateforming example

Show how we can now modify in action an hitbox without glitching it
This commit is contained in:
Kazhnuz 2019-06-22 20:17:36 +02:00
parent b770253cb5
commit c553dfafa3
2 changed files with 7 additions and 1 deletions

View file

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased ## Unreleased
### Added
- **actor2D:** Make hitbox modifiable.
### Changed ### Changed
- **world2D:** Use a list for bodies (hitboxes, etc) and one other for actors - **world2D:** Use a list for bodies (hitboxes, etc) and one other for actors

View file

@ -15,7 +15,9 @@ function Player:updateStart(dt)
self.ysp = -280 self.ysp = -280
end end
if self.keys["down"].isDown then if self.keys["down"].isDown then
--self.ysp = 120 self.mainHitbox:modify(0, 8, 16, 16)
else
self.mainHitbox:modify(0, 0, 16, 24)
end end
if self.keys["left"].isDown then if self.keys["left"].isDown then
self.xsp = -120 self.xsp = -120