Problems with SetEmitterTarget()
Posted on Sat, 2012-01-28 17:19
So I spawn my enemies using some simple spawn code and add them to a table.
Then in my game loop I have
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | if enemies[1] then Particles.SetEmitterTarget( "smallShipFiring1", enemies[1], false, 0, 0, 0 ) end if enemies[2] then Particles.SetEmitterTarget( "smallShipFiring2", enemies[2], false, 0, 0, 0 ) end if enemies[3] then Particles.SetEmitterTarget( "smallShipFiring3", enemies[3], false, 0, 0, 0 ) end if enemies[4] then Particles.SetEmitterTarget( "smallShipFiring4", enemies[4], false, 0, 0, 0 ) end if enemies[5] then Particles.SetEmitterTarget( "smallShipFiring5", enemies[5], false, 0, 0, 0 ) end |
This basically works ok except the new x&y offset features don't work at all. They do nothing and also when flip my enemies (they travel left and right) with enemies[i].xScale = -1. Then they fire all sorts of crazy. Goes really fast, but just sound, no particles. Any Ideas?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | if enemies[i].type == "royalNavy" then if playerIsAttacking then if enemies[i].underAttack == true then enemies[i]:translate( 0, 0 ) elseif enemies[i].playerSpotted == true then enemies[i]:translate( -0.1, 0 ) elseif enemies[i].x >= _xPlayer then enemies[i]:translate( speedLeft, 0 ) enemies[i].xScale = 1 else enemies[i]:translate( speedRight, 0 ) enemies[i].xScale = -1 end else enemies[i]:translate( speedLeft, 0 ) enemies[i].xScale = 1 end end |
