You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Guides/Lua/intermediate.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Before we begin in our first steps to making a level, it is crucial to understan
24
24
25
25
**Let's take a look...**
26
26
27
-

27
+

28
28
29
29
These are some of the functions that you will be using in PewPew Live! I suggest giving it a lookover, and try to see what it all means! Whenever you use a function in PewPew's library (API), you MUST put `pewpew.` infront of it!
30
30
@@ -34,7 +34,7 @@ So you see, `print(String str)` would be typed in your code as `pewpew.print(Str
34
34
35
35
**Another main part of the API is the Fmath library!**
36
36
37
-

37
+

38
38
39
39
These are more functions in PewPew Live, but slightly different. To use these functions, you MUST put `fmath.` infront of it!
40
40
@@ -50,7 +50,7 @@ Another main difference I should note is their decimals! It's a little strange,
50
50
51
51
**The last main part that I need to cover is the Enums section of the API**
52
52
53
-

53
+

54
54
55
55
So what is an `Enum`? `Enum` stands for _Enumerator_, and is just a fancy way of talking about a list of items and properties. So here is the list of enemies and the properties of enemies, AKA the `Enums`, that a person can access and use. Again, you need to put `pewpew.` infront of these when you use them. A quick example of a reference to a specific enemy would be `pewpew.MothershipType.THREE_CORNERS`. This piece of code references the pink triangles (motherships) that you see in Eskiv.
56
56
@@ -62,19 +62,19 @@ So what is an `Enum`? `Enum` stands for _Enumerator_, and is just a fancy way of
62
62
63
63
You will need to extract the file, and then you will enter it. You will see two files, a folder and an `.exe` file. That `.exe` is very important to running your level, keep it in mind!
64
64
65
-

65
+

66
66
67
67
**You will then see a bunch of files, and a folder. You do NOT need to worry about these files at all! Just the folder! The `levels` folder is where all custom levels are stored! So that is the folder you enter into next!**
68
68
69
-

69
+

70
70
71
71
**As you can see below, there are some levels already here! The developer, JF, put these levels here as examples for level creators to look at while they work! This is where you will create your level.**
72
72
73
-

73
+

74
74
75
75
**So all you need to do is make a new folder. I'm going to call my folder TUTORIAL_LEVEL, although you can call your folder whatever you like.**
76
76
77
-

77
+

78
78
79
79
And there you go! You now have the location of your custom level, and all the levels are nice and organized! Time for the fun stuff!
80
80
@@ -84,11 +84,11 @@ And there you go! You now have the location of your custom level, and all the le
84
84
85
85
You can either open up just your level file in your text editor, or you can open the folder that contains all the levels. This is helpful for looking at other levels while you code! So head back to this screen below:
86
86
87
-

87
+

88
88
89
89
And open the levels folder with your text editor! If you need help with this, feel free to reach out for help! If you're ready, then proceed down below!
90
90
91
-

91
+

92
92
93
93
As pointed out by the very helpful green arrow, my level is on the left. The folder was initially empty. You need create a new script that will be your main level script. It HAS to be called `level.lua`. This is how PewPew Live enters into your level and runs it. It might change in the future, but it is good practice to keep consistency. And with the script made, you have an empty canvas. What's next?
94
94
@@ -127,7 +127,7 @@ This piece of code sets the ship as a variable that you can reference later on!
127
127
128
128
**And there you have it! Down below is the final product.**
129
129
130
-

130
+

131
131
132
132
**Now there's one more step before we can test out our level! We need something called a `manifest`**
133
133
@@ -145,23 +145,23 @@ In the manifest you need to put this piece of code:
145
145
146
146
You can look at it and kind of get a sense of what's going on, but I will brief you on it. You put your level name where `"LEVEL_NAME"` is **INSIDE** the quotation `""` marks! You can do the same with the level description, inside the quotation marks and brackets `[""]`! See the `"entry_point"`? That's why we named the main script `level.lua`. The game enters through that script and runs your level. And that is _all_ you need to know about this new file. Down below is the manifest for my tutorial level.
147
147
148
-

148
+

149
149
150
150
You are done! You can run your level!
151
151
152
152
**Ready to take it out for a spin? Good! Remember that `.exe` I mentioned some time back? Yeah, we need that. Head back to the screen below.**
153
153
154
-

154
+

155
155
156
156
You need to run the ppl-utils file. It will open a window, and your computer will warn you about this file. Go ahead and run the file anyway, and you will be able to try out your level! You should get something like below:
157
157
158
-

158
+

159
159
160
160
**Your levels are being run! Now you need to go to the website that the screen above is telling you!** The website to run your levels is [http://localhost:9000/pewpew.html](http://localhost:9000/pewpew.html)
161
161
162
162
You should get a screen like this:
163
163
164
-

164
+

165
165
166
166
**As you can see, the manifest dictated what name my level would show as.**
0 commit comments