Setting obstacle height based on number of sprites

Get help using Construct 2

Post » Sun Aug 03, 2014 2:37 pm

I've got an autorunner game with obstacles, and i wanted to know whether i could set my obstacle height based on the number of sprites rather than multiplying the obstacle height through expressions to generate the height (hope that made sense).

Right now, how i've got it, it works fine with regard to the height that the obstacles spawn at but i'm not a fan of the sprites being clipped if the obstacle is spawned at something like 2 and a half sprites. This reduces what i can use as an obstacle as i'd have to use a seamless block to make it look any good.


I've provided a capx file with obstacles so hopefully someone can help out.

Basically, i wanted to so that my obstacles can be randomly spawned 3 sprites high, or 2 sprites high etc.
You do not have the required permissions to view the files attached to this post.
Image ImageImage
B
7
S
2
G
1
Posts: 93
Reputation: 1,243

Post » Sun Aug 03, 2014 9:06 pm

well your sprite size is 39 px, so why not just make the size to 39*random(1,x) ?

Autorunner Example %28Obstacles%29.capx
You do not have the required permissions to view the files attached to this post.
Image
B
79
S
29
G
12
Posts: 515
Reputation: 12,584

Post » Mon Aug 04, 2014 4:23 pm

Thanks.
Image ImageImage
B
7
S
2
G
1
Posts: 93
Reputation: 1,243


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Jackriduk, kiki4construct and 33 guests