This site requires JavaScript, please enable it in your browser!
Greenfoot back
n15
n15 wrote ...

2016/6/15

Tracking bullets and replenishing bullets

n15 n15

2016/6/15

#
Hi, how would you be able to track bullets shot by a character and then spawn an item once a certain number of bullets is reached that when touched, removes itself and gives you more bullets?
danpost danpost

2016/6/15

#
@n15, it is not enough to just pose a programming question. You need to show some attempt at doing what you are trying to do. If you feel you lack the ability to even start on this issue, you should probably go to the java website tutorials and learn at least the basics of programming. I say this because by not showing any attempted code, it appears that you do not understand the basics. This is not the first discussion thread that you have done this with (and this is probably the reason that you have not received any responses to it). I could have responded to this one with this:
Use an int field to track the number of bullets remaining; initialize its value to the number of bullets the character starts with. Create a class for the "ammo pack" (for the actor that increases the number of bullets the character has). Have the character look for the ammo pack and when found, have said character remove the ammo pack and increase its bullet count.
But, I get the impression that you would still be "stuck". I would suggest you go to the Java tutorials and start with the "Trails Covering the Basics" section (2nd sub-header on left).
You need to login to post a reply.