adding segments in runtime

Get help using Construct 2

Post » Sun Jan 22, 2012 11:46 pm

hey everyone, hope you all had a good weekend.
well ive spent most of mine working on my game and as usual come across another snag. lol.

http://dl.dropbox.com/u/4201143/Engine_Alpha1.01b/index.html
-use space to spawn a new cube
-left mouse t draw and drag out conveyor belts

there is the basic engine so you guys and girls can check it out.
ok so so far you can drag out conveyor belts which can move the cubes around the screen. but as you can see the conveyors are just black lines, and tbf...just ugly lol

now my problem is if i just make the conveyor a big image, it will simply get stretched and again...look ugly.
what i hope to do is make it so when a user drags out a line, the starting point and end point will become "caps" which will be cartoon looking ends of a conveyor belt,
once done, the game will calculate the length of the line made and fill in the space between the caps with conveyor belt segments.

(for example; for every 20 pixels of the lines length, add 1 segment ect)

so this way the overall belt will look decent and overall...not stretch

so what im asking is 1st off is this possible to do in construct?
secondly how would i even begin at pulling off this mystery lol

thankyou
L.M.B
B
10
S
1
Posts: 39
Reputation: 1,053

Post » Mon Jan 23, 2012 12:00 am

Make it a family, then compare the width, if the widths over a certain width spawn a sprite or whatever at sprite.x + 20
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Mon Jan 23, 2012 12:09 am

right o, dont i need to be a paid member to use families?
anyways i like the calculation you provided so ill give it a go
B
10
S
1
Posts: 39
Reputation: 1,053

Post » Mon Jan 23, 2012 12:14 am

Yeah families is a paid feature..
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Mon Jan 23, 2012 12:20 am

guess i cant do that feature then, any other ways i could do it?
B
10
S
1
Posts: 39
Reputation: 1,053

Post » Mon Jan 23, 2012 1:20 am

just buy it, it is worth it.
B
6
G
1
Posts: 44
Reputation: 1,220

Post » Mon Jan 23, 2012 1:28 am

You could use the tiledbackground object.

http://dl.dropbox.com/u/5426011/examples%208/textureLine.capx
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273

Post » Mon Jan 23, 2012 11:14 am

wow, thought i was screwed there and then i saw this. thankyou, this was just the type of thing i was looking for, ill look into when i get some free time and see how you did it
thankyou
oh and @spexel, its not that i choose not to buy it, i simply dont have the cash to pay. student life is taking its toll
B
10
S
1
Posts: 39
Reputation: 1,053


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests