How do I control when destroying an object adds to score

Get help using Construct 2

Post » Thu Oct 01, 2015 6:25 am

Basically im setting up my game so that if you press a certain button and the right time, an object is destroyed and it adds to your score.
Now i want to set it up so that if it goes off the screen enough, it gets destroyed, but if i do this it still adds to score..how do i stop this?
B
6
S
1
Posts: 46
Reputation: 492

Post » Thu Oct 01, 2015 7:59 am

Could you remove the score related action from the object to the event that destroys the object?
B
10
S
3
G
1
Posts: 14
Reputation: 809

Post » Thu Oct 01, 2015 8:38 am

easily done.

you probably did - on destroyed - add some number to score.
what you should do is move that action (add some number to score) to event that checks if button was pressed in correct time.
then when object is destroyed on that event of pressing button in the right time - you get the score
otherwise you don't.
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,450

Post » Thu Oct 01, 2015 3:44 pm

saiyadjin wrote:easily done.

you probably did - on destroyed - add some number to score.
what you should do is move that action (add some number to score) to event that checks if button was pressed in correct time.
then when object is destroyed on that event of pressing button in the right time - you get the score
otherwise you don't.


I'm not quite sure how to do that though, because of the way the game is played.
Basically a spawner to the right is spawning the objects and they're scrolling to the left, this is one object with 7 different frames of different colors, and when its spawned it chooses a random color to be. Now when player clicks on a color, any oof that object thats the same color will be destroyed, leaving the rest.

Image
heres a refference photo if it helps
B
6
S
1
Posts: 46
Reputation: 492

Post » Thu Oct 01, 2015 4:42 pm

How are you doing the destroying?
Which events/conditions do you use?

Could you add a is on screen condition to the on destroyed event maybe?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Oct 01, 2015 4:43 pm

Ne7herM0St wrote:
Image
heres a refference photo if it helps


try:
Example.capx
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Thu Oct 01, 2015 9:10 pm

korbaach wrote:
Ne7herM0St wrote:
Image
heres a refference photo if it helps


try:
Example.capx


I feel i should mention that ur "example" looks better than my game .-. XD
and that worked so thank you very much =3
B
6
S
1
Posts: 46
Reputation: 492


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 10 guests