00:00
00:00
Newgrounds Background Image Theme

FitLetter just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Real-Time Battles

Share Collapse

Author Comments

I noticed that a lot of tutorials on Newgrounds have a lot of components to real-time battles, but none of them hosted everything all at once, so I decided to make this. The code is a fusion of all the sources listed in my entry entitled "Shooter Demo" with a dash of my own script. Hopefully you'll be able to make a good real-time battle out of this. If you need additional help with the tutorial, I will most likely be unavailable, so check out other tutorials on Newgrounds. There's a ton of them that explain everything. I included no music, so go ahead and listen to your own in the Audio Portal.

Some guy PM'ed me and asked me how to make ammo. This is my response to his PM for all of you out there who still check this out:
Start off the menu screen with
bullets=100;
or however many you want to start out with and put these actions on the player after everything:
onClipEvent(enterFrame){/
/Movie Clip handler
if(Key.isToggled(1)){//If the left mouse button is toggled
_root.bullets-=0.5;//Redu ce bullets by 0.5 so when it's toggled twice you lose a full bullet
}//Terminate the if condition
if(_root.bullets<1){//If you have less than one bullet
_root.enemy.damagedealt=0 ;//Make shooting the enemy deal no damage to it
}//Terminate the if condition
if(_root.bullets>1){//If you have regained bullets through a powerup or by other means
_root.enemy.damagedealt=2 ;//Make shooting the enemy once again damage it
}//Terminate the if condition
}//Terminate the entire function
And on the frame where it says bullets=100; put this on the next line:
if(_root.bullets<1){//If you have less than one bullet
_root.enemy.damagedealt=0 ;//Make shooting the enemy deal no damage to it
}//Terminate the if condition
And on the frame where it says bullets=100; put this on the next line:
enemy.damagedealt=2;
You can change how much damage you want it to do to the enemy however you like.
You're almost done, but one more thing. Inside the enemy where it says:
_root.enemyhp -= random(2);//Subtract 1-2 HP from your enemy
Change it to:
_root.enemyhp -= random(damagedealt);

Log in / sign up to vote & review!

Newgrounds accounts are free and registered users see fewer ads!

.......is good

Kwing responds:

Oh? Well thanks.

Credits & Info

Views
7,825
Faves:
7
Votes
10
Score
4.49 / 5.00

Uploaded
Mar 9, 2008
8:54 PM EDT