Once again I'm back with an update. This article/dev diary is going to cover collectable items such as ammo or the items themselves, weapons in the game, as well as some small adjustments I've made to the game.
Collectables
Making items collectable was a bit of a trial, at first I tried a simple hit test on the player's display class, but very quickly realized the problem with this. Instead I decided to go with the collision being on the item classes themselves, that way there's no more crowding of the player's code. Eventually I got it working after an hour or two, and was satisfied with how it worked. Next I simply applied the code to work with other items. A lot of it is simply reused code, because they all work the same. Basically certain ammo types and rations check to see if you have the item or not, and when you pick them up, it changes that value to true. For ammo types where you require the specific weapon, you can still pick up ammo, but you need the actual weapon to use it.
Weapons
In addition to the majority of weapons from the original MG2, I'm going to be including some new weapons as well. One of these is the Shotgun, which looks almost like a shotgun pistol, but is supposed to be a sawed-off shotgun. It will fire 5 fast projectiles at a time, but you must wait longer to fire again.
I have some ideas for other weapons as well, but I don't want to jump the gun (hah) and say that something will be in the game that doesn't ever end up being added in. The shotgun however will for sure be in the game though.
As for shooting, this was probably the most frustrating process to get working, and when I finally did it correctly, I accidentally had a semicolon where there was supposed to be a colon, and I stared at the code for probably 30 minutes trying to figure out what the hell I did (lol). I had tried multiple online tutorials on how to do it, but all the tutorials implemented bullets in a way that I thought was more complicated than necessary. I ended up just making my own variation of firing bullets, and adopted it for the handgun and SMG so far.
Small Adjustments
A list of some small adjustments I made since the last major update:
The text underneath equipped weapons or rations is now more akin to the "digital display" looking font of MG2 rather than the generic MSX font.
Silencer item moved from the equipment select screen to the "OPTION" slot in the weapon select screen.
Added hand glider item
All equipment items can now be picked up, not just the rations (It was a lot faster coding this the second, third, fourth, etc. Time than the first)
Fixed some sound stacking issues
Generally cleaned up code in a few places
Snake now has different standing and moving animations when holding a gun
0 comments