
This one will NOT be Android exclusive. If anyone wants me to post a final link when it's done, let me know. If nobody asks, it'll still be posted on my davididev account.
Also.
You all remember those useless y = m(x) functions you learned in high school? I used some of them for Nyan Cat Annihilator, but they're more visible in this game. :3
So these stars are currency. They serve two purposes: to upgrade your lasers temporarily, and to make you slip up and get shot (muah ha ha I'm an evil game designer).
I'm more interested in talking about the code though. :3
It works very much like the actual function, where you iterate through an "x" and set the "y" equal to- y'know what, forget it. Here's the code for this particular shape:
IEnumerator Stars()
{
yield return new WaitForSeconds(1f);
while(gameObject.activeInHierarchy)
{
int starType = Random.Range(1, 5);
if(starType == 1)
{
for(float x = 0; x < 360f; x += 15f)
{
Vector3 startup = new Vector3(10f, 0f, 0f);
startup.y += Mathf.Cos(x * Mathf.Deg2Rad) * 3f;
GameObjectPool.instance.GetAnInstance("star", startup);
yield return new WaitForSeconds(0.1f);
}
}
...and the rest is irrelevant.
Also.
You all remember those useless y = m(x) functions you learned in high school? I used some of them for Nyan Cat Annihilator, but they're more visible in this game. :3
So these stars are currency. They serve two purposes: to upgrade your lasers temporarily, and to make you slip up and get shot (muah ha ha I'm an evil game designer).
I'm more interested in talking about the code though. :3
It works very much like the actual function, where you iterate through an "x" and set the "y" equal to- y'know what, forget it. Here's the code for this particular shape:
IEnumerator Stars()
{
yield return new WaitForSeconds(1f);
while(gameObject.activeInHierarchy)
{
int starType = Random.Range(1, 5);
if(starType == 1)
{
for(float x = 0; x < 360f; x += 15f)
{
Vector3 startup = new Vector3(10f, 0f, 0f);
startup.y += Mathf.Cos(x * Mathf.Deg2Rad) * 3f;
GameObjectPool.instance.GetAnInstance("star", startup);
yield return new WaitForSeconds(0.1f);
}
}
...and the rest is irrelevant.
Category All / All
Species Unspecified / Any
Size 497 x 312px
File Size 18 kB
Comments