2D Bullet Hell Game - Bullet Patterns

Hello Im creating a 2d bullet hell game from the top down view in unity and Im having a bit of a problem I dont know how to make certain patterns.
Heres a video of something similar that Im trying to recreate
http://youtu.be/jeU9ff6KAXQ

@2:20 thats the type of bullet movement that I want to recreate I know how to do all the other types except that one so if anyone could help me write a script for that type of movement It would be vary much appreciated!
Im using JavaScript also

Ive also come across this page I think this is what Im looking for but I dont know how to apply it
Firing a curtain of bullets
Thanks in advance!

People probably won’t write a whole script for you, but your question can be relatively easily answered insofar as the necessary math is concerned. :slight_smile:

Take a look at the video clip you posted again and this time, pay attention to just one single bullet. Do you see how it’s not actually changing direction? Every bullet just follows a straight line after getting fired. It’s the 7 emitters (cannons or whatever) that rotate a little bit back and forth around a common point in the center of the enemy, and since they’re constantly emitting bullets while rotating, the bullets appear to follow that “flower”-pattern you see.

Position the emitters in a circular pattern around the enemy’s center and find a way to mimic the rotation, and your bullets will behave the same.

Something like this might work?

It’s only setup to modify, oscillate, on x. Easy to apply to the other channels.

using UnityEngine;
using System.Collections;

public class ObjectOscillator : MonoBehaviour {
	
	public float speedMult = 1.0f;
	public float rangeMult = 1.0f;
	// Use this for initialization
	public GameObject bullet;
	public float shootInterval = 1.0f;
	float basex = 0.0f;
	float shootTimeAc = 0.0f;
	// Update is called once per frame
	void Start() {
		basex = transform.position.x;
	}
	void Update () {
		Vector3 position = transform.position;
		float interval = Mathf.Sin(Time.time * (speedMult / rangeMult)) * rangeMult;
		bool shoot = false;
		if(Time.deltaTime + shootTimeAc > shootInterval)
		{
			shootTimeAc = 0.0f;
			shoot = true;
		}
			
		else
			shootTimeAc += Time.deltaTime;
		
		position.x = basex + interval;
		
		transform.position = position;
		if(shoot)
			Instantiate(bullet, transform.position, bullet.transform.rotation);
	}
}