(Fixed) Single Fire vs Rapid Fires issue...lost !!
Thunder_Child
Member Posts: 2,343
Ok so I have a ship...it moves via actor touch X,Y...works great.
When I first touch Ship I spawn a bullet actor...this damages enemy's "Self Life" integer by 8....enemies health is 24 so it reduces its health down to 16....works great.
My issue is...Also when I touch Ship and "Hold"...I also have a timer to Spawn a bullet every .25 seconds...this works fine...however the additional bullets don't do any damage to the enemy...I have to lift and touch 3 times for the damage to deduct 8...three times to make the enemies "Self Life" be reduced to 0...
How can I make each bullet while touch and holding..."Rapid Fire" to consecutively damage the enemy down to 0 health ?
Insert all caps HELP !!!!
Comments
Where are you subtracting from the healh? It sounds like you're doing it in the enemy ship. Make sure you do it in the bullets.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Hmmm ok but my Self Life is in the actor its self...should I make that a game level attribute instead I'm thinking now? Because yes in my enemy actor I have a rule that when actor overlaps or collide with actor type "bullet 1" to change attribute self life -8
Complete Guide to iOS Publishing {} Complete Guide to Mac Publishing
Here's what I'm thinking is happening:
Your enemy actor is detecting the first bullet and it decreases the life count. However, when you rapid fire, it gets caught in a loop and fails to detect the collisions because there are so many. If the subtraction happens in the bullets themselves, they each will only collide once, subtract then get destroyed. This should solve your issue.
Using a global attribute would only work if you only have 1 enemy, or else all of your enemies will be destroyed when that global attribute = 0.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
I'm seeing the issue on my end too. Let me see if I can make a quick demo for you on how you may want to address this. Back in a moment.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Ok, check this out. Not sure if I would use this in a commercial game, but it's an easy workaround. It needs more testing to see if it works every single time - in the brief testing I gave it, it performed very well and eliminated the issue.
There are various ways you could solve the issue you're seeing, but this is one way. Notes are included in the project file.
Obviously you could take it another step and if you wanted to include more enemies (which I assume you will), you could dynamically add/remove rows in the table and assign each actor their appropriate rows.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Cool I will check it out....I did find a fix. Game level integer worked vs a self life/health integer.
I will give yours a look see. Thanks @Braydon_SFX
Complete Guide to iOS Publishing {} Complete Guide to Mac Publishing