Search Unity

Coding Bullet-Hell Patterns

Discussion in 'Scripting' started by VFranklin, Dec 4, 2019.

  1. VFranklin

    VFranklin

    Joined:
    Jul 26, 2017
    Posts:
    48
    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...)
     

    Attached Files:

  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,744
    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.
     
    lordofduct likes this.
  3. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    VFranklin and Kurt-Dekker like this.
  4. HardDev2771

    HardDev2771

    Joined:
    Mar 1, 2023
    Posts:
    2