Skip to content

Commit

Permalink
Allow modification of settings at runtime (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
boatbomber authored Sep 6, 2022
1 parent d7f5f15 commit 8b9f389
Show file tree
Hide file tree
Showing 11 changed files with 204 additions and 11,128 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/*.rbxlx
/*.rbxm
/*.rbxmx
/sourcemap.json

# Roblox Studio lock files
/*.rbxlx.lock
Expand Down
38 changes: 28 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,38 +31,56 @@ https://www.roblox.com/games/6342320514/Wind-Demo

# API:

## Properties

```Lua
number WindShake.UpdateHz
```
*Sets the frequency of the object update stepper. Default 1/45*

```Lua
number WindShake.ComputeHz
```
*Sets the frequency of the object compute stepper. Default 1/30*

```Lua
number WindShake.Radius
```
*Sets the radius for active objects in studs. Default 120*


## Functions

```Lua
function WindShake:Init()
```
*Initializes the wind shake logic and adds shake to all tagged objects*

**Returns:**
**Returns:**
* `void`

```Lua
function WindShake:Cleanup()
```
*Halts and clears the wind shake logic and all object shakes*

**Returns:**
**Returns:**
* `void`

```Lua
function WindShake:Pause()
```
*Halts the wind shake logic without clearing*

**Returns:**
**Returns:**
* `void`

```Lua
function WindShake:Resume()
```
*Restarts the wind shake logic without clearing*

**Returns:**
**Returns:**
* `void`

```Lua
Expand All @@ -77,7 +95,7 @@ The Object to apply shaking to
- `Settings` *[Optional Dictionary]*
The settings to apply to this object's shake (See below for Settings structure)

**Returns:**
**Returns:**
* `void`

```Lua
Expand All @@ -89,7 +107,7 @@ function WindShake:RemoveObjectShake(Object)
- `Object` *[BasePart]*
The Object to remove shaking from

**Returns:**
**Returns:**
* `void`

```Lua
Expand All @@ -105,7 +123,7 @@ function WindShake:SetDefaultSettings(Settings) [DEPRECATED]
- `Settings` *[Dictionary]*
The settings to use as default (See below for Settings structure)

**Returns:**
**Returns:**
* `void`

```Lua
Expand All @@ -122,7 +140,7 @@ The Object to apply shake settings to
- `Settings` *[Dictionary]*
The settings to apply to this object's shake (See below for Settings structure)

**Returns:**
**Returns:**
* `void`

```Lua
Expand All @@ -135,7 +153,7 @@ function WindShake:UpdateAllObjectSettings(Settings)
- `Settings` *[Dictionary]*
The settings to apply to all objects' shake (See below for Settings structure)

**Returns:**
**Returns:**
* `void`

## Events
Expand Down Expand Up @@ -187,7 +205,7 @@ Settings = {
WindDirection: Vector3 to shake towards (Initially 0.5,0,0.5)
WindSpeed: Positive number that defines how fast to shake (Initially 20)
WindPower: Positive number that defines how much to shake (Initially 0.5)

--If one of these is not defined, it will use default for that one,
--so you can pass a table with just one or two settings and the rest
--will be default so you don't need to make the full table every time.
Expand Down
6 changes: 3 additions & 3 deletions foreman.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tools]
selene = { source = "Kampfkarren/selene", version = "0.17.0" }
stylua = { source = "JohnnyMorganz/stylua", version = "0.13.1" }
rojo = { source = "rojo-rbx/rojo", version = "7.0.0" }
selene = { source = "Kampfkarren/selene", version = "0.20.0" }
stylua = { source = "JohnnyMorganz/stylua", version = "0.14.2" }
rojo = { source = "rojo-rbx/rojo", version = "7.2.1" }
wally = { source = "upliftgames/wally", version = "0.3.1" }
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@boatbomber/windshake",
"version": "1.0.0",
"version": "1.1.0",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
Loading

0 comments on commit 8b9f389

Please sign in to comment.