Making a little shootemup platform thingo game. I have to mounted machine guns that fire when you get close to them. The firing part works fine when there is one turret set up, but when there are two cannons/turrets whatever they have trouble shooting. I'm not sure why exactly they have the problem. I'm thinking its bullets both in a way share the same alterable values to move. The alterable values they set there position to are both increased when the turrets fire. I'm asking for a way that i can have two turrets in the play area firing at once.
Heres the code if you don't understand the problem.
-Always
+start loop "move bullets" 1 times
-Repeat while left mouse is pressed
+Turret shoot bullet
+set alterable value A(bullet) to angle(turret)
+set alterable value B(bullet) to x position(bullet)
+set alterable value C(bullet) to y position(bullet)
+set internal flag1(bullet) on
-On loop move bullets
-internal flag1(bullet) is on
+set alterable value B(bullet) to set alterable value B(bullet)+10*Cosine(alterable value A(bullet))
+set alterable value C(bullet) to set alterable value C(bullet)+10*Sine(alterable value A(bullet))*-1
+set x position(bullet) to alterable value B(bullet)
+set y position(bullet) to alterable value C(bullet)
If you can be bothered reading that and understand it, could you possibly help me undertand why i can't have two objects firing at the same time?
What do you mean. I run the fast loop so I can have bullets travelling extremely fast/or slow and still have proper collisions. Instead of a bullet going 50 pixels past its target.