Doodad Hitboxes and Solidity #6
Labels
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: SketchyMaze/doodle#6
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add the ability for Doodads to define their own solid hitboxes in JavaScript code and ability to push back other actors who collide with it. This way, locked doors can act like solid walls until opened and trapdoors can prohibit movement from the wrong direction but open and allow movement when hit from their entrance side.
Implementation notes:
Self.SetHitbox(X, Y, W, H)
for a doodad to register the shape of its hitbox, relative to its canvas box. (X=0 Y=0 being the top-left corner of the doodad's canvas).OnCollide
handler, the engine will pass a booleanInHitbox
if the actor colliding is already inside the doodad's hitbox. This way the OnCollide function can decide easily if it shouldreturn false
to act solid and reject the collision.Canvas.Loop()
):InHitbox
boolean value)