diff options
Diffstat (limited to 'res/scripts/common.lua')
-rw-r--r-- | res/scripts/common.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/res/scripts/common.lua b/res/scripts/common.lua index 895ad7b..825d2e5 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua | |||
@@ -329,3 +329,18 @@ function AllowCrouching() | |||
329 | local playerSprite = getSprite(playerId) | 329 | local playerSprite = getSprite(playerId) |
330 | playerSprite.cantCrouch = false | 330 | playerSprite.cantCrouch = false |
331 | end | 331 | end |
332 | |||
333 | --- Makes a sprite start bobbing up and down (for underwater). | ||
334 | -- This only applies when the sprite is on a normal medium (so, not on ladders). | ||
335 | function StartBobbing(spriteName) | ||
336 | local spriteId = getSpriteByAlias(spriteName) | ||
337 | local sprite = getSprite(spriteId) | ||
338 | sprite.bobsWhenNormal = true | ||
339 | end | ||
340 | |||
341 | --- Makes a sprite stop bobbing up and down. | ||
342 | function StopBobbing(spriteName) | ||
343 | local spriteId = getSpriteByAlias(spriteName) | ||
344 | local sprite = getSprite(spriteId) | ||
345 | sprite.bobsWhenNormal = false | ||
346 | end | ||