How do I Solve My Problem..

Get help using Construct 2

Post » Wed Mar 01, 2017 5:26 am

Hello,
I am having a problem while making a game.
I have set my global variable 'EnemyHealth'=3
If the bullet hit the enemy Subtract 1 from EnemyHeath
When 'EnemyHealth' = 0 destory enemy
But when i play the game i shoot 1 bullet Enemy destory.

Then I have set my global variable 'EnemyHealth'=9
If the bullet hit the enemy Subtract 1 from EnemyHeath
When 'EnemyHealth' = 0 destory enemy
But when i play the game i shoot 3 bullet Enemy destory.

Can anyone help me with this problem
B
10
S
4
G
2
Posts: 31
Reputation: 1,828

Post » Wed Mar 01, 2017 5:31 am

Can I please see a capx? The problem is difficult to understand from the text alone, just a little.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
52
S
24
G
30
Posts: 537
Reputation: 19,651

Post » Wed Mar 01, 2017 5:34 am

try this. when the bullet hit the enemy destroy the bullet. :D
or you can look at the example top down shooter :D
B
79
S
31
G
7
Posts: 148
Reputation: 9,179

Post » Wed Mar 01, 2017 5:36 am

how do i send you a capx
B
10
S
4
G
2
Posts: 31
Reputation: 1,828

Post » Wed Mar 01, 2017 5:56 am

Don't know if this is the problem but make sure to use On Collision instead of is Overlapping because On Collision is called one time while true and Overlapping is Called from every tick While is true. to share .capx use one of those sites (DropBox, Google Drive or OneDrive) they are free and good for sharing data and like clarkkentnicdao said destroy the bullet on Collision or just use On Collision method
B
9
S
1
G
1
Posts: 9
Reputation: 943

Post » Wed Mar 01, 2017 6:09 am

Message: Zion can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
a
Last edited by Zion on Thu Mar 02, 2017 3:38 pm, edited 1 time in total.
B
10
S
4
G
2
Posts: 31
Reputation: 1,828

Post » Wed Mar 01, 2017 6:15 am

a
Last edited by Zion on Thu Mar 02, 2017 3:38 pm, edited 1 time in total.
B
10
S
4
G
2
Posts: 31
Reputation: 1,828

Post » Wed Mar 01, 2017 6:38 am

In your sub event 25 each tick (60 in a second) that the frame is displayed, a bullet is created.
Add the system condition "Trigger once while true" to create only a single bullet and so have a single hit.
Same to the sub event 30.

Also you probably will need to use instance variables instead of global variables to keep on with your project.
Also, you should look into including event sheet instead of redoing tons of the same events in different layouts.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
296
S
119
G
96
Posts: 7,332
Reputation: 71,306

Post » Wed Mar 01, 2017 6:51 am

thanks
B
10
S
4
G
2
Posts: 31
Reputation: 1,828


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 29 guests