
09-22-2001, 06:45 PM
|
|
and Delph Inc.
|
 |
Join Date: Jul 2001
Location: Canada
Posts: 1,162
|
|
|
[ Delph Inc. ]
Now...you have to test the players direction and say what you want the NPC to do when the player is facing that way.
e.g.
if (playerdir=3) {
this.arrowx[this.out]=playerx+1;
}
Now 'this.out' we'll talk about later because it counts how many arrows you have fired and adds each one to a specific number to be called separately.
playerdir=3 is just when the player is facing right
0=up
1=left
2=down
3=right
and playerx+1 is where the arrow will appear once fired.
You'll also need to add the arrows y position so:
if (playerdir=3) {
this.arrowx[this.out]=playerx+1;
this.arrowy[this.out]=playery+1.8;
}
Now all you have to do is add the position of the arrow for
playerdir:
0, 1, and 2.
After that...say which direction you want the arrow to be going:
this.arrowdir[this.out]=playerdir;
and also make it so that it adds another 1 to this.out everytime you fire the weapon.
so before all of the the direction and positioning stuff add:
if (isweapon) {
if (weaponfired&&playerdarts>0) {
freezeplayer 0.2;
player Laser.wav; //You can change this or delete it to have no sound.
playersprite=33;
playerdarts--;
Now you have most of what you need...all you need is the player/baddy hurting...and the pickup item code which is simple. |
__________________
Xerphier Dintch
Featuring

|
|
|
|