Forum Topic: Projectile coding.

(119 views • 2 replies)

This topic is 1 page long.

<< < > >>
None

Stilianos

Reply To Post Reply & Quote

Posted at: 5/15/09 03:52 AM

Stilianos LIGHT LEVEL 02

Sign-Up: 08/10/07

Posts: 296

The only code i can find to make movie clips is the following:

if (Key.isDown(Key.SPACE)) {
		i++;
		bul = _root.player.attachMovie("bullet", "bullet"+i, _root.getNextHighestDepth());
		bul.onLoad = function() {
			this._x = _root._char._x;
			this._ = _root._char._y;
		};
		bul.onEnterFrame = function() {
			this._x += 10;
		};
	}

But this attaches itself to the movieclip at which the code is ran making its movement values the same as the movie clip in question.

Does anyone know any way that you can create a movie clip without attaching it to anything so that i can make proper projectiles.


None

Denvish

Reply To Post Reply & Quote

Posted at: 5/15/09 10:04 AM

Denvish DARK LEVEL 45

Sign-Up: 04/25/03

Posts: 16,238

Change

_root.player.attachMovie

to

_root.attachMovie

- - Flash - Music - Images - -

BBS Signature

None

BrainToast

Reply To Post Reply & Quote

Posted at: 5/15/09 11:24 AM

BrainToast DARK LEVEL 08

Sign-Up: 01/12/09

Posts: 3

change

this._ = _root._char._y;

to

this._y = _root.char._y;

All times are Eastern Standard Time (GMT -5) | Current Time: 09:48 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!