The Daily Click ::. Forums ::. Klik Coding Help ::. Another 360 Shooting problem
 

Post Reply  Post Oekaki 
 

Posted By Message

Ganymede Graphics

Possibly Insane

Registered
  17/04/2006
Points
  2711

GOTW JANUARY 2011
28th January, 2007 at 03:12:03 -

Ok, so heres the problem.

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?



 
Especially that.

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
28th January, 2007 at 09:20:45 -

Why would you run a fastloop for one single loop?

 
n/a

Ganymede Graphics

Possibly Insane

Registered
  17/04/2006
Points
  2711

GOTW JANUARY 2011
28th January, 2007 at 19:35:57 -

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.

 
Especially that.
   

Post Reply



 



Advertisement

Worth A Click