AnimatorX
You cannot join in the fun until you register! so register now!



 
HomeCalendarSearchFAQPortalMemberlistUsergroupsRegisterLog in

Share | 
 

 Help plz!!!!!!!!

View previous topic View next topic Go down 
AuthorMessage
DeeCee
Moderator
Moderator
avatar

Posts : 532
Creditz : 673
Reputation : 0
Rank : Medium Beginner
Join date : 2009-10-05
Location : canada
Warnings :
0 / 100 / 10


PostSubject: Help plz!!!!!!!!   Sun Feb 14, 2010 6:49 am

ok
in actionscript 2.0
im making a platform game
and i have the script



onClipEvent (load) {
var speed:Number = 0;
var walk:Number = 3;
var run:Number = 6;
var grav:Number = 0;
var falling:Number = 0;
var jumped:Boolean = false;
var jumpHeight:Number = 15;
var touchingGround:Boolean = false;
var scale:Number = _xscale;
var doorOpened:Boolean = false;
var attacked:Boolean = false;
}
onClipEvent (enterFrame) {
if (!touchingGround) {
grav++;
this._y += grav;
} else {
grav = 0;
}
if (_root.ground.hitTest(_x, _y, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
if (!attacked) {
if (Key.isDown(Key.LEFT)) {
_x -= speed;
this.gotoAndStop(2);
_xscale = -scale;
}
if (Key.isDown(Key.RIGHT)) {
_x += speed;
this.gotoAndStop(2);
_xscale = +scale;
}
if (Key.isDown(Key.SHIFT)) {
speed = run;
} else {
speed = walk;
}
}
}
onClipEvent (enterFrame) {
if (!attacked) {
if (jumped) {
falling += 0.5;
_y += falling;
if (touchingGround) {
jumped = false;
}
} else {
if (Key.isDown(Key.UP)) {
jumped = true;
falling = -jumpHeight;
this.gotoAndStop(3);
}
}
}
if ((Key.isDown(Key.UP)) and (Key.isDown(Key.LEFT))) {
this.gotoAndStop(3);
}
if ((Key.isDown(Key.UP)) and (Key.isDown(Key.RIGHT))) {
this.gotoAndStop(3);
}
if ((!Key.isDown(Key.UP)) and (!touchingGround)) {
this.gotoAndStop(3);
} else if ((Key.isDown(Key.UP)) and (!touchingGround)) {
this.gotoAndStop(3);
}
if ((_currentframe == 3) and (touchingGround)) {
gotoAndStop(1);
}
}
onClipEvent (keyUp) {
if (!attacked) {
gotoAndStop(1);
}
}
onClipEvent (enterFrame) {
if ((this.hitTest(_root.door)) and (!doorOpened)) {
this._x -= speed;
}
if ((this.hitTest(_root.door)) and (Key.isDown(Key.SPACE)) and (_root.keys>=1)) {
_root.door.gotoAndStop(2);
doorOpened = true;
_root.keys -= 1;
}
if (this.hitTest(_root.wall)) {
this._x -= speed;
}
if (this.hitTest(_root.key)) {
_root.keys += 1;
unloadMovie(_root.key);
}
if (_root.keys<0) {
_root.keys = 0;
}
}
onClipEvent (enterFrame) {
if (Key.isDown(65)){
attacked = true;
this.gotoAndStop(4);
if(this.hitTest(_root.enemy)) {
_root.enemy.unloadMovie();
}
this.gotoAndStop(3);
}
if ((_currentframe == 3) and (touchingGround)) {
gotoAndStop(1)
}
}

and the jumping is always switching, and i never added the random math phrase
any one know why it wont jump properly???
and the attack is in a movie cli of the character on the right frame?!?
the character attacks every 2 seconds attomaticly,
and the jumpings screwed up cause every 3 jumps it goes to regular height making it hard to win the game!?!
please help???

------------------------------------------------------------------------

Back to top Go down
View user profile http://www.devoncook.com/Site/Welcome.html
 
Help plz!!!!!!!!
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
AnimatorX :: Help :: Help-
Jump to: