//Well, for speed I would go like this (for many instances, globals would become instance vars for obvious reasons):
global ChargeMeter
global ChargeMeterMax
global ChargeMeterPercentage
global BaseBulletSpeed
global MaxBulletSpeed
--------
Every tick set ChargeMeterPercentage to (ChargeMeter/ChargeMeterMax)
--------
Set bullet speed to lerp(BaseBulletSpeed, MaxBulletSpeed, ChargeMeterPercentage )
--------
//Accuracy would be a similar approach:
global Accuracy_MaxDeviation //In degrees
local AngleToTarget
Set AngleToTarget to angle(EnemyX/Y,Target_ProjectedX/Y) //Assuming you know how to do this
Set bullet angle to
lerp (
(AngleToTarget + ( (Accuracy_MaxDeviation * -1) * ChargeMeterPercentage ),
(AngleToTarget + ( (Accuracy_MaxDeviation) * ChargeMeterPercentage ),
random(0.0,1.0)
)
//Note: whoops, misread your post. Thought you were talking about enemies firing at the player. Left the above in case that might be helpful. The bullet speed equation would be unchanged; all you need to do to the angle equation would be to change 'Set AngleToTarget to...' the following:
Set AngleToTarget to angle(PlayerX/Y,MouseX/Y)
//If you want, you could do a projected mouseX/Y counting in gravity, etc, or maybe you want player to compensate manually? Anyway...