Health and Shield damage are taking too much damage.

Get help using Construct 2

Post » Sun Aug 30, 2015 3:27 pm

I have been learning C2 for several months now and read a total of three books so far including C2 Manual. I don't know if this is a bug or I'm doing something wrong. I started on my first project 3 months ago which was a driving game and ran into a problem which I thought I could straight it out. After a month of reading through tons of tutorials and was unable to figure out the issue, I put the driving game on the back burner thinking I did something wrong in the programming part. Then after reading 2 more books on C2, I decided to give it another try only but this time I tried my hand at a Top Down spaceship shooter and ran into the same problem.

Issue One: When I program the Player Ship on collision with the enemy or the enemy bullet, the health or the shield first initial contact is deducted around 40% which is not what I programmed. I programmed the deduction to be 10, not 40%. Why is this happening?

Issue Two: I programmed the shield the same way, but after the on collision with powerup the shield doesn't automatically powerup until after the collision with the enemy. Why is this happening.

This has been a pain trying to figure out...got me ready to throw in the towel...LOL! But I was always taught never give up...LOL!
B
10
S
2
Posts: 9
Reputation: 880

Post » Sun Aug 30, 2015 3:29 pm

Dropbox is having issues so I can't show my screenshots of the code...smh!
B
10
S
2
Posts: 9
Reputation: 880

Post » Sun Aug 30, 2015 3:45 pm

@franknitty2 - the line of code that is deducting health is probably running multiple times. You might need to add a trigger once condition or have some other way to stop taking further damage for a short period of time.
B
98
S
35
G
20
Posts: 438
Reputation: 17,875

Post » Sun Aug 30, 2015 8:39 pm

@AllanR I just can't seem to find the error...LOL! Seeing how I'm unable to share screenshots at the moment I guess I have to write the code here. Bare with me:

Shield Configurations
Add Event: System > On start of layout Add Action: Shield Object > Pin Pin to Player (Position & angle)
Add Event: Enemy1 > On Collision with Shield object Add Action: Enemy1 > Destroy
Add Action: Shield object > Flash 0.1 on 0.1 off for 1.0
Add Action: Audio > Play FX file
Add Action: Shield object > Subtract 10 from ShieldHealth
Add Action: ShieldBar > Set width to PlayerShield.ShieldHealth

There is multiple enemies and I have them all setup the same way. I did have them setup in a FAMILY but I got the same results. So I was force to remove the family object because of this same issue. Once I solve this issue, then I will be able to find out what I'm doing wrong in other areas of my project....whew! Do you think I this in the wrong order and if so, what is the best way to lay it out.
B
10
S
2
Posts: 9
Reputation: 880


Return to How do I....?

Who is online

Users browsing this forum: TheCrazyPrince and 23 guests