Ok, now you’ll have to perform a check. Say the laser takes -20 energy each time. If the energy property is < 20 then it can’t fire anymore.
So it goes something like this, considering the laser thingy is linked (Umm sort of interconnected logic bricks).
basically you just go
if energy >20:
fire away
It’s just psuedo code up there, but it’s the concept. The most important thing here is the object that shoots the laser needs to get hold of the energy property in order to check to see if it’s >20 then it’ll still fire. Hmm, if you can’t figure out how to link them up, post .blend and I’ll link them for you.
To link bricks from different objects, you select each object and activate the “Sel” button over each of the three block types. Then you can see and connect logic bricks from each object.
Man, I just couldn’t get it figured out. Here’s the updated file: .http://s8.turboupload.com/f/177153/1133184828/e3dd198baaf39324822ebbb28a660a14/RS-BO.zip
See when you press & hold the SPACE bar, the lasers fire, and the energy bar is depleted, once depleted it gradually builds back up. What’s supposed to happen is the lasers should stop firing when the gauge is depleted. The same thing is supposed to happen when you press Key 2 for his special attack. Thanks for all your help, man.
Ex:
lasers w/ depleting gauge
special attack w/ depleting gauge
Side note:
I added more sound to the file: footsteps and machine cannon fire. I also added a camera that activates when you press Key 1 for the special attack, and when you press Key 2, the beam is fired and after a few seconds delay, the camera switches back to the cockpit view. Key 3 activates a skycam view, while Key 4 puts you right back in the cockpit view.
Heh, simple fix. :o Man this is getting sloppy now, lol without some python for all of it. Umm, take a look at the interlinked logic bricks and you’ll see how you can do this in the future. Toomai’s explanation on how to interlink them is right on target.
Ok, so for the fix in the file. It’s completely fixed now, but I think you should try something else besides 2 for the threshold where it stops at. That’s because the energy only resets itself to 1. So, lol, when everything’s depleted and I still hold onto space bar or 2, it’ll shoot in small bursts now instead of continuous. You want it to stop for awhile right (So maybe increase the energy it takes to fire per shot or have the energy bar increase at a slower rate?