ForumsProgramming Forumnned help with my projectile

3 3396
Koshionos
offline
Koshionos
870 posts
3,225

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
Eggy
offline
Eggy
4 posts
60

Put in

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

Koshionos
offline
Koshionos
870 posts
3,225

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
870 posts
3,225

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