Game
Hensen Hopper
1 year ago

Okay so I've now gotten a much better spawning script put together! To fix the bullet firing effects, I've written an accessor that returns true if something has spawned since the last accessor call, it's a cheap solution, but it works, at least for now!


image.png

Above is the script I've replaced the old PrefabSpawner script with, if anyone's curious. It's a pretty simple script containing two methods:

  1. Spawn(GameObject gameObject) does exactly what it's name implies, instantiates (spawns) a copy of whichever game object is passed into the gameObject argument (everywhere I've used it uses prefab objects in my project directory but it's theoretically possible to use existing objects in the scene I now realize!) at the position and rotation of the spawner. If you read the method in the screenshot, you'll probably see it also sets the private boolean member spawnFlag, which is used for the second method, to true.

  2. GetHasSpawned effectively returns true if the spawner has spawned a game object since the last call to GetHasSpawned. How it does so is fairly self-explanatory if you read the method above. This exists solely to be read by the script handling the bullet firing animations and SFX which triggers both of those when the bullet spawners attached to the player and enemies spawn bullets by checking GetHasSpawned's return value once per frame update.

The original PrefabSpawner script I had would spawn a predefined prefab when triggered to, and this worked just fine for the bullets (which use the same spawning script as the enemy columns) however, it became counterproductive when I began trying to implement the upcoming beetle enemy. The versatility of this new spawner will make implementing new enemies and furthermore new ammo types (which is something I have planned for the future as well O.O) a lot easier and more intuitive.



0 comments

Loading...

Next up

Very basic/simple at the moment but I'm starting to update the main menu backdrop! Gonna work on this a lot more tomorrow probably.

It's officially done! The artwork for the soldier (aka wasp) enemy has been re-shaded! This one was a lot more difficult than the other enemies because it turns out I'd flattened the image before exporting it... for some reason...

You ever find a bug so silly and ultimately unproblematic that you just decide to leave it in? I just discovered if Hensen gets webbed mid-fire, the animation will be stuck with the honey glob halfway out of the gun haha.

Happy #WIPWednesday! Are you working on a game? Making some art? Practicing a song? Something else? Tell us in the comments!

I tried to make it a bit more obvious when you've taken damage. I did a red-flash effect over Hensen's character and the time scale on everything apart from Hensen's animations freezes for a moment when taking damage.

@JotaDev is a Jolter to Watch and the most crazy gamedev in all arround the world! Follow @JotaDev before the quest ends on May 26 and you'll get Coins!

Here's a version with just the background bushes visible!

I DID, in fact, get around to re-shading the art for the spider enemy by the way! The character sprites in Hensen feel a lot crisper as a whole now!

Strange lights over a farm. Animals going crazy. Something moving in the corn field... You’re a journalist. You came for a story. You’re not leaving with one. Check out the latest trailer for They Are Here: Alien Abduction Horror!

IT'S WORKING! As far as I can tell, the player's score, high score, and difficulty are now all saved to and loaded from a Json file on the application's persistent data directory (which is in the user's program files directory on their computer)!