Bullet hell /guitar hero type battle system

Hey all! I've been creating a game for a couple of days now just kind of brainstorming fun ways to implement a battle system. I've settled on a guitar hero type screen where the bullets rain down on the player in a specific sequence. The goal is to dodge the sprites as they get to the player and eventually exhaust the npcs. I have already made the Battle room and a way for the player to be teleported to it.
My first attempt I wasn't sure how to write the pattern for the bullets to move down the screen in a straight line in the code. (About 9 tiles travel distance) so I created enough sprites for each lane. Animated and moved placement of the sprites so the transition is looks tight.
I guess my question is is there a better way to trigger my animations for each lane in the code without interacting with the sprites? Or should I keep going the way I am with dozens of sprite frames specifically placed in a order get the pattern effect I want. Oh I should mention I'd like to do this on a timer . Starting once the menu is closed.

This is the Battle room with the bullets raining down at the same pace.

Thanks for any feedback. I've loved using pulp so far. It been a dream come true!

1 Like

I implemented a similar approach for an endless runner style game. Not the prettiest code, but seemed to be the only solution. Will be watching this thread for any other recommendations.
with buttfly movement

So I did the math. If I shrink down to 10 playable lanes and about a minute of fight time at 4fps. I'm looking at about 21600 individual animation frames if I let it play through the animation. Might be a little in over my head with that route if my math is correct.

You might have to implement a few random elements. Randomize the bullet spawn location/time, then have the bullets control their own progress by iterating frames/swapping locations as they move toward the player. I did this for enemies in my endless runner above. It's a bit convoluted, but works.

In the room script, I have a spawn threshold variable that is set to a random number between two fixed values. The fixed min/max control how frequently enemy sprites spawn:
fingerSpawnThreshold = random 120,170

I then have a counter that increments with each iteration of the main game loop. When the counter trips the threshold, I spawn a new enemy at a random location, then reset the threshold to a new value and start the counter back at 0.

	// calculate Y values for down and up fingers
	fingerSpawnDownY = random fingerSpawnMin,fingerSpawnMax
	fingerSpawnUpY = fingerSpawnDownY
	fingerSpawnUpY += fingerSpawnDelta
	// use swap to insert new finger 'items'
	tell 24,fingerSpawnDownY to
		swap "FingerDown"
		frame 0
	call "drawDownArms"
	tell 24,fingerSpawnUpY to
		swap "FingerUp"
		frame 0
	call "drawUpArms"
	// recalculate spawn threshold
	fingerSpawnThreshold = random 120,170

In your particular case, you could either track independent thresholds for each bullet column, or select a random x location for each spawned bullet. Going the latter route would significantly decrease the amount of code you'd have to write.

To recap, the simplest route I'd suggest would be:

  • implement a spawnBullet event in the game room
  • have the main game loop event increment a variable and check for tripping your random spawn bullet threshold
  • if the threshold is tripped, spawn a bullet at a random x value in your play area, then reset your spawn threshold and counter variables
  • place code in the bullet tile's script that is called as part of the game loop to move the bullet toward the player and then either trigger a death event on the player if the bullet makes contact with the player tile or swap the bullet tile for your background tile when the bullet reaches the end of the play area

Thank you for your advice. I'm currently on holiday but will try this when I get a chance!