Game Dev Update #5

Hello World,

Since my last update, I’ve added more features to my first JavaScript game project and started working on custom menus in my RPG Maker MV project.

Supergirl VS Fireballs

I gave the JavaScript game a super-creative name (pun wasn’t intended, but I’m leaving it here) and added some features. First, with some help from the W3school tutorials, I added a border at the bottom of the screen. Then I tweaked the same code to add borders to the sides and the top as well.

After looking through the other tutorial material, I decided not to implement most of it (bouncing, gravity, and some other things didn’t really seem useful in this particular game).

So instead of using the tutorials, I started making some features on my own.

The first feature I added was to make it so Supergirl would intermittently enter a “charged” state where she would glow. While charged, if she touched a fireball all the fireballs on the screen would disappear and she would lose the charge.

This feature made her a lot more like Captain Marvel than Supergirl, but I was just experimenting with coding so I didn’t care so much. Of course, in my mind, I justified it this way: Supergirl getting “charged” meant she was absorbing more yellow sunlight which builds up her psionic forcefield (or however Kryptonian powers work) and allows her to take a hit from the fireballs (and also miraculously cause the other fireballs to vanish). The glow is just to help the player visually see the charged state. I also made the text “charged!!!” appear underneath the score so the player had a second visual cue.

So, giving Supergirl the charged feature made the game a lot easier. So, of course, I had to tweak the difficulty in the other direction. I changed my code so that, over time (technically, as your score went up), the fireballs would spawn in higher quantities and also start to move faster.

I also re-did the Supergirl image so her leg isn’t chopped off and got rid of the contrasting bright edges.

After all of that, the game turned out to be mildly fun. As a gamer, I probably wouldn’t pay for it, though. 😮

RPG Maker MV Custom Menu

Yesterday, I finally got back to what was supposed to be the primary purpose of learning JavaScript: customizing menus in RPG Maker MV.

My goal was to replace the default menu altogether. So that when you hit “escape” you would ignore the standard RPG menu (which includes commands to access your items, skills, magic, party formation, and all that good stuff) because my game wouldn’t be utilizing magic or other default RMMV features.

In the afternoon, I tried to look through RMMV’s javascript files to figure out how things worked and went to Google and YouTube to look for potentially useful tutorials. After a few hours, all I managed to do was replicate Porgy the RPG Maker’s code in one of his video tutorials: I made a window with some images/text appear in the top left corner. Then, I tweaked some of his code (which opened a custom menu with the press of the “p” button) so that the “escape” button(s) in the game would open the custom menu instead of the default menu.

That was one small thing done, but I couldn’t get the other types of menus/windows to work (e.g., windows which you could actually interact with instead of simply a window that displayed info). Unfortunately, Porgy’s tutorial didn’t really explain the basics of what he was doing (if you copied him, you could get things done, but it didn’t give enough fundamentals of what he was doing or why–not enough for me, anyway).

Unable to figure things out, I took an Animal Crossing break before getting back to work in the afternoon. I started googling other people’s attempts at creating their own windows/menus. Didn’t get much help there, either. Most searches for “custom menus” in RMMV was more about moving the pre-existing windows around (i.e., the command, status, and gold windows), or there were plugins already created by other people. There was very little information or tutorials that helped with coding your own custom menus.

After a while, with the RMMV JS files on one screen and Poryg’s code on another, I started to figure things out. Poryg was squeezing onto one .js file what the RMMV files had separated on multiple files (the rpg_scenes.js and rpg_windows.js).

Rather than copy Poryg’s code as a base, I started more or less to cobble together code with the RMMV JS defaults as a base. I also named the menus in a way that felt more natural to me.

Finally, I succeeded in making a simple command menu where the player couldchoose to “Exit Game” or “Cancel” and continue playing. It took another good chunk of time to get the window to be centered (by referencing how the RMMV programmers centered their other windows).

On the next day (aka today), I spent about half the day to add a second window which displays the in-game time and currency. The currency was easy enough; I used the code for the gold window as a base. Getting the clock to work required a little more work, but it wasn’t as hard as getting the command menu to work on the previous day.

The code for the clock uses a variable (set using RMMV) as a parameter and translates that value into a 12-hour clock display. The trickiest part was to get the clock to show 12:XX AM instead of 0:XX AM, but I got it done eventually. Coding for the clock a relatively relaxing task since it was almost entirely from scratch (instead of having to rely on the infrastructure already laid out in RMMV).

Took two days of learning and coding (with lots of breaks) to get those simple custom windows to work.