How do I make a ring go through a stick visually?

Get help using Construct 2

Post » Fri Feb 20, 2015 1:25 pm

So I am making this game and I am spawning rings randomly on top of the screen, which they then fall down onto a stick. I have the win/loose mechanics figured out, but the ring is on the top most layer so when it lands on a stick it looks bad as it just goes above it. So I split the same ring into two parts a top and bottom, so that when it did fall onto the stick the top of the ring would be on top of the stick and the bottom part of the ring would be behind the stick making the visual affect that the ring fell through the stick. I cant figure out how to make those two sprites be on different layers, but still have them in containers so that they would be randomly spawned together. I will attach what I have, and I have been experimenting on "GameInfinity", and the "GameSpeed" is what I had initially. If you play the "GameInfinity" you will see that the rings do go through the stick, but only randomly as in sometimes they do and sometimes they dont, and I think thats because of the "containers", but I have no other idea of solving this issue. I tried using pinning, but for the life of me I cant get it to work.

Thank you for your help.
You do not have the required permissions to view the files attached to this post.
B
6
Posts: 24
Reputation: 302

Post » Fri Feb 20, 2015 2:03 pm

I think to have a solution but i'm not at home, I'll try it in 4 hours :)
B
11
S
3
G
1
Posts: 91
Reputation: 997

Post » Fri Feb 20, 2015 2:13 pm

You don't need separate layers. On the ring's creation you can set up an action to move the z-order of the bottom of the ring to just under the stick, and set the z order of the top of the ring to just above the stick.
B
14
S
5
G
1
Posts: 189
Reputation: 1,536

Post » Fri Feb 20, 2015 3:27 pm

Okay thanks BouncyTrip.

Bladedpenguin- See if I do that both of the top and the bottom part of the ring goes to that layer as i have them in the "container" option. Without the container option they dont spawn together when the command is run, but rather 1 spawns and then the other.
B
6
Posts: 24
Reputation: 302

Post » Fri Feb 20, 2015 5:32 pm

Woah! It is harder than I imagined! I'm sorry to tell you I have tried to fix that, but i needed to stop because i must go to work now...
Anyway I saw your project is in 1920x1080 but it is for mobile. You should set it to 540x960 for some reasons:

-Smartphone screens have high dpi values and that lets you create small images with an unexpected HD effect
-Handling too many big images could lead to low performance
-You greatly reduce Download size

I suggest to use 480x800 because if you scale it in "scale outer" mode it will fit any screen out there.

*Tomorrow I'll retry to fix those rings in case you 'll still need help :)
Last edited by BouncyTrip on Fri Feb 20, 2015 5:44 pm, edited 1 time in total.
B
11
S
3
G
1
Posts: 91
Reputation: 997

Post » Fri Feb 20, 2015 5:42 pm

Meanwhile you could try this:

1) Remove any container

2) Use RingTop as bullet, and just use RingBottom as a piece of Ringtop.

3) Just after ringtop is created on "layerTop", add these actions:

-|Ringtop| Spawn object Ringbottom on layer "layerbottom" at imagepoint 0
-Pin ringbottom to ringtop
B
11
S
3
G
1
Posts: 91
Reputation: 997

Post » Fri Feb 20, 2015 6:18 pm

Thanks man I will try and see what I can work out, as I am a total beginner at this :P. As for resolution size I dont understand how it better to up scale, wont things look blurry? And how will my object as in the stick still be kept alligned to the overall size?
B
6
Posts: 24
Reputation: 302

Post » Fri Feb 20, 2015 6:21 pm

When you create an object from a family it creates a random one so half the time it's creating RingTop on the bottom layer.

Change the 'Create object' event to spawn a RingBottom on layer 1 (or a RingTop on layer 3).
B
55
S
28
G
18
Posts: 1,520
Reputation: 25,285

Post » Fri Feb 20, 2015 6:50 pm

Thanks, but I just tried this and I am unsure on where to put "RingTop spawn RingBottom on Layer 1" or if I am even doing it correctly. But then this bug occurs that the rings just get stuck on the top of the screen or if I tweak the code they are only visible from the bottom half of the screen, and also if they are not in containers just the bottom half of the ring is shown.

I basically just need two sprites connected together, but are on different layers or on different Z order. And I know the pin tool would be the most logical solution for this problem, but I still cant get it to work after watching youtube videos or reading solutions on the forums.
B
6
Posts: 24
Reputation: 302

Post » Fri Feb 20, 2015 6:52 pm

I meant create not spawn. Just change the object in your create event from RingS to RingBottom.
B
55
S
28
G
18
Posts: 1,520
Reputation: 25,285

Next

Return to How do I....?

Who is online

Users browsing this forum: oddreal and 8 guests