diff options
author | Mark Powers <markppowers0@gmail.com> | 2020-05-13 22:39:19 -0500 |
---|---|---|
committer | Mark Powers <markppowers0@gmail.com> | 2020-05-13 22:39:19 -0500 |
commit | 7889250b115eec8709c0c9ff8345e0bef88037b5 (patch) | |
tree | 6e20aa84ff1361e23b569811e617951518faa1aa /src/paperflight/static/items.js | |
parent | e0552a705e3ddfd79a684ee7a67ca02f57fbb2bc (diff) |
Add item constructors
Diffstat (limited to 'src/paperflight/static/items.js')
-rw-r--r-- | src/paperflight/static/items.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/paperflight/static/items.js b/src/paperflight/static/items.js new file mode 100644 index 0000000..11c2047 --- /dev/null +++ b/src/paperflight/static/items.js @@ -0,0 +1,42 @@ +function vent(x, y, width, height){ + return { + draw: drawVent, + update: updateVent, + x, y, width, height + } +} +function coin(x, y, radius=10){ + return { + draw: drawCoin, + update: updateCoin, + x, y, radius + } +} +function block(x, y, width, height){ + return { + draw: drawBlock, + update: updateBlock, + x, y, width, height + } +} +function ramp(x, y, width, height, slope){ + return { + draw: drawRamp, + update: updateRamp, + x, y, width, height, slope + } +} +function getSwitch(x, y, width, height, stateCount){ + return { + draw: drawSwitch, + update: updateSwitch, + x, y, width, height, stateCount + } +} +function switchRect(x, y, width, height, state){ + return{ + draw: drawSwitchRect, + update: updateSwitchRect, + x, y, width, height, state + } +}
\ No newline at end of file |