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

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)!

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...

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

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.

@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!

I mentioned some time ago that I'd upgraded the shading on the beetle enemy's character art. Finally got around to putting together a before-after shot of that upgrade! This time, I made gifs for both!

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

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!

Here's a before and after GIF of the re-shaded wasp enemy!