2021-09-03 05:33:28 +00:00
|
|
|
// Generic "Solid" Doodad Script
|
|
|
|
/*
|
|
|
|
The entire square shape of your doodad acts similar to "solid"
|
|
|
|
pixels - blocking collision from all sides.
|
|
|
|
|
|
|
|
Can be attached to any doodad.
|
|
|
|
*/
|
|
|
|
|
|
|
|
function main() {
|
|
|
|
// Make the hitbox be the full canvas size of this doodad.
|
|
|
|
// Adjust if you want a narrower hitbox.
|
2021-09-04 03:39:44 +00:00
|
|
|
if (Self.Hitbox().IsZero()) {
|
|
|
|
var size = Self.Size()
|
|
|
|
Self.SetHitbox(0, 0, size.W, size.H)
|
|
|
|
}
|
2021-09-03 05:33:28 +00:00
|
|
|
|
|
|
|
// Solid to all collisions.
|
|
|
|
Events.OnCollide(function (e) {
|
|
|
|
return false;
|
|
|
|
})
|
|
|
|
}
|