Jump to content


Requiring assistance in Flash AS3


2 replies to this topic

#1 AZZKIKR

    I am sarcastic and evil

  • Project Leader
  • 2215 posts
  • Projects: beta tester of world at war cnc and situation zero concept art

Posted 04 February 2010 - 05:17

Hi. I am doing a tank game in flash, and I am having problems, namely in the rotating of turret.

Quote

turret.addEventListener(Event.ENTER_FRAME, rotateTurret);

function rotateTurret(event:Event):void {

angle = Math.atan2(mouseY-Be_mc.y, mouseX-Be_mc.x);

angle *= radiansToDegrees;

Be_mc.rotation =(angle*–1) +90;
}
}


i have a syntax error. can anybody help?
Posted Image
Posted Image
RIP CommanderJB

#2 Dauth

    <Custom title available>

  • Gold Member
  • 11193 posts

Posted 04 February 2010 - 14:31

For a start you have an extra bracket at the end of the program.

Remove one of the } from it.

#3 AZZKIKR

    I am sarcastic and evil

  • Project Leader
  • 2215 posts
  • Projects: beta tester of world at war cnc and situation zero concept art

Posted 04 February 2010 - 14:41

well, i got another problem. managed to solve this part though.

Quote

addEventListener(Event.ENTER_FRAME, scrolling);
function scrolling (event: Event){
if (floor.Be_MC.x < 10) {
floor.x += 10;
} else if (floor.Be_MC.x > stage.stageWidth - 10){
floor.x -= 10;
}
}


when my tank moves to the side, the BG scrolls, and does not stop
Posted Image
Posted Image
RIP CommanderJB



4 user(s) are reading this topic

0 members, 4 guests, 0 anonymous users