# Coding Bullet-Hell Patterns

**URL:** https://discussions.unity.com/t/coding-bullet-hell-patterns/767868
**Category:** Scripting
**Tags:** Scripting
**Created:** [December 4, 2019, 12:05am UTC](https://discussions.unity.com/t/coding-bullet-hell-patterns/767868 "2019-12-04T00:05:41Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![VFranklin](https://avatars.discourse-cdn.com/v4/letter/v/d78d45/32.png) [@VFranklin](https://discussions.unity.com/u/VFranklin)
#### Post date: [December 4, 2019, 12:05am UTC](https://discussions.unity.com/t/coding-bullet-hell-patterns/767868/1 "2019-12-04T00:05:41Z")

</div>

Hi!

I’ve seen this topic once or twice on Unity, but I’m a little confused as to how to create bullet patterns for a bullet-hell game.

Conceptually speaking, I don’t understand how to start instantiating the bullets. If the pattern is a circle, then are all the bullets instantiated from the enemy, or do they come from spawn points (which then isn’t the enemy really?)

If I want to do a circle patterns of bullets fired forward rather than a circle around an object, how would I do something like that? (Like Enter the Gungeon :))

In all, how do I create bullet patterns to be fired by a villain? Any help would be greatly appreciated.  
(I don’t want to use a Unity Asset for this but do it by hand! But I do think the Danmaku Pattern to be interesting…)

![5243144--523517--ETG_Clover Pattern.png](https://europe1.discourse-cdn.com/unity/original/4X/4/0/2/402373badf4f2ea1203209dd628fd1d0d7c92026.png)

 ![5243144--523520--ETG_Pattern1.jpg](https://europe1.discourse-cdn.com/unity/original/4X/d/a/9/da9dbabda2f78b3c59fb2e6a417dbc9891e4f774.jpeg)

---

<div class="post-metadata">

### Author: ![Kurt-Dekker](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/kurt-dekker/32/101578_2.png) [@Kurt-Dekker](https://discussions.unity.com/u/Kurt-Dekker)
#### Post date: [December 4, 2019, 12:16am UTC](https://discussions.unity.com/t/coding-bullet-hell-patterns/767868/2 "2019-12-04T00:16:20Z")

</div>

You could probably make a pretty flexible system with a combination of prefabs that you can visually edit, and code to fire them at regular intervals.

For instance, you’d make a prefab that has a bunch of children offset from it, and those offsets would encode the direction of the bullets.You can put markers on the GameObject it the editor, such as the color bubbles at the top left of the main inspector window, so you can visualize them in-scene.

Then you’d have code that fires them appropriately, using those templates.

---

<div class="post-metadata">

### Author: ![palex-nx](https://avatars.discourse-cdn.com/v4/letter/p/ec9cab/32.png) [@palex-nx](https://discussions.unity.com/u/palex-nx)
#### Post date: [December 4, 2019, 12:11pm UTC](https://discussions.unity.com/t/coding-bullet-hell-patterns/767868/3 "2019-12-04T12:11:02Z")

</div>

Take math formula for pattern you want and calculate it with discrete steps. Place particles at resulting positions and give them speed and directions, and that’s it. Here’s is some good example, it should be easy to replace game object with particles for performance

> **[Mathematical Surfaces](https://catlikecoding.com/unity/tutorials/basics/mathematical-surfaces/)**
>
> A Unity C# Basics tutorial about describing surfaces with math and visualizing them with cubes.

---

<div class="post-metadata">

### Author: ![HardDev2771](https://avatars.discourse-cdn.com/v4/letter/h/ce73a5/32.png) [@HardDev2771](https://discussions.unity.com/u/HardDev2771)
#### Post date: [March 10, 2024, 11:01am UTC](https://discussions.unity.com/t/coding-bullet-hell-patterns/767868/4 "2024-03-10T11:01:20Z")

</div>

thx
