ForumsProgramming Forumnned help with my projectile

3 4619
Koshionos
offline
Koshionos
884 posts
Jester

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...

  • 3 Replies
EggysGames
offline
EggysGames
4 posts
Nomad

Put in

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

Koshionos
offline
Koshionos
884 posts
Jester

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?

Koshionos
offline
Koshionos
884 posts
Jester

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)

Showing 1-3 of 3