Anda di halaman 1dari 2

Gun onClipEvent(enterFrame){ Mouse.hide(); this._x=_root._xmouse; } Aim onClipEvent(enterFrame){ Mouse.hide(); this._x=_root._xmouse; this._y=_root.

_ymouse; } Enwemy Game Code: (enemy) on(press){ gotoAndPlay (the next frame number) } This is the First Person Shooter tutorial codes. Part 1: onClipEvent (enterFrame) { Mouse.hide(); this._x = _root._xmouse; this._y = _root._ymouse; } onClipEvent (mouseDown) { _root.ammo.nextFrame(); } onClipEvent (enterFrame) {if(Key.isDown(90)){this.gotoAndPlay(2); } } onClipEvent (enterFrame) {if(Key.isDown(80){this.gotoAndPlay(6); } } Part 3: _root.gotoAndPlay ("gameover") ; NOTE: the game over actionscript is only placed on your last keyframe for ammuna tion and health. and you can rename the gameover to the name you placed on the k ey label on the game over scene. stop(); stop action is placed on other frames on your health except for the last one als o remember to put the stop action on ur main frame of the game (where your guns etc are on) also place stop action on the game over frame! Part 4: onClipEvent (enterFrame) {

onMouseDown = function () { if (this.hitTest(_root._xmouse, _root._ymouse, true)){ _root.enemy.gotoAndPlay("death"); } }; } place that on "enemy" movieclip _root.health.nextFrame(); place that where the enemy is attacking (BEFORE HE DIES) _root.enemy.gotoAndPlay ("attack") ; place that on frame names, on top of the standing stance one frame after the att acking animation. stop(); end of the death animation Part 5: go in the crosshair movieclip the select the gun movieclip and paste this actionscript on it onClipEvent (mouseDown) { this.gotoAndPlay(2); } go inside the "gun" movieclip and place stop(); on frame 1 and 6 frames 2,3,4,5 are animation of the gun shooting..

onClipEvent (enterFrame) { if (_root.ch_mc.sbullet.hitTest(this)) { this.gotoAndPlay(2); } }

Anda mungkin juga menyukai