View Single Post
  #1  
Old 09-17-2011, 12:27 PM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Concept Of A Rocket Launcher

Here is just a base of what iv made, any suggestions are welcome.
Also if you know how to make the rotation correct by where the mouse is it would be appriciated.
i havnt done any gfx for it yet as i suck at gfx.
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.rocketfired 0;
  
onTimeout();
}

function 
onWeaponfired() {
  if (
this.rocketfired == "1") {
    
this.rx mousex;
    
this.ry mousey;
    
onTimeout();
  }
  
this.rocketfired 1;
}

function 
onTimeout() {
  if (
this.rx mousex) {
    
this.rx++;
  }
  if (
this.ry mousey) {
    
this.ry++;
  }
  if (
this.rx mousex) {
    
this.rx--;
  }
  if (
this.ry mousey) {
    
this.ry--;
  }
  if (
this.rocketfired == "1") {
    
showimg(1"block.png"this.rxthis.ry);
    
player.chat "Rocket Moving!";
  }
  if (
onwall(this.rxthis.ry)) {
    
onExplodeRocket();
  }
  for (
temp.plplayers) {
    if (
this.rx in pl.xpl.2.5 | && this.ry in pl.ypl.| ) {
      
onExplodeRocket();
    }
  }
  
settimer(0.05);
}

function 
onExplodeRocket() {
  if (
this.rocketfired == "1") {
    
putexplosion(1this.rxthis.ry);
    
player.chat "Rocket Exploded!";
    
this.rocketfired 0;
    
hideimg(1);
  }

__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote