Thread: Little help.
View Single Post
  #10  
Old 02-03-2009, 01:05 AM
Programmer Programmer is offline
Coder
Programmer's Avatar
Join Date: Jan 2008
Location: -78.464422, 106.837328
Posts: 449
Programmer has a spectacular aura aboutProgrammer has a spectacular aura about
Send a message via AIM to Programmer Send a message via MSN to Programmer Send a message via Yahoo to Programmer
Quote:
Originally Posted by Unkownsoldier View Post
Still doesnt work but I will try experimenting

PHP Code:
//#CLIENTSIDE

//up
if (playerdir=0){
this.x=playerx-10;
this.y=playery-20;
}
//left
if (playerdir=1){
this.x=playerx-10;
this.y=playery-10;
}
//down
if (playerdir=2){
this.x=playerx+0.4;
this.y=playery+10;
}
//right
if (playerdir=3){
this.x=playerx-10;
this.y=playery-10;
}
function 
onKeyPressed(ck) {
if (
== "a") {
replaceani("idle""idle");
replaceani("walk""walk");
setani("idle"NULL);
}
}

if (
weaponfired) {
setani pancho_katana-attack,;
replaceani idle,pancho_katana-idle;
replaceani walk,pancho_katana-walk;

}





function 
onWeaponFired() {
  
temp.dx player.vecx(player.dir) * 1.5;
  
temp.dy player.vecy(player.dir) * 2;
  
triggeraction(dxdy"AttackPlayer"player.account.5);
}  

function 
onActionAttackPlayer(accdamage) {
  if (
acc == player.account) {
    return; 
// this ends the function
  
}
  if (
damage <= 0) {
     return;
  }
  
  
hurt(damage);
  
setAni("HURTGANI"null);

Can you please encapsulate your code in [php] tags? This makes it easier to read and to understand. Thanks.
__________________
- Iᴀɴ Zɪᴍᴍᴇʀᴍᴀɴ
Reply With Quote