How do I overlapping once and random number in object

Get help using Construct 2

Post » Tue Aug 25, 2015 5:51 pm

Message: misotropici is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Hi! I'm Luca from Italy. I'm sorry for my English, I'll try to be clear!
I'll insert my file .capxI've got two problems:
1) I've been following some instructions in a construct tutorial about once overlapping. When I pass on a black block two o more times, the trigger doesn't work and the counter signs other points. I need that one time overlapping, others steps on black block don't add more values to points.
2) My second problem is that random number is generate always the sprite overlapping black block. I need instead that the random number is created one times when System create an object, see image below.
Image

Thank you and sorry for my English. I've been studying to 2 years! :)
B
3
Posts: 4
Reputation: 183

Post » Tue Aug 25, 2015 6:01 pm

Hello
I'm not sure what you are trying to do, but I try to help you out.

1) What do you want to achieve with the 'which' variable? It is always 1, so your code at 'which = 0' will never be called.

2)
Just use 'On created block' and add your actions.
Image Image iTunes: Match3 | Google Play: Match3
B
100
S
35
G
30
Posts: 1,136
Reputation: 28,085

Post » Tue Aug 25, 2015 6:04 pm

I'm also not sure what you are asking but event 3 will always return 0. Use either floor(random(2)) OR choose(0,1).
ImageImageImage
B
71
S
22
G
240
Posts: 3,734
Reputation: 133,994

Post » Tue Aug 25, 2015 6:35 pm

AndreasR wrote:Hello
I'm not sure what you are trying to do, but I try to help you out.

1) What do you want to achieve with the 'which' variable? It is always 1, so your code at 'which = 0' will never be called.

2)
Just use 'On created block' and add your actions.


Hi! thank for your answer! :)
1) I've erased others code for example, at the begining there was others generator block like as which = 1 generated red block, which = 2 generate blue block etc..

2) I've insert my action as generator random numbers in "on create object", but it is generate always I overlapping on black block. I need that the random numbers are generated one time for each blocks.

Thanks :)
B
3
Posts: 4
Reputation: 183

Post » Tue Aug 25, 2015 6:36 pm

blackhornet wrote:I'm also not sure what you are asking but event 3 will always return 0. Use either floor(random(2)) OR choose(0,1).

Hi! thank for your answer! :)
I've erased others code for example, at the begining there was others generator block like as which = 1 generated red block, which = 2 generate blue block etc..

Thanks :)
B
3
Posts: 4
Reputation: 183

Post » Thu Aug 27, 2015 5:49 am

Hi! Nobody can help me? :(
I've used to trigger for overlapping but when I pass on same object overlapping works again.
I need that overlapping generate one event, others overlapping on the same object doesn't have to generate any others events.
Have a good day :)
B
3
Posts: 4
Reputation: 183

Post » Thu Aug 27, 2015 3:13 pm

misotropici wrote:Hi! Nobody can help me? :(
I've used to trigger for overlapping but when I pass on same object overlapping works again.
I need that overlapping generate one event, others overlapping on the same object doesn't have to generate any others events.
Have a good day :)


Just add a variable 'overlapped' = 0.

Condition
On overallping && overlapped = 0

Action
Set overlapped to 1
YOUR CODE

Regards
Image Image iTunes: Match3 | Google Play: Match3
B
100
S
35
G
30
Posts: 1,136
Reputation: 28,085


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 26 guests