this is in my bullet movie clip on the timeline.
_root.bulletArray.push(this)
speed=12
_root.shootable=false
_rotation=_root.Dip._rotation
onEnterFrame=function(bullet){
if(_x>550){
removeMovieClip(this)
}else if(_x<0){
removeMovieClip(this)
}else if(_y>400){
removeMovieClip(this)
}else if(_y<0){
removeMovieClip(this)
}
_x+=Math.cos(_rotation*Math.PI/180)*speed
}
this is on the main timeline.
bulletArray = new Array()
Bullets = 0;
function shoot(){
var Bullet = attachMovie("Meteor", "Meteor"+Bullets, _level0.getNextHighestDepth(), {_x:Dip._x, _y:Dip._y});
}
This is the script in my character.
onClipEvent (load) {
gravity = 12;
walkSpeed = 3;
maxJump = 15;
scale = _xscale;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_xscale = -scale;
_x -= walkSpeed;
_root.Dip.Dip1.gotoAndStop(2)
}
if (Key.isDown(Key.RIGHT)) {
_xscale = +scale;
_x += walkSpeed;
_root.Dip.Dip1.gotoAndStop(2)
}
if (air == true) {
_y += gravity;
state = 3;
}
if (_root.floor.hitTest(_x, _y, true)) {
air = false;
} else {
air = true;
}
if (Key.isDown(Key.UP) && jump == true) {
_y -= jumpSpeed;
}
if (air == false) {
jump = true;
jumpcount = 1;
jumpSpeed = 30;
}
if (Key.isDown(Key.UP)) {
jumpcount += 1;
jump = false
}
if (Key.isDown(Key.SPACE)) {
_root.shoot()
}
}
onClipEvent (enterFrame) {
if (this._x>=550) {
this._x = 545;
}
if (this._x<=10) {
this._x = 15;
}
}
It all works but when i turn around it still shoots the same way im sure its something simple but i just cant work it out.
then try:
this is in my bullet movie clip on the timeline.
_root.bulletArray.push(this)
speed=12
_root.shootable=false
//_rotation=_root.Dip._rotation
onEnterFrame=function(bullet){
if(_x>550){
removeMovieClip(this)
}else if(_x<0){
removeMovieClip(this)
}else if(_y>400){
removeMovieClip(this)
}else if(_y<0){
removeMovieClip(this)
}
_x+=Math.cos(_rotation*Math.PI/180)*speed
}
this is on the main timeline.
bulletArray = new Array()
Bullets = 0;
function shoot(){
var Bullet = attachMovie("Meteor", "Meteor"+Bullets, _level0.getNextHighestDepth(), {_x:Dip._x, _y:Dip._y});
Bullet._rotation=Dip._rotation
}
This is the script in my character.
onClipEvent (load) {
gravity = 12;
walkSpeed = 3;
maxJump = 15;
scale = _xscale;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
_xscale = -scale;
_x -= walkSpeed;
_root.Dip.Dip1.gotoAndStop(2)
}
if (Key.isDown(Key.RIGHT)) {
_xscale = +scale;
_x += walkSpeed;
_root.Dip.Dip1.gotoAndStop(2)
}
if (air == true) {
_y += gravity;
state = 3;
}
if (_root.floor.hitTest(_x, _y, true)) {
air = false;
} else {
air = true;
}
if (Key.isDown(Key.UP) && jump == true) {
_y -= jumpSpeed;
}
if (air == false) {
jump = true;
jumpcount = 1;
jumpSpeed = 30;
}
if (Key.isDown(Key.UP)) {
jumpcount += 1;
jump = false
}
if (Key.isDown(Key.SPACE)) {
_root.shoot()
}
}
onClipEvent (enterFrame) {
if (this._x>=550) {
this._x = 545;
}
if (this._x<=10) {
this._x = 15;
}
}
It all works but when i turn around it still shoots the same way im sure its something simple but i just cant work it out.
North America
Europe, Middle East and Africa
Asia Pacific