Oh, sorry that I wasnt here last night, I was at AVP, Alien Vs Preditor :). Ok now to answer your questions one by one. First, flashnewbie3, to make a goomba, we draw (or import) the goomba, then we create the sequences for the goomba, but the goombas animations are going to be put together a little different then the others (I have an attachment on the bottom that shows the goombas animation). Now, lets move on to the code, so select the action panel, and type:
onClipEvent (load) {
xspeed = 2;
started = true;
//AHA! there's started again! remember, the "started" controls the games action for the mcs moved on screen//
_root.counter.stop();
//As I have explained in the other thread, the "_root.counter.stop()" is for something later//
b = this.getBounds(this);
//now, this will be an important part of the collision detection farther on in the goombas action//
}
Alright, not to hard so far, right? Then let’s continue. So now we need his movement code, so we type:
onClipEvent (enterFrame) {
if (started) {
if (this._xscale == 100) {
_root.counter._x -= xspeed;
this._x -= xspeed;
}
if (this._xscale == -100) {
_root.counter._x += xspeed;
this._x += xspeed;
}
}
//continued...//
And yet again, started was there. Now we need some ground, and wall code, so lets type the following:
if (_root.ground.hitTest(_x+x+b.xmin+5, _y+y+b.ymin+5, true)) {
this._xscale = -100;
}
if (_root.ground.hitTest(_x+x+b.xmax-5, _y+y+b.ymin+5, true)) {
this._xscale = 100;
}
if (!_root.ground.hitTest(this._x, this._y+15, true) && !walking) {
fall += 1;
if (fall>5) {
fall = 5;
}
this._y += fall;
}
}
If you have any more questions, feel free to ask :). Here is the attachment I promised: