diff options
author | Mark Powers <markppowers0@gmail.com> | 2020-05-14 10:21:26 -0500 |
---|---|---|
committer | Mark Powers <markppowers0@gmail.com> | 2020-05-14 10:21:26 -0500 |
commit | ae74d0d38196c14ea79cef2444f508c649c57580 (patch) | |
tree | 8b13e3e4ed560f11ef377dae340aa2b7584ebf8c /src/paperflight/static/items.js | |
parent | be1201b6aabc5365cadfff24049fe311d8458c9b (diff) |
Refactor some functions into util.js, add better vent wind
Diffstat (limited to 'src/paperflight/static/items.js')
-rw-r--r-- | src/paperflight/static/items.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/paperflight/static/items.js b/src/paperflight/static/items.js index 11c2047..16ea754 100644 --- a/src/paperflight/static/items.js +++ b/src/paperflight/static/items.js @@ -1,39 +1,45 @@ -function vent(x, y, width, height){ +/** + * Contains functions to create each type of object that can + * appear in a level. + */ + +function constructVent(x, y, width, height){ return { draw: drawVent, update: updateVent, + wind: [], x, y, width, height } } -function coin(x, y, radius=10){ +function constructCoin(x, y, radius=10){ return { draw: drawCoin, update: updateCoin, x, y, radius } } -function block(x, y, width, height){ +function constructBlock(x, y, width, height){ return { draw: drawBlock, update: updateBlock, x, y, width, height } } -function ramp(x, y, width, height, slope){ +function constructRamp(x, y, width, height, slope){ return { draw: drawRamp, update: updateRamp, x, y, width, height, slope } } -function getSwitch(x, y, width, height, stateCount){ +function constructSwitch(x, y, width, height, stateCount){ return { draw: drawSwitch, update: updateSwitch, x, y, width, height, stateCount } } -function switchRect(x, y, width, height, state){ +function constructRect(x, y, width, height, state){ return{ draw: drawSwitchRect, update: updateSwitchRect, |