What does your code look like when you're creating bullet patterns based off the script? Can you give an example?
For me, I primarily use my code in the Step events (only because the enemies are emitters in itself than can also spawn other emitters if needed). Here's an example of one of the turrets in Stage 75, for instance. I'll add footnotes to the code as well.
Code: Select all
mastertimer += 1 // Responsible for launching the timers below.
bonus = 0 // Rises up by 1 to indicate a multipler for harder patterns.
if mastertimer > 59 {initialtimeron = 1}
if initialtimeron = 1 {initialtimer += 1} // (1st pattern)
//Add bullets on 100sec. (2nd pattern)
if global.time7 < 6000
{
mastertimer = 0
initialtimeron = 0
emergency0on = 1
bonus = 1 // 2x will be given upon destruction with shots.
}
if emergency0on = 1 {emergency0 += 1}
//Make bullets faster at 50sec. (3rd pattern)
if global.time7 < 3000
{
emergency0on = 0
emergency0 = 999
emergency1on = 1
bonus = 2 // 3x will be given upon destruction with shots.
}
if emergency1on = 1 {emergency1 += 1}
// This is the section where all the bullet patterns are.
switch (initialtimer)
{
case 15:
shot(x,y,rotatevalue0,2,o_ebullet1)
shot(x,y,rotatevalue1,2,o_ebullet1)
shot(x,y,rotatevalue2,2,o_ebullet1)
rotatevalue0 += 10
rotatevalue1 += 11
rotatevalue2 += 9
rotatevalue3 += 12
rotatevalue4 += 8
initialtimer = 0
break
}
switch (emergency0)
{
case 15:
shot(x,y,rotatevalue0,2,o_ebullet1)
shot(x,y,rotatevalue1,2,o_ebullet1)
shot(x,y,rotatevalue2,2,o_ebullet1)
shot(x,y,rotatevalue3,2,o_ebullet1)
shot(x,y,rotatevalue4,2,o_ebullet1)
rotatevalue0 += 10
rotatevalue1 += 11
rotatevalue2 += 9
rotatevalue3 += 12
rotatevalue4 += 8
emergency0 = 0
break
}
switch (emergency1)
{
case 15:
shot(x,y,rotatevalue0,3.5,o_ebullet1)
shot(x,y,rotatevalue1,3.5,o_ebullet1)
shot(x,y,rotatevalue2,3.5,o_ebullet1)
shot(x,y,rotatevalue3,3.5,o_ebullet1)
shot(x,y,rotatevalue4,3.5,o_ebullet1)
rotatevalue0 += 10
rotatevalue1 += 11
rotatevalue2 += 9
rotatevalue3 += 12
rotatevalue4 += 8
emergency1 = 0
break
}
// This section is used to switch the turret to its "critical" condition, spewing out medals when the HP is low enough.
if hitpoint < 29
{
sprite_index = s_turretcrit
medalrelease = 1
}
if medalrelease = 1 {medaltimer += 1}
// The higher the bonus variable, the higher the multipler AND the medal release rate.
if bonus = 0
{
switch (medaltimer)
{
case 6:
bonus = instance_create(x,y,o_medal)
bonus.speed = 1
bonus.direction = random(360)
medalbonus -= 1
medaltimer = 0
break
}
}
if bonus = 1
{
switch (medaltimer)
{
case 4:
bonus = instance_create(x,y,o_medal)
bonus.speed = 1
bonus.direction = random(360)
break
case 8:
bonus = instance_create(x,y,o_medal)
bonus.speed = 1
bonus.direction = random(360)
break
case 12:
bonus = instance_create(x,y,o_medal)
bonus.speed = 1
bonus.direction = random(360)
medalbonus -= 2
medaltimer = 0
break
}
}
if bonus = 2
{
switch (medaltimer)
{
case 2:
bonus = instance_create(x,y,o_medal)
bonus.speed = 1
bonus.direction = random(360)
break
case 4:
bonus = instance_create(x,y,o_medal)
bonus.speed = 1
bonus.direction = random(360)
break
case 6:
bonus = instance_create(x,y,o_medal)
bonus.speed = 1
bonus.direction = random(360)
medalbonus -= 1
medaltimer = 0
break
}
}
if medaltimer > 7 {medaltimer = 0}
if hitpoint < 1 // Kill the enemy with your shots and you get your points with a multipler, provided you're fighting a harder pattern.
{
instance_destroy()
if bonus = 0 {score += global.enemyworth*10}
if bonus = 1
{
instance_create(x,y,o_bonus0)
score += global.enemyworth*20
}
if bonus = 2
{
instance_create(x,y,o_bonus1)
score += global.enemyworth*30
}
}
if medalbonus < 1 // Let the medal supply run out and you get only your points without a multipler.
{
instance_destroy()
score += global.enemyworth*10
}
if global.time7 < 1 // Let the time run out and you only get 1/10 of your points.
{
instance_destroy()
instance_create(x,y,o_penalty)
score += global.enemyworth
}