Ok so I have some stuff written up and I have it so the main character moves to the keys, and is always looking at the mouse. Although when I try to shoot using stage.addEventListener(MouseEvent.CLICK, ...) the bullet remains at 0,0. I made a bullet class to take the characters x,y and rotation also speed. I found out if I keep increasing speed the radius around 0,0 increases in the way the character aims but its not firing from his x,y just the 0,0. Any help would be much appreciated.
public function fireBullet(event:MouseEvent) { var d:Bullet = new Bullet(hero.x, hero.y, hero.rotation, 6); stage.addChild(d); }
I had this written out, which I thought would work but it doesn't for some reason.
This is in my character class.
public function Hero(stageRef:Stage) { this.stageRef = stageRef; //starting position for the hero this.x = stageRef.stageWidth/2; this.y = stageRef.stageHeight/2; }
I just saw in my bullet class that I had a = instead of a += for my movement of the bullet. Well thanks a lot for the help, but I might be needing some help if I can't figure out how to get a good hit collision system to work.