From 3a310a60bd5e9b4ed3041723a6b7ec1092a984fe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 24 Mar 2024 13:48:53 +0000 Subject: [PATCH] deploy: 8e4787f709091b818135a72f851167521184b93c --- 404.html | 2 +- ...36c6e.627047f2.js => 0be36c6e.44e4e04a.js} | 2 +- assets/js/3164f9fb.281a5b03.js | 1 - assets/js/3164f9fb.dfc70995.js | 1 + assets/js/61036be0.b6b2cd3b.js | 1 + assets/js/61036be0.c52ea3e6.js | 1 - ...aa6a8.43876ded.js => 693aa6a8.34bf2d89.js} | 2 +- ...67976.326724d7.js => bde67976.c440d31c.js} | 2 +- assets/js/c9cd16d1.ccdfc422.js | 1 - assets/js/c9cd16d1.ce61f061.js | 1 + ...n.aade9a94.js => runtime~main.7731f4e9.js} | 2 +- blog/archive/index.html | 2 +- blog/first-blog-post/index.html | 2 +- blog/index.html | 2 +- blog/tags/first/index.html | 2 +- blog/tags/index.html | 2 +- docs/APIs/Fmath/index.html | 2 +- docs/APIs/PewPew/index.html | 2 +- docs/APIs/standard-libraries/index.html | 2 +- docs/APIs/types/index.html | 2 +- .../manifest-files/index.html | 2 +- docs/File Information/mesh-files/index.html | 2 +- docs/File Information/sound-files/index.html | 4 +- docs/Guides/Lua/advanced/index.html | 5 +- docs/Guides/Lua/beginner/index.html | 66 ++++++++----------- docs/Guides/Lua/intermediate/index.html | 37 +++++------ docs/Guides/Other/fps-animation/index.html | 22 +++---- docs/intro/index.html | 2 +- docs/other/level-design-principles/index.html | 2 +- docs/other/level-restrictions/index.html | 8 +-- docs/other/trivia/index.html | 2 +- index.html | 2 +- search-index.json | 2 +- search/index.html | 2 +- 34 files changed, 87 insertions(+), 105 deletions(-) rename assets/js/{0be36c6e.627047f2.js => 0be36c6e.44e4e04a.js} (94%) delete mode 100644 assets/js/3164f9fb.281a5b03.js create mode 100644 assets/js/3164f9fb.dfc70995.js create mode 100644 assets/js/61036be0.b6b2cd3b.js delete mode 100644 assets/js/61036be0.c52ea3e6.js rename assets/js/{693aa6a8.43876ded.js => 693aa6a8.34bf2d89.js} (85%) rename assets/js/{bde67976.326724d7.js => bde67976.c440d31c.js} (55%) delete mode 100644 assets/js/c9cd16d1.ccdfc422.js create mode 100644 assets/js/c9cd16d1.ce61f061.js rename assets/js/{runtime~main.aade9a94.js => runtime~main.7731f4e9.js} (64%) diff --git a/404.html b/404.html index dd65720..d3bef09 100644 --- a/404.html +++ b/404.html @@ -5,7 +5,7 @@
for i, v in pairs()
loop example",id:"for-i-v-in-pairs-loop-example",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",p:"p",pre:"pre",strong:"strong",...(0,l.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"beginner-lua-tutorial",children:"Beginner Lua Tutorial"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://repl.it/languages/lua",children:"https://repl.it/languages/lua"})," can be used to try Lua in the browser."]}),"\n",(0,i.jsx)(n.p,{children:"These examples are more for review, rather than learning! If you see something here that you don't understand, continue to watch Lua tutorials on youtube!"}),"\n",(0,i.jsx)(n.h2,{id:"printing-example",children:"Printing example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'print("Hello world!")\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Output: ",(0,i.jsx)(n.code,{children:"Hello World!"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"print(2 + 3)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Output: ",(0,i.jsx)(n.code,{children:"5"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'print("2 + 3")\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Output: ",(0,i.jsx)(n.code,{children:"2 + 3"})]}),"\n",(0,i.jsxs)(n.p,{children:["Anything in quotation marks ",(0,i.jsx)(n.code,{children:'" "'})," or ",(0,i.jsx)(n.code,{children:"' '"})," is a string. Printing a string will output exactly what you type! Anything not inside of quotation marks are registered as numbers, variables, or mathematics!"]}),"\n",(0,i.jsx)(n.h2,{id:"variables-example",children:"Variables example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"my_variable = 5\nprint(my_variable)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Output: ",(0,i.jsx)(n.code,{children:"5"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"x = 2\ny = 10\nprint(x + y)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Output: ",(0,i.jsx)(n.code,{children:"12"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'x = 2\ny = 10\nprint("x + y")\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Output: ",(0,i.jsx)(n.code,{children:"x + y"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'some_text = "this is cool"\nprint(some_text)\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Output: ",(0,i.jsx)(n.code,{children:"this is cool"})]}),"\n",(0,i.jsx)(n.p,{children:"Variables can be assigned practically any value! You can store them as numbers, strings, and more!"}),"\n",(0,i.jsx)(n.h2,{id:"if-statement-example",children:"If statement example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'x = 6\nif x > 5 then\n print("Greater than 5!")\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Output:\n",(0,i.jsx)(n.code,{children:"Greater than 5!"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'a = true\nb = false\n\nif a then\n print("True")\nend\n\nif a and b then\n print("True")\nelse\n print("False")\nend\n\nif a or b then\n print("True")\nelse\n print("False")\nend\n\nif b then\n print("True")\nend\n'})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"True\nFalse\nTrue\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'x = 5\ny = 5\nif x == y then\n print("True")\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Output:\n",(0,i.jsx)(n.code,{children:"True"})]}),"\n",(0,i.jsx)(n.p,{children:'Variables can also be assigned boolean values, which are true and false! With "and" statements, both or all arguments need to be true to equal true in total! With "or" statements, only one needs to be true to equal true in total! Both or all need to be false to be false in total!'}),"\n",(0,i.jsx)(n.h2,{id:"for-loop-example",children:"For loop example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'for i = 1, 5 do\n print("Hello!")\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The following output is repeated 5 times:\n",(0,i.jsx)(n.code,{children:"Hello!"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"for i = 1, 10 do\n print(i)\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"for i = 1, 10, 2 do\n print(i)\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"1\n3\n5\n7\n9\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"for i = 0, -10, -1 do\n print(i)\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"0\n-1\n-2\n-3\n-4\n-5\n-6\n-7\n-8\n-9\n-10\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local loopcount = 25\nfor i = 1, loopcount do\n print("Loop!")\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The following output is repeated 25 times:\n",(0,i.jsx)(n.code,{children:"Loop!"})]}),"\n",(0,i.jsx)(n.p,{children:'For loops are useful for running the same code multiple times! The first line of the for loop has the syntax for i = Index, End Value, Increments. You set i as your starting value, separate with a comma, set your end value, and you can optionally set your increment as your third value. Don\'t forget the "do"!'}),"\n",(0,i.jsx)(n.h2,{id:"nested-for-loop-example",children:"Nested for loop example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'for i = 1, 5 do\n print("This is the outer loop!")\n for j = 1, 3 do\n print("This is the inner loop!")\n end\nend\n'})}),"\n",(0,i.jsx)(n.p,{children:"The following output is repeated 5 times:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"This is the outer loop!\nThis is the inner loop!\nThis is the inner loop!\nThis is the inner loop!\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local swim_laps = 10\nlocal paddles = 5\nfor i = 1, swim_laps do\n print("Lap: "..i)\n for j = 1, paddles do\n print("Paddle: "..j)\n end\nend\n'})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"Lap: 1\nPaddle: 1\nPaddle: 2\n"})}),"\n",(0,i.jsx)(n.p,{children:"...etc."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'for i = 1, 5 do\n for i = 1, 2 do\n print("This is fine!")\n end\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The following output is repeated 10 times: ",(0,i.jsx)(n.code,{children:"This is fine!"})]}),"\n",(0,i.jsx)(n.p,{children:"You are allowed to put for loops inside of other for loops! In if you put a for loop that repeats 3 times inside of a for loop that repeats 5 times, that inner loop runs 15 times total! With for loops, you can use any variable as your index! And with nested for loops, it is good practice to use different variables, like using i and j instead of using i twice."}),"\n",(0,i.jsx)(n.h2,{id:"while-loop-example",children:"While loop example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local x = 3\nwhile x > 0 do\n print(x)\n x = x - 1\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"3\n2\n1\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local x = 3\nlocal y = 4\nwhile x > 0 and y > 0 do\n print(x,y)\n x = x - 1\n y = y - 1\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"3 4\n2 3\n1 2\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'while true do\n print("Hello!")\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The following output is repeated indefinitely: ",(0,i.jsx)(n.code,{children:"Hello!"})]}),"\n",(0,i.jsx)(n.p,{children:"A while loop is very similar to a for loop, except you can think of it as an if statement and for loop combined! The while loop runs while the conditions are true. So for a while true do loop, the loop runs forever! Be careful when making a while true do loop!"}),"\n",(0,i.jsx)(n.h2,{id:"break-loops-example",children:"Break loops example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'while true do\n print("loop!")\n break\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The above loop will only run once. Output: ",(0,i.jsx)(n.code,{children:"loop!"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'x = 0\nwhile true do\n print("loop!")\n x = x + 1\n if x >=2 then\n break\n end\nend\n'})}),"\n",(0,i.jsx)(n.p,{children:"The above loop will run 2 times. Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"loop!\nloop!\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"for i = 1, 10 do\n print(i)\n if i >= 3 then\n break\n end\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"1\n2\n3\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Using ",(0,i.jsx)(n.code,{children:"break"})," is very useful! The purpose for ",(0,i.jsx)(n.code,{children:"break"})," is to stop a loop from running! So using ",(0,i.jsx)(n.code,{children:"break"})," in a for or while loop will ultimately terminate it!"]}),"\n",(0,i.jsx)(n.h2,{id:"functions-example",children:"Functions example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local function myFunction()\n local x = 4\n local y = 2\n print(x + y)\nend\n\nmyFunction()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"6\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local function AddNum(num1, num2)\n print(num1 + num2)\nend\n\nAddNum(99,121)\nAddNum(44,33)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"220\n77\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local function Cubed(number)\n newNumber = number*number*number\n return newNumber\nend\n\nlocal x = Cubed(2)\nlocal y = Cubed(3)\n\nprint(x,y)\n\nlocal a = Cubed(10)\nprint(a)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"8 27\n1000\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Functions are good for reducing the amount of code you have to write. If you have a piece of code you are going to use over and over with slightly different values, then make that piece of code a function! You can give functions ",(0,i.jsx)(n.strong,{children:"parameters"})," which is the num1 and num2 in myFunction(num1, num2). When you use the function later in your code, don't forget to fill in the parentheses! You can also use ",(0,i.jsx)(n.code,{children:"return"})," to essentially turn a function into a value."]}),"\n",(0,i.jsx)(n.h2,{id:"tables-example",children:"Tables example"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local myTable = {1,5,3}\n\nprint(myTable[1])\nprint(myTable[2])\nprint(myTable[3])\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"1\n5\n3\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local names = {\n "Bob",\n "Moses",\n "Joe"\n}\nfor i = 1, #names do\n print(names[i])\nend\n\nnames[4] = "Dawn"\nprint(names[4])\ntable.insert(names,"Rambo")\nprint(names[5])\n'})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"Bob\nMoses\nJoe\nDawn\nRambo\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local person = {\n health = 100,\n speed = 20,\n isAwesome = true,\n name = "John"\n}\nprint("This person\'s health is "..person.health)\nprint("This person\'s health is "..person["health"])\nprint("This person\'s speed is "..person.speed)\nprint("This person is awesome. "..person.isAwesome)\nprint("This person\'s name is "..person.name)\nprint("This person\'s name is "..person["name"])\n\nperson.home = "USA"\nperson["money"] = 250\n\nprint("This person\'s home is "..person.home)\nprint("This person has "..person["money"].." dollars!")\n\n'})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"This person's health is 100\nThis person's health is 100\nThis person's speed is 20\nThis person is awesome. true\nThis person's name is John\nThis person's name is John\nThis person's home is USA\nThis person has 250 dollars!\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Tables are very good for storing lots of information. You can even put things inside of tables after the table is made! Done with table.insert(TableName, data) or you add things with table[n] = data. And remember, the table doesn't have to be defined on the same line! The brackets "," can be on separate lines to make it easier to read!"]}),"\n",(0,i.jsxs)(n.h2,{id:"for-i-v-in-pairs-loop-example",children:[(0,i.jsx)(n.code,{children:"for i, v in pairs()"})," loop example"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local numbers = {3, 4, 99, 202, -3}\n\nfor i, v in pairs(numbers) do\n print(i, v)\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"1 3\n2 4\n3 99\n4 202\n5 -3\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local names = {"Jack", "Mike", "Melinda", "Stacy"}\n\nfor index, person in pairs(names) do\n print("Person "..index.." is "..person)\nend\n'})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"Person 1 is Jack\nPerson 2 is Mike\nPerson 3 is Melinda\nPerson 4 is Stacy\n"})}),"\n",(0,i.jsx)(n.p,{children:'For i, v in pairs loops are a useful kind of for loop! They basically go through a list and use the data stored in the table. The variable i is the index or position of the table where the data is stored. The variable v is the value of the data. Inside of pairs() is the table you want to use: pairs(TableName). The variables don\'t have to be named "i" and "v", they can be named whatever you want!'})]})}function p(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>a});var i=s(6540);const l={},r=i.createContext(l);function o(e){const n=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:o(e.components),i.createElement(r.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/61036be0.c52ea3e6.js b/assets/js/61036be0.c52ea3e6.js
deleted file mode 100644
index 80d02e2..0000000
--- a/assets/js/61036be0.c52ea3e6.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunkppl_docs=self.webpackChunkppl_docs||[]).push([[2256],{1869:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>t,contentTitle:()=>o,default:()=>h,frontMatter:()=>l,metadata:()=>a,toc:()=>d});var i=s(4848),r=s(8453);const l={sidebar_position:1},o="Beginner Lua Tutorial",a={id:"Guides/Lua/beginner",title:"Beginner Lua Tutorial",description:"https://repl.it/languages/lua can be used to try Lua in the browser.",source:"@site/docs/Guides/Lua/beginner.md",sourceDirName:"Guides/Lua",slug:"/Guides/Lua/beginner",permalink:"/ppl-docs/docs/Guides/Lua/beginner",draft:!1,unlisted:!1,editUrl:"https://github.com/pewpewlive/ppl-docs/edit/master/docs/Guides/Lua/beginner.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Sound files",permalink:"/ppl-docs/docs/File Information/sound-files"},next:{title:"Intermediate",permalink:"/ppl-docs/docs/Guides/Lua/intermediate"}},t={},d=[{value:"PRINTING EXAMPLE",id:"printing-example",level:3},{value:"VARIABLES EXAMPLE",id:"variables-example",level:3},{value:"IF STATEMENT EXAMPLE",id:"if-statement-example",level:3},{value:"FOR LOOP EXAMPLE",id:"for-loop-example",level:3},{value:"NESTED FOR LOOP EXAMPLE",id:"nested-for-loop-example",level:3},{value:"WHILE LOOP EXAMPLE",id:"while-loop-example",level:3},{value:"BREAK LOOPS EXAMPLE",id:"break-loops-example",level:3},{value:"FUNCTIONS EXAMPLE",id:"functions-example",level:3},{value:"TABLES EXAMPLE",id:"tables-example",level:3},{value:"FOR I, V IN PAIRS LOOP EXAMPLE",id:"for-i-v-in-pairs-loop-example",level:3}];function c(e){const n={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,r.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h1,{id:"beginner-lua-tutorial",children:"Beginner Lua Tutorial"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://repl.it/languages/lua",children:"https://repl.it/languages/lua"})," can be used to try Lua in the browser."]}),"\n",(0,i.jsx)(n.p,{children:"These examples are more for review, rather than learning! If you see something here that you don't understand, continue to watch Lua tutorials on youtube!"}),"\n",(0,i.jsx)(n.h3,{id:"printing-example",children:"PRINTING EXAMPLE"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'print("Hello world!")\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Output:\n",(0,i.jsx)(n.code,{children:"Hello World!"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"print(2+3)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Output:\n",(0,i.jsx)(n.code,{children:"5"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'print("2+3")\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Output:\n",(0,i.jsx)(n.code,{children:"2+3"})]}),"\n",(0,i.jsxs)(n.p,{children:["Anything in quotation marks ",(0,i.jsx)(n.code,{children:'" "'})," or ",(0,i.jsx)(n.code,{children:"' '"})," is a string. Printing a string will output exactly what you type! Anything not inside of quotation marks are registered as numbers, variables, or mathematics!"]}),"\n",(0,i.jsx)(n.h3,{id:"variables-example",children:"VARIABLES EXAMPLE"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"my_variable = 5\nprint(my_variable)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Output:\n",(0,i.jsx)(n.code,{children:"5"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"x = 2\ny = 10\nprint(x+y)\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Output:\n",(0,i.jsx)(n.code,{children:"12"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'x = 2\ny = 10\nprint("x+y")\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Output:\n",(0,i.jsx)(n.code,{children:"x+y"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'some_text = "this is cool"\nprint(some_text)\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Output:\n",(0,i.jsx)(n.code,{children:"this is cool"})]}),"\n",(0,i.jsx)(n.p,{children:"Variables can be assigned practically any value! You can store them as numbers, strings, and more!"}),"\n",(0,i.jsx)(n.h3,{id:"if-statement-example",children:"IF STATEMENT EXAMPLE"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'x = 6\nif x > 5 then\n print("Greater than 5!")\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Output:\n",(0,i.jsx)(n.code,{children:"Greater than 5!"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'a = true\nb = false\n\nif a then\n print("True")\nend\n\nif a and b then\n print("True")\nelse\n print("False")\nend\n\nif a or b then\n print("True")\nelse\n print("False")\nend\n\nif b then\n print("True")\nend\n'})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"True\nFalse\nTrue\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'x = 5\ny = 5\nif x == y then\n print("True")\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["Output:\n",(0,i.jsx)(n.code,{children:"True"})]}),"\n",(0,i.jsx)(n.p,{children:'Variables can also be assigned boolean values, which are true and false! With "and" statements, both or all arguments need to be true to equal true in total! With "or" statements, only one needs to be true to equal true in total! Both or all need to be false to be false in total!'}),"\n",(0,i.jsx)(n.h3,{id:"for-loop-example",children:"FOR LOOP EXAMPLE"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'for i = 1, 5 do\n print("Hello!")\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The following output is repeated 5 times:\n",(0,i.jsx)(n.code,{children:"Hello!"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"for i = 1, 10 do\n print(i)\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"for i = 1, 10, 2 do\n print(i)\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"1\n3\n5\n7\n9\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"for i = 0, -10, -1 do\n print(i)\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"0\n-1\n-2\n-3\n-4\n-5\n-6\n-7\n-8\n-9\n-10\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local loopcount = 25\nfor i = 1, loopcount do\n print("Loop!")\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The following output is repeated 25 times:\n",(0,i.jsx)(n.code,{children:"Loop!"})]}),"\n",(0,i.jsx)(n.p,{children:'For loops are useful for running the same code multiple times! The first line of the for loop has the syntax for i = Index, End Value, Increments. You set i as your starting value, separate with a comma, set your end value, and you can optionally set your increment as your third value. Don\'t forget the "do"!'}),"\n",(0,i.jsx)(n.h3,{id:"nested-for-loop-example",children:"NESTED FOR LOOP EXAMPLE"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'for i = 1, 5 do\n print("This is the outer loop!")\n for j = 1, 3 do\n print("This is the inner loop!")\n end\nend\n'})}),"\n",(0,i.jsx)(n.p,{children:"The following output is repeated 5 times:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"This is the outer loop!\nThis is the inner loop!\nThis is the inner loop!\nThis is the inner loop!\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local swim_laps = 10\nlocal paddles = 5\nfor i = 1, swim_laps do\n print("Lap : "..i)\n for j = 1, paddles do\n print("Paddle : "..j)\n end\nend\n'})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"Lap : 1\nPaddle : 1\nPaddle : 2\n"})}),"\n",(0,i.jsx)(n.p,{children:"...etc."}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'for i = 1, 5 do\n for i = 1, 2 do\n print("This is fine!")\n end\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The following output is repeated 10 times:\n",(0,i.jsx)(n.code,{children:"This is fine!"})]}),"\n",(0,i.jsx)(n.p,{children:"You are allowed to put for loops inside of other for loops! In if you put a for loop that repeats 3 times inside of a for loop that repeats 5 times, that inner loop runs 15 times total! With for loops, you can use any variable as your index! And with nested for loops, it is good practice to use different variables, like using i and j instead of using i twice."}),"\n",(0,i.jsx)(n.h3,{id:"while-loop-example",children:"WHILE LOOP EXAMPLE"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local x = 3\nwhile x > 0 do\n print(x)\n x = x - 1\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"3\n2\n1\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local x = 3\nlocal y = 4\nwhile x > 0 and y > 0 do\n print(x,y)\n x = x - 1\n y = y - 1\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"3 4\n2 3\n1 2\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'while true do\n print("Hello!")\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The following output is repeated indefinitely:\n",(0,i.jsx)(n.code,{children:"Hello!"})]}),"\n",(0,i.jsx)(n.p,{children:"A while loop is very similar to a for loop, except you can think of it as an if statement and for loop combined! The while loop runs while the conditions are true. So for a while true do loop, the loop runs forever! Be careful when making a while true do loop!"}),"\n",(0,i.jsx)(n.h3,{id:"break-loops-example",children:"BREAK LOOPS EXAMPLE"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'while true do\n print("loop!")\n break\nend\n'})}),"\n",(0,i.jsxs)(n.p,{children:["The above loop will only run once. Output:\n",(0,i.jsx)(n.code,{children:"loop!"})]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'x = 0\nwhile true do\n print("loop!")\n x = x + 1\n if x >=2 then\n break\n end\nend\n'})}),"\n",(0,i.jsx)(n.p,{children:"The above loop will run 2 times. Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"loop!\nloop!\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"for i = 1, 10 do\n print(i)\n if i >= 3 then\n break\n end\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"1\n2\n3\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Using ",(0,i.jsx)(n.code,{children:"break"})," is very useful! The purpose for ",(0,i.jsx)(n.code,{children:"break"})," is to stop a loop from running! So using ",(0,i.jsx)(n.code,{children:"break"})," in a for or while loop will ultimately terminate it!"]}),"\n",(0,i.jsx)(n.h3,{id:"functions-example",children:"FUNCTIONS EXAMPLE"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local function myFunction()\n local x = 4\n local y = 2\n print(x + y)\nend\n\nmyFunction()\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"6\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local function AddNum(num1, num2)\n print(num1 + num2)\nend\n\nAddNum(99,121)\nAddNum(44,33)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"220\n77\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local function Cubed(number)\n newNumber = number*number*number\n return newNumber\nend\n\nlocal x = Cubed(2)\nlocal y = Cubed(3)\n\nprint(x,y)\n\nlocal a = Cubed(10)\nprint(a)\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"8 27\n1000\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Functions are good for reducing the amount of code you have to write. If you have a piece of code you are going to use over and over with slightly different values, then make that piece of code a function! You can give functions ",(0,i.jsx)(n.strong,{children:"parameters"})," which is the num1 and num2 in myFunction(num1, num2). When you use the function later in your code, don't forget to fill in the parentheses! You can also use ",(0,i.jsx)(n.code,{children:"return"})," to essentially turn a function into a value."]}),"\n",(0,i.jsx)(n.h3,{id:"tables-example",children:"TABLES EXAMPLE"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local myTable = {1,5,3}\n\nprint(myTable[1])\nprint(myTable[2])\nprint(myTable[3])\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"1\n5\n3\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local names = {\n "Bob",\n "Moses",\n "Joe"\n}\nfor i = 1, #names do\n print(names[i])\nend\n\nnames[4] = "Dawn"\nprint(names[4])\ntable.insert(names,"Rambo")\nprint(names[5])\n'})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"Bob\nMoses\nJoe\nDawn\nRambo\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local person = {\n health = 100,\n speed = 20,\n isAwesome = true,\n name = "John"\n}\nprint("This person\'s health is "..person.health)\nprint("This person\'s health is "..person["health"])\nprint("This person\'s speed is "..person.speed)\nprint("This person is awesome. "..person.isAwesome)\nprint("This person\'s name is "..person.name)\nprint("This person\'s name is "..person["name"])\n\nperson.home = "USA"\nperson["money"] = 250\n\nprint("This person\'s home is "..person.home)\nprint("This person has "..person["money"].." dollars!")\n\n'})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"This person's health is 100\nThis person's health is 100\nThis person's speed is 20\nThis person is awesome. true\nThis person's name is John\nThis person's name is John\nThis person's home is USA\nThis person has 250 dollars!\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Tables are very good for storing lots of information. You can even put things inside of tables after the table is made! Done with table.insert(TableName, data) or you add things with table[n] = data. And remember, the table doesn't have to be defined on the same line! The brackets "," can be on separate lines to make it easier to read!"]}),"\n",(0,i.jsx)(n.h3,{id:"for-i-v-in-pairs-loop-example",children:"FOR I, V IN PAIRS LOOP EXAMPLE"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:"local numbers = {3, 4, 99, 202, -3}\n\nfor i, v in pairs(numbers) do\n print(i, v)\nend\n"})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"1 3\n2 4\n3 99\n4 202\n5 -3\n"})}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-lua",children:'local names = {"Jack", "Mike", "Melinda", "Stacy"}\n\nfor index, person in pairs(names) do\n print("Person "..index.." is "..person)\nend\n'})}),"\n",(0,i.jsx)(n.p,{children:"Output:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{children:"Person 1 is Jack\nPerson 2 is Mike\nPerson 3 is Melinda\nPerson 4 is Stacy\n"})}),"\n",(0,i.jsx)(n.p,{children:'For i, v in pairs loops are a useful kind of for loop! They basically go through a list and use the data stored in the table. The variable i is the index or position of the table where the data is stored. The variable v is the value of the data. Inside of pairs() is the table you want to use: pairs(TableName). The variables don\'t have to be named "i" and "v", they can be named whatever you want!'})]})}function h(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(c,{...e})}):c(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>o,x:()=>a});var i=s(6540);const r={},l=i.createContext(r);function o(e){const n=i.useContext(l);return i.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(l.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/693aa6a8.43876ded.js b/assets/js/693aa6a8.34bf2d89.js
similarity index 85%
rename from assets/js/693aa6a8.43876ded.js
rename to assets/js/693aa6a8.34bf2d89.js
index c908400..1dd523b 100644
--- a/assets/js/693aa6a8.43876ded.js
+++ b/assets/js/693aa6a8.34bf2d89.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkppl_docs=self.webpackChunkppl_docs||[]).push([[3194],{3305:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>s,default:()=>d,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var i=n(4848),o=n(8453);const r={sidebar_position:2},s="Level restrictions",l={id:"other/level-restrictions",title:"Level restrictions",description:"Entity count",source:"@site/docs/other/level-restrictions.md",sourceDirName:"other",slug:"/other/level-restrictions",permalink:"/ppl-docs/docs/other/level-restrictions",draft:!1,unlisted:!1,editUrl:"https://github.com/pewpewlive/ppl-docs/edit/master/docs/other/level-restrictions.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Design principles",permalink:"/ppl-docs/docs/other/level-design-principles"},next:{title:"Trivia",permalink:"/ppl-docs/docs/other/trivia"}},a={},c=[{value:"Entity count",id:"entity-count",level:3},{value:"Duration",id:"duration",level:3},{value:"Memory usage",id:"memory-usage",level:3}];function h(e){const t={a:"a",code:"code",h1:"h1",h3:"h3",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"level-restrictions",children:"Level restrictions"}),"\n",(0,i.jsx)(t.h3,{id:"entity-count",children:"Entity count"}),"\n",(0,i.jsx)(t.p,{children:"At most 1300 entities can exist at any given moment. This includes the player's bullet. If there are already 1300 entities, no more entities will be created. This means that the player won't be able to shoot."}),"\n",(0,i.jsx)(t.h3,{id:"duration",children:"Duration"}),"\n",(0,i.jsxs)(t.p,{children:["A game lasts at most 1 hour. If the level has not called ",(0,i.jsx)(t.a,{href:"https://github.com/jyaif/ppl-utils/wiki/API_pewpew_lib#void-stop_game",children:(0,i.jsx)(t.code,{children:"stop_game"})})," by then, it will be called automatically.\nThe reason for this limitation is that replays then become too large."]}),"\n",(0,i.jsx)(t.h3,{id:"memory-usage",children:"Memory usage"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"The Lua interpreter can't use more than 500KB of memory when running a level. Unless you have a memory leak in your level, this shouldn't be a problem."}),"\n",(0,i.jsx)(t.li,{children:"The Lua interpreter can't use more than 3MB of memory when loading a mesh. You will need to split a mesh into multiple files if you are hitting this limit."}),"\n",(0,i.jsx)(t.li,{children:"The Lua interpreter can't use more than 3MB of memory when loading sounds. Unless you are doing something really crazy, this will never be a problem."}),"\n"]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>l});var i=n(6540);const o={},r=i.createContext(o);function s(e){const t=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkppl_docs=self.webpackChunkppl_docs||[]).push([[3194],{3305:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>a,contentTitle:()=>s,default:()=>d,frontMatter:()=>r,metadata:()=>l,toc:()=>c});var i=n(4848),o=n(8453);const r={sidebar_position:2},s="Level restrictions",l={id:"other/level-restrictions",title:"Level restrictions",description:"Entity count",source:"@site/docs/other/level-restrictions.md",sourceDirName:"other",slug:"/other/level-restrictions",permalink:"/ppl-docs/docs/other/level-restrictions",draft:!1,unlisted:!1,editUrl:"https://github.com/pewpewlive/ppl-docs/edit/master/docs/other/level-restrictions.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2},sidebar:"tutorialSidebar",previous:{title:"Design principles",permalink:"/ppl-docs/docs/other/level-design-principles"},next:{title:"Trivia",permalink:"/ppl-docs/docs/other/trivia"}},a={},c=[{value:"Entity count",id:"entity-count",level:2},{value:"Duration",id:"duration",level:2},{value:"Memory usage",id:"memory-usage",level:2}];function h(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"level-restrictions",children:"Level restrictions"}),"\n",(0,i.jsx)(t.h2,{id:"entity-count",children:"Entity count"}),"\n",(0,i.jsx)(t.p,{children:"At most 1300 entities can exist at any given moment. This includes the player's bullet. If there are already 1300 entities, no more entities will be created. This means that the player won't be able to shoot."}),"\n",(0,i.jsx)(t.h2,{id:"duration",children:"Duration"}),"\n",(0,i.jsxs)(t.p,{children:["A game lasts at most 1 hour. If the level has not called ",(0,i.jsx)(t.a,{href:"https://github.com/jyaif/ppl-utils/wiki/API_pewpew_lib#void-stop_game",children:(0,i.jsx)(t.code,{children:"stop_game"})})," by then, it will be called automatically.\nThe reason for this limitation is that replays then become too large."]}),"\n",(0,i.jsx)(t.h2,{id:"memory-usage",children:"Memory usage"}),"\n",(0,i.jsxs)(t.ul,{children:["\n",(0,i.jsx)(t.li,{children:"The Lua interpreter can't use more than 500KB of memory when running a level. Unless you have a memory leak in your level, this shouldn't be a problem."}),"\n",(0,i.jsx)(t.li,{children:"The Lua interpreter can't use more than 3MB of memory when loading a mesh. You will need to split a mesh into multiple files if you are hitting this limit."}),"\n",(0,i.jsx)(t.li,{children:"The Lua interpreter can't use more than 3MB of memory when loading sounds. Unless you are doing something really crazy, this will never be a problem."}),"\n"]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>s,x:()=>l});var i=n(6540);const o={},r=i.createContext(o);function s(e){const t=i.useContext(r);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:s(e.components),i.createElement(r.Provider,{value:t},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/bde67976.326724d7.js b/assets/js/bde67976.c440d31c.js
similarity index 55%
rename from assets/js/bde67976.326724d7.js
rename to assets/js/bde67976.c440d31c.js
index 5293456..331551a 100644
--- a/assets/js/bde67976.326724d7.js
+++ b/assets/js/bde67976.c440d31c.js
@@ -1 +1 @@
-"use strict";(self.webpackChunkppl_docs=self.webpackChunkppl_docs||[]).push([[3619],{9950:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>d,frontMatter:()=>r,metadata:()=>l,toc:()=>a});var s=i(4848),t=i(8453);const r={sidebar_position:3},o="Sound files",l={id:"File Information/sound-files",title:"Sound files",description:"Example of a file that defines a single sound:",source:"@site/docs/File Information/sound-files.md",sourceDirName:"File Information",slug:"/File Information/sound-files",permalink:"/ppl-docs/docs/File Information/sound-files",draft:!1,unlisted:!1,editUrl:"https://github.com/pewpewlive/ppl-docs/edit/master/docs/File Information/sound-files.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Mesh files",permalink:"/ppl-docs/docs/File Information/mesh-files"},next:{title:"Beginner Lua Tutorial",permalink:"/ppl-docs/docs/Guides/Lua/beginner"}},c={},a=[];function u(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"sound-files",children:"Sound files"}),"\n",(0,s.jsx)(n.p,{children:"Example of a file that defines a single sound:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:'sounds = {\n {\n frequency = 500,\n sustain = 0.3,\n waveform = "triangle",\n }\n}\n'})}),"\n",(0,s.jsx)(n.p,{children:"The following fields can be used to describe a sound:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"attack (in seconds)"}),"\n",(0,s.jsx)(n.li,{children:"decay (in seconds)"}),"\n",(0,s.jsx)(n.li,{children:"sustain (in seconds)"}),"\n",(0,s.jsx)(n.li,{children:"sustainPunch (in seconds)"}),"\n",(0,s.jsx)(n.li,{children:"amplification"}),"\n",(0,s.jsx)(n.li,{children:"tremoloDepth"}),"\n",(0,s.jsx)(n.li,{children:"tremoloFrequency (in hertz)"}),"\n",(0,s.jsx)(n.li,{children:"frequency (in hertz)"}),"\n",(0,s.jsx)(n.li,{children:"frequencyDeltaSweep"}),"\n",(0,s.jsx)(n.li,{children:"frequencyJump1Onset"}),"\n",(0,s.jsx)(n.li,{children:"frequencyJump2Onset"}),"\n",(0,s.jsx)(n.li,{children:"frequencyJump1Amount"}),"\n",(0,s.jsx)(n.li,{children:"frequencyJump2Amount"}),"\n",(0,s.jsx)(n.li,{children:"frequencySweep"}),"\n",(0,s.jsx)(n.li,{children:"vibratoFrequency (in hertz)"}),"\n",(0,s.jsx)(n.li,{children:"vibratoDepth (in hertz)"}),"\n",(0,s.jsx)(n.li,{children:"flangerOffset"}),"\n",(0,s.jsx)(n.li,{children:"flangerOffsetSweep"}),"\n",(0,s.jsx)(n.li,{children:"repeatFrequency"}),"\n",(0,s.jsx)(n.li,{children:'waveform ("sine", "triangle", "sawtooth", "square", "tangent", "whistle", "breaker", "whitenoise", "pinknoise", "brownnoise")'}),"\n"]}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsxs)(n.p,{children:["Use ",(0,s.jsx)(n.a,{href:"https://pewpew.live/jfxr/index.html",children:"jfxr"})," for sound creation. A script then transforms the resulting jfxr link (for example ",(0,s.jsx)(n.a,{href:"https://pewpew.live/jfxr/index.html#%7B%22_version%22%3A1%2C%22_name%22%3A%22Pickup%2Fcoin%206%22%2C%22_locked%22%3A%5B%5D%2C%22sampleRate%22%3A44100%2C%22attack%22%3A0%2C%22sustain%22%3A0.1%2C%22sustainPunch%22%3A60%2C%22decay%22%3A0.14%2C%22tremoloDepth%22%3A0%2C%22tremoloFrequency%22%3A10%2C%22frequency%22%3A700%2C%22frequencySweep%22%3A0%2C%22frequencyDeltaSweep%22%3A0%2C%22repeatFrequency%22%3A0%2C%22frequencyJump1Onset%22%3A25%2C%22frequencyJump1Amount%22%3A75%2C%22frequencyJump2Onset%22%3A66%2C%22frequencyJump2Amount%22%3A0%2C%22harmonics%22%3A0%2C%22harmonicsFalloff%22%3A0.5%2C%22waveform%22%3A%22square%22%2C%22interpolateNoise%22%3Atrue%2C%22vibratoDepth%22%3A0%2C%22vibratoFrequency%22%3A10%2C%22squareDuty%22%3A90%2C%22squareDutySweep%22%3A0%2C%22flangerOffset%22%3A6%2C%22flangerOffsetSweep%22%3A0%2C%22bitCrush%22%3A16%2C%22bitCrushSweep%22%3A0%2C%22lowPassCutoff%22%3A22050%2C%22lowPassCutoffSweep%22%3A0%2C%22highPassCutoff%22%3A0%2C%22highPassCutoffSweep%22%3A0%2C%22compression%22%3A1%2C%22normalization%22%3Atrue%2C%22amplification%22%3A100%7D",children:"this link"}),") into a table consumable by PewPew Live. See this ",(0,s.jsx)(n.a,{href:"https://github.com/jyaif/ppl-utils/blob/cd0607d3448915319ce9abc1f6019287566f6bdd/content/levels/useful_helpers/helpers/boxes/cannon_pickup_sound.lua#L3",children:"example"}),"."]})})]})}function d(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>o,x:()=>l});var s=i(6540);const t={},r=s.createContext(t);function o(e){const n=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
+"use strict";(self.webpackChunkppl_docs=self.webpackChunkppl_docs||[]).push([[3619],{9950:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>o,default:()=>d,frontMatter:()=>r,metadata:()=>l,toc:()=>a});var s=i(4848),t=i(8453);const r={sidebar_position:3},o="Sound files",l={id:"File Information/sound-files",title:"Sound files",description:"Example of a file that defines a single sound:",source:"@site/docs/File Information/sound-files.md",sourceDirName:"File Information",slug:"/File Information/sound-files",permalink:"/ppl-docs/docs/File Information/sound-files",draft:!1,unlisted:!1,editUrl:"https://github.com/pewpewlive/ppl-docs/edit/master/docs/File Information/sound-files.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Mesh files",permalink:"/ppl-docs/docs/File Information/mesh-files"},next:{title:"Beginner Lua Tutorial",permalink:"/ppl-docs/docs/Guides/Lua/beginner"}},c={},a=[];function u(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"sound-files",children:"Sound files"}),"\n",(0,s.jsx)(n.p,{children:"Example of a file that defines a single sound:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:'sounds = {\n {\n frequency = 500,\n sustain = 0.3,\n waveform = "triangle",\n }\n}\n'})}),"\n",(0,s.jsx)(n.p,{children:"The following fields can be used to describe a sound:"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:"attack (in seconds)"}),"\n",(0,s.jsx)(n.li,{children:"decay (in seconds)"}),"\n",(0,s.jsx)(n.li,{children:"sustain (in seconds)"}),"\n",(0,s.jsx)(n.li,{children:"sustainPunch (in seconds)"}),"\n",(0,s.jsx)(n.li,{children:"amplification"}),"\n",(0,s.jsx)(n.li,{children:"tremoloDepth"}),"\n",(0,s.jsx)(n.li,{children:"tremoloFrequency (in hertz)"}),"\n",(0,s.jsx)(n.li,{children:"frequency (in hertz)"}),"\n",(0,s.jsx)(n.li,{children:"frequencyDeltaSweep"}),"\n",(0,s.jsx)(n.li,{children:"frequencyJump1Onset"}),"\n",(0,s.jsx)(n.li,{children:"frequencyJump2Onset"}),"\n",(0,s.jsx)(n.li,{children:"frequencyJump1Amount"}),"\n",(0,s.jsx)(n.li,{children:"frequencyJump2Amount"}),"\n",(0,s.jsx)(n.li,{children:"frequencySweep"}),"\n",(0,s.jsx)(n.li,{children:"vibratoFrequency (in hertz)"}),"\n",(0,s.jsx)(n.li,{children:"vibratoDepth (in hertz)"}),"\n",(0,s.jsx)(n.li,{children:"flangerOffset"}),"\n",(0,s.jsx)(n.li,{children:"flangerOffsetSweep"}),"\n",(0,s.jsx)(n.li,{children:"repeatFrequency"}),"\n",(0,s.jsx)(n.li,{children:'waveform ("sine", "triangle", "sawtooth", "square", "tangent", "whistle", "breaker", "whitenoise", "pinknoise", "brownnoise")'}),"\n"]}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsxs)(n.p,{children:["Use ",(0,s.jsx)(n.a,{href:"https://pewpew.live/jfxr/index.html",children:"jfxr"})," for sound creation. A script then transforms the resulting jfxr link (for example ",(0,s.jsx)(n.a,{href:"https://pewpew.live/jfxr/index.html#%7B%22_version%22%3A1%2C%22_name%22%3A%22Pickup%2Fcoin%206%22%2C%22_locked%22%3A%5B%5D%2C%22sampleRate%22%3A44100%2C%22attack%22%3A0%2C%22sustain%22%3A0.1%2C%22sustainPunch%22%3A60%2C%22decay%22%3A0.14%2C%22tremoloDepth%22%3A0%2C%22tremoloFrequency%22%3A10%2C%22frequency%22%3A700%2C%22frequencySweep%22%3A0%2C%22frequencyDeltaSweep%22%3A0%2C%22repeatFrequency%22%3A0%2C%22frequencyJump1Onset%22%3A25%2C%22frequencyJump1Amount%22%3A75%2C%22frequencyJump2Onset%22%3A66%2C%22frequencyJump2Amount%22%3A0%2C%22harmonics%22%3A0%2C%22harmonicsFalloff%22%3A0.5%2C%22waveform%22%3A%22square%22%2C%22interpolateNoise%22%3Atrue%2C%22vibratoDepth%22%3A0%2C%22vibratoFrequency%22%3A10%2C%22squareDuty%22%3A90%2C%22squareDutySweep%22%3A0%2C%22flangerOffset%22%3A6%2C%22flangerOffsetSweep%22%3A0%2C%22bitCrush%22%3A16%2C%22bitCrushSweep%22%3A0%2C%22lowPassCutoff%22%3A22050%2C%22lowPassCutoffSweep%22%3A0%2C%22highPassCutoff%22%3A0%2C%22highPassCutoffSweep%22%3A0%2C%22compression%22%3A1%2C%22normalization%22%3Atrue%2C%22amplification%22%3A100%7D",children:"this link"}),") into a table consumable by PewPew Live."]}),(0,s.jsxs)(n.p,{children:["See this ",(0,s.jsx)(n.a,{href:"https://github.com/jyaif/ppl-utils/blob/cd0607d3448915319ce9abc1f6019287566f6bdd/content/levels/useful_helpers/helpers/boxes/cannon_pickup_sound.lua#L3",children:"example"}),"."]})]})]})}function d(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(u,{...e})}):u(e)}},8453:(e,n,i)=>{i.d(n,{R:()=>o,x:()=>l});var s=i(6540);const t={},r=s.createContext(t);function o(e){const n=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(r.Provider,{value:n},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/c9cd16d1.ccdfc422.js b/assets/js/c9cd16d1.ccdfc422.js
deleted file mode 100644
index 872ba76..0000000
--- a/assets/js/c9cd16d1.ccdfc422.js
+++ /dev/null
@@ -1 +0,0 @@
-"use strict";(self.webpackChunkppl_docs=self.webpackChunkppl_docs||[]).push([[1414],{637:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>a,metadata:()=>r,toc:()=>c});var o=n(4848),s=n(8453);const a={sidebar_position:3},i="Advanced",r={id:"Guides/Lua/advanced",title:"Advanced",description:"In this tutorial, we will learn how to make more advanced levels, including meshes, custom enemies, and other cool gameplay features!",source:"@site/docs/Guides/Lua/advanced.md",sourceDirName:"Guides/Lua",slug:"/Guides/Lua/advanced",permalink:"/ppl-docs/docs/Guides/Lua/advanced",draft:!1,unlisted:!1,editUrl:"https://github.com/pewpewlive/ppl-docs/edit/master/docs/Guides/Lua/advanced.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Intermediate",permalink:"/ppl-docs/docs/Guides/Lua/intermediate"},next:{title:"60 FPS Animation",permalink:"/ppl-docs/docs/Guides/Other/fps-animation"}},d={},c=[{value:"Note",id:"note",level:3}];function l(e){const t={h1:"h1",h3:"h3",hr:"hr",p:"p",...(0,s.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h1,{id:"advanced",children:"Advanced"}),"\n",(0,o.jsx)(t.p,{children:"In this tutorial, we will learn how to make more advanced levels, including meshes, custom enemies, and other cool gameplay features!"}),"\n",(0,o.jsx)(t.p,{children:"So, let's get straight into it."}),"\n",(0,o.jsx)(t.hr,{}),"\n",(0,o.jsx)(t.h3,{id:"note",children:"Note"}),"\n",(0,o.jsx)(t.p,{children:"Before we start, it is necessary to know at least some basic Lua and how to make a simple PewPew Live level. If you need a refresher, take a look at the Beginner and Intermediate tutorials."}),"\n",(0,o.jsx)(t.p,{children:"Once you're done, you can come back to this tutorial."}),"\n",(0,o.jsx)(t.hr,{}),"\n",(0,o.jsx)(t.p,{children:"Tutorial in the making."})]})}function u(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>r});var o=n(6540);const s={},a=o.createContext(s);function i(e){const t=o.useContext(a);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:i(e.components),o.createElement(a.Provider,{value:t},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/c9cd16d1.ce61f061.js b/assets/js/c9cd16d1.ce61f061.js
new file mode 100644
index 0000000..1cb39d3
--- /dev/null
+++ b/assets/js/c9cd16d1.ce61f061.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkppl_docs=self.webpackChunkppl_docs||[]).push([[1414],{637:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>u,frontMatter:()=>s,metadata:()=>r,toc:()=>c});var o=n(4848),a=n(8453);const s={sidebar_position:3},i="Advanced",r={id:"Guides/Lua/advanced",title:"Advanced",description:"In this tutorial, we will learn how to make more advanced levels, including meshes, custom enemies, and other cool gameplay features!",source:"@site/docs/Guides/Lua/advanced.md",sourceDirName:"Guides/Lua",slug:"/Guides/Lua/advanced",permalink:"/ppl-docs/docs/Guides/Lua/advanced",draft:!1,unlisted:!1,editUrl:"https://github.com/pewpewlive/ppl-docs/edit/master/docs/Guides/Lua/advanced.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"Intermediate",permalink:"/ppl-docs/docs/Guides/Lua/intermediate"},next:{title:"60 FPS Animation",permalink:"/ppl-docs/docs/Guides/Other/fps-animation"}},d={},c=[{value:"Note",id:"note",level:2}];function l(e){const t={h1:"h1",h2:"h2",hr:"hr",p:"p",...(0,a.R)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.h1,{id:"advanced",children:"Advanced"}),"\n",(0,o.jsx)(t.p,{children:"In this tutorial, we will learn how to make more advanced levels, including meshes, custom enemies, and other cool gameplay features!"}),"\n",(0,o.jsx)(t.p,{children:"So, let's get straight into it."}),"\n",(0,o.jsx)(t.h2,{id:"note",children:"Note"}),"\n",(0,o.jsx)(t.p,{children:"Before we start, it is necessary to know at least some basic Lua and how to make a simple PewPew Live level. If you need a refresher, take a look at the Beginner and Intermediate tutorials."}),"\n",(0,o.jsx)(t.p,{children:"Once you're done, you can come back to this tutorial."}),"\n",(0,o.jsx)(t.hr,{}),"\n",(0,o.jsx)(t.p,{children:"Tutorial in the making."})]})}function u(e={}){const{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(l,{...e})}):l(e)}},8453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>r});var o=n(6540);const a={},s=o.createContext(a);function i(e){const t=o.useContext(s);return o.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),o.createElement(s.Provider,{value:t},e.children)}}}]);
\ No newline at end of file
diff --git a/assets/js/runtime~main.aade9a94.js b/assets/js/runtime~main.7731f4e9.js
similarity index 64%
rename from assets/js/runtime~main.aade9a94.js
rename to assets/js/runtime~main.7731f4e9.js
index 11f308d..7bd614d 100644
--- a/assets/js/runtime~main.aade9a94.js
+++ b/assets/js/runtime~main.7731f4e9.js
@@ -1 +1 @@
-(()=>{"use strict";var e,a,r,t,c,f={},o={};function d(e){var a=o[e];if(void 0!==a)return a.exports;var r=o[e]={exports:{}};return f[e].call(r.exports,r,r.exports,d),r.exports}d.m=f,e=[],d.O=(a,r,t,c)=>{if(!r){var f=1/0;for(n=0;n