what should be a simple task...

Get help using Construct 2

Post » Sat Jan 21, 2012 12:26 am

Maybe you don't need more than one at all. If one is being destroyed the instant one is being created, why not MOVE the first one to where the second one WOULD be created? It's essentially the same thing, isn't it? If you post your capx I'd be glad to try and get it working for you.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sat Jan 21, 2012 12:28 am

oooh now thats an idea i havent tried... and could work

heres the cap.x dude
http://www.mediafire.com/?jplv3lzeaejipdx

thankyou!
B
10
S
1
Posts: 39
Reputation: 1,053

Post » Sat Jan 21, 2012 12:29 am

p.s its the bar object which i only want 1 of at a time, just incase i didnt make it clear
B
10
S
1
Posts: 39
Reputation: 1,053

Post » Sat Jan 21, 2012 12:30 am

The sprites default value should be set to not destroy it. You change the value when you want to destroy it.
It's more about how you are choosing when it should draw at this point.
Image Image
B
161
S
48
G
90
Posts: 7,350
Reputation: 66,755

Post » Sat Jan 21, 2012 12:33 am

ahh i think i get it a little better now, so my mistake is by trying to destroy the 1st object, instead chnage the value of the 1st and then destroy..
B
10
S
1
Posts: 39
Reputation: 1,053

Post » Sat Jan 21, 2012 12:39 am

http://db.tt/fOUjj1B9

Here ya go. Very simple change: when you left click, it checks the value of bar.Count, which is how many instances of the bar object there are. If bar.Count = 0, that means there aren't any instances -- so create one, and start stretching that one. If bar.Count > 0, that means there IS one -- so instead of creating one, stretch that one instead.

Hopefully this is what you were looking for!
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sat Jan 21, 2012 12:49 am

yes! thats it, turns out i was nevr too far away after all. i tried a similar setup this morning lol one issue however is i would prefer it if i could create the second one and the 1st stays until i release the mouse.
so it doesnt dissapear as soon as a press the mouse down
if that makes sense lol
thankyou so much!
B
10
S
1
Posts: 39
Reputation: 1,053

Post » Sat Jan 21, 2012 12:52 am

Well in that case, a solution like newt's will work better. I'll try to set it up. Back in a flash!
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sat Jan 21, 2012 1:00 am

http://db.tt/fOUjj1B9

Sounds like this is what you want. Another small change: on Left mouse released, it checks the Stretching boolean of both bars to see if it's true or false. If it's false, meaning it's the old bar, it gets destroyed. If it's true, meaning it's the new bar, it gets the usual treatment.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sat Jan 21, 2012 1:06 am

that is perfect! its exactly the way i wanted it. i can now get on and do some level design, =]
thankyou for your help, ive been taught a lot these last few days on this forum because of people like yourself.

thanks again
Luke

B
10
S
1
Posts: 39
Reputation: 1,053

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: ManuelPerez and 28 guests