Kamis, 23 Agustus 2012

Ane pengin nyate siapa aja WOI CHARACERS yg ada di KAI....

Senin, 20 Agustus 2012

hanya untuk belajar bikin game...........


READ EVERYTHING - AND DO IT CAREFULLY!!!!

REPLACE THE 2 "LESSTHAN" FOUND IN THE HEALTHBAR AS FOR P1 & 2 WITH THE ACTUAL LESS THAN SIGN

P1 MC:


onClipEvent (load) {
var speed = 0;
var walk = 6;
var run = 9;
var grav = 0;
var falling = 0;
var jumped = false;
var jumpHeight = 15;
var touchingGround = false;
var scale = _xscale;
var doorOpened = false;
var attacked = false;
}
onClipEvent (enterFrame) {
if (!touchingGround) {
++grav;
this._y = this._y+grav;
} else {
grav = 0;
}
// end else if
if (_root.ground.hitTest(_x, _y, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
// end else if
if (!attacked) {
if (Key.isDown(74)) {
setProperty("", _x, _x-speed);
this.gotoAndStop(2);
setProperty("", _xscale, -scale);
}
// end if
if (Key.isDown(76)) {
setProperty("", _x, _x+speed);
this.gotoAndStop(2);
setProperty("", _xscale, scale);
}
// end if
if (Key.isDown(Key.SHIFT)) {
speed = run;
} else {
speed = walk;
}
// end if
}
// end else if
}
onClipEvent (enterFrame) {
if (!attacked) {
if (jumped) {
falling = falling+5.000000E-001;
setProperty("", _y, _y+falling);
if (touchingGround) { jumped = false;
}
// end if
} else if (Key.isDown(73)) {
jumped = true;
falling = -jumpHeight;
this.gotoAndStop(3);
}
// end if
}
// end else if
if (Key.isDown(73) && Key.isDown(76)) {
this.gotoAndStop(3);
}
// end if
if (Key.isDown(73) && Key.isDown(74)) {
this.gotoAndStop(3);
}
// end if
if (!Key.isDown(73) && !touchingGround) {
this.gotoAndStop(3);
} else if (Key.isDown(73) && !touchingGround) {
this.gotoAndStop(3);
}
// end else if
if (_currentframe == 3 && touchingGround) {
gotoAndStop("idle");
}
// end if
}
onClipEvent (keyUp) {
if (!attacked) {
gotoAndStop("idle");
}
// end if
}
onClipEvent (enterFrame) {
// end if
if (this.hitTest(_root.wall)) {
this._x = this._x+speed;
}
// end if
}
onClipEvent (enterFrame) {
if (Key.isDown(65)) {
this.gotoAndStop("attack1");
if (this.hitTest(_root.player2)) {
--_root.health2;
_root.player2.gotoAndStop("fall");
}
// end if
}
// end if
}



P2 MC:


onClipEvent (load) {
var speed = 0;
var walk = 6;
var run = 9;
var grav = 0;
var falling = 0;
var jumped = false;
var jumpHeight = 15;
var touchingGround = false;
var scale = _xscale;
var doorOpened = false;
var attacked = false;
}
onClipEvent (enterFrame) {
if (!touchingGround) {
++grav;
this._y = this._y+grav;
} else {
grav = 0;
}
// end else if
if (_root.ground.hitTest(_x, _y, true)) {
touchingGround = true;
} else {
touchingGround = false;
}
// end else if
if (!attacked) {
if (Key.isDown(Key.LEFT)) {
setProperty("", _x, _x-speed);
this.gotoAndStop(2);
setProperty("", _xscale, scale);
}
// end if
if (Key.isDown(Key.RIGHT)) {
setProperty("", _x, _x+speed);
this.gotoAndStop(2);
setProperty("", _xscale, -scale);
}
// end if
if (Key.isDown(13)) {
speed = run;
} else {
speed = walk;
}
// end if
}
// end else if
}
onClipEvent (enterFrame) {
if (!attacked) {
if (jumped) {
falling = falling+5.000000E-001;
setProperty("", _y, _y+falling);
if (touchingGround) { jumped = false;
}
// end if
} else if (Key.isDown(Key.UP)) {
jumped = true;
falling = -jumpHeight;
this.gotoAndStop(3);
}
// end if
}
// end else if
if (Key.isDown(Key.UP) && Key.isDown(Key.RIGHT)) {
this.gotoAndStop(3);
}
// end if
if (Key.isDown(Key.UP) && Key.isDown(Key.LEFT)) {
this.gotoAndStop(3);
}
// end if
if (!Key.isDown(Key.UP) && !touchingGround) {
this.gotoAndStop(3);
} else if (Key.isDown(Key.UP) && !touchingGround) {
this.gotoAndStop(3);
}
// end else if
if (_currentframe == 3 && touchingGround) {
gotoAndStop("idle");
}
// end if
}
onClipEvent (keyUp) {
if (!attacked) {
gotoAndStop("idle");
}
// end if
}
onClipEvent (enterFrame) {
if (this.hitTest(_root.wall)) {
this._x = this._x+speed;
}
// end if
}
onClipEvent (enterFrame) {
if (Key.isDown(96)) {
this.gotoAndStop("attack1");
if (this.hitTest(_root.player)) {
--_root.health;
_root.player.gotoAndStop("fall");
}
// end if
}
// end if
}


P1 HealthBar:

onClipEvent (enterFrame)
{ this._width = _root.health; if (_root.health LESSTHAN= 0) { _root.gotoAndStop("p1lose"); } // end if updateAfterEvent();
}


P2 HealthBar:

onClipEvent (enterFrame)
{ this._width = _root.health2; if (_root.health2 LESSTHAN= 0) { _root.gotoAndStop("p2lose"); } // end if updateAfterEvent();
}