Forums

ForumsProgramming Forum

nned help with my projectile

Posted Feb 18, '08 at 10:19pm

Koshionos

Koshionos

374 posts

so i want to make my fireball in the game I'm working grow in size the longer you hold the button but i don't know how...

the code i tried was
(note: dx and dy are just values that increase the _y and _x values)
...
}else if(Key.isDown(Key.SHIFT)){
     fire._y = Player._y;
     fire._x = Player._x;
     fire.dx = Player.dx * 10;
     fire._xscale += 10;
      if (fire._xscale > 30){
         fire._xscale = 30;
         }
     fire._yscale += 10;
      if (fire._yscale > 30){
         fire._yscale = 30;
         }
} else...

 

Posted Feb 19, '08 at 7:41am

Eggy

Eggy

4 posts

Put in

fire._width += 5
fire._height +=5

 

Posted Feb 19, '08 at 6:59pm

Koshionos

Koshionos

374 posts

I tried this but it didn't work

}else if(Key.isDown(Key.SHIFT)){
     fire._y = Player._y;
     fire._x = Player._x;
     fire.dx = Player.dx * 10;
     fire._width += 10;
      if (fire._width >= 30){
           fire._width = 30;
      }
     fire._height += 10;
if (fire._height >= 30){
           fire._height = 30;
      }
     
      } else...

... is it because of AS2?

 

Posted Feb 20, '08 at 8:31pm

Koshionos

Koshionos

374 posts

well not really you know the game i think i asked you to test? by holding shift you increase and shoot off a fire ball... fortunately i fixed the code ( i think i typed in something wrong in the AS)

 
Reply to nned help with my projectile

You must be logged in to post a reply!