stop creating objects / dejar de crear objetos

Get help using Construct 2

Post » Sat Jun 09, 2012 6:52 pm

I've had to click on the black box the program I create a new object, put it on the screen and I subtract 100 coins
But now I do not believe me when that object is less than 100 coins
How I can do?

He hecho que al pulsar sobre el cuadro negro el programa me cree un objeto nuevo, lo ponga en la pantalla y me reste 100 coins
Pero ahora quiero hacer que deje de crear ese objeto cuando tenga menos de 100 coins
Como puedo hacerlo?



B
10
S
1
Posts: 9
Reputation: 960

Post » Sat Jun 09, 2012 7:01 pm

Drag/drop the condition of event 3 in the event 1.

That would give :
Mouse: on left button clicked on HOUSE
System: Coins >= (greater or equal) 100
--> your actions
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Sat Jun 09, 2012 7:48 pm

that's the way correct?

esa es la forma correcta?


B
10
S
1
Posts: 9
Reputation: 960

Post » Sat Jun 09, 2012 9:10 pm

Apparently it is.
It means that new house will be created and money deduced from "coins" when the icon house is left clicked AND that coins is greater or equal to 100. (meaning when you have 0 coins, you can't create new houses)

Was that well what you were asking for ?
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Sat Jun 09, 2012 10:16 pm

si, lo que quiero es que me cree una casa cuando tenga 100 monedas.
Si tengo menos que no pueda.

yes, what I want is I believe a house when you have 100 coins. If I have unless you can not
B
10
S
1
Posts: 9
Reputation: 960

Post » Wed Jun 27, 2012 5:37 am

Does there any way to stop creating objects using system and compare variables? not just like click from mouse...

Joannesalfa2012-06-27 05:37:28
B
96
S
25
G
20
Posts: 3,052
Reputation: 22,638

Post » Wed Jun 27, 2012 12:04 pm

@Joannesalfa , you can put a global variable = 10 for example and everytime object created it will substract 1 from that global variable so you will put a limit when the global variable = 0 it will not create object for example : global varibale (createobj) .. so events will be like this :
event1:
    condition1:system :every x second or everytick
    condition2:system : compare two value --> createobj greater than 0
    action : system :create sprite at random,random
event2:
   condition1:sprite: is created
   action:system: subtract 1 from createobj
B
45
S
15
G
6
Posts: 795
Reputation: 11,935

Post » Wed Jun 27, 2012 9:38 pm

[QUOTE=zsangerous] @Joannesalfa , you can put a global variable = 10 for example and everytime object created it will substract 1 from that global variable so you will put a limit when the global variable = 0 it will not create object for example : global varibale (createobj) .. so events will be like this :
event1:
    condition1:system :every x second or everytick
    condition2:system : compare two value --> createobj greater than 0
    action : system :create sprite at random,random
event2:
   condition1:sprite: is created
   action:system: subtract 1 from createobj[/QUOTE]

Sounds good, i'm going to try this one.

Thanks!
B
96
S
25
G
20
Posts: 3,052
Reputation: 22,638


Return to How do I....?

Who is online

Users browsing this forum: Colorfish and 4 guests