Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Rockets Problem (part 3)
Bruffers
post Jul 14 2010, 02:22 PM
Post #1


New Member
*

Group: Members
Posts: 2
Joined: 14-July 10
Member No.: 4,301



Hi,

I am currently doing part 3 of the tank game tutorial and I am at the part where you make the rockets 'fly' towards the tank, in other words, make them heat seeking. My problem is that my code is the same as that in the video, but the rocket does not appear on the stage at all.

I have just moved about 6 lines of code from the 'bulletLoop < bulletNumber' while loop to the 'moveRockets()' function. Before I moved the code the rocket appeared on the stage and moved diagonally, in a straight line, as it was supposed to at that point.

The code is exactly as it appears on the video up until this point (all files, not just 'rockets.as'). Any help would be appreciated. Thanks.

Bruffers.

P.S.

This is the code that I moved:

///start of code///

rocketAimX[rocketLoop] = tankBase.x - this["rocket" + rocketLoop].x;
rocketAimY[rocketLoop] = tankBase.y - this["rocket" + rocketLoop].y;
rocketSpace[rocketLoop] = Math.sqrt((rocketAimX[rocketLoop] * rocketAimX[rocketLoop]) + (rocketAimY[rocketLoop] * rocketAimY[rocketLoop]));
var radians = Math.atan2(tankBase.y - this["rocket" + rocketLoop].y, tankBase.x - this["rocket" + rocketLoop].x);
var degrees = (radians/Math.PI) * 180;
this["rocket" + rocketLoop].rotation = degrees;

///end of code///
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Time is now: 8th September 2010 - 04:05 AM