Scrolling with 0 Para....

Get help using Construct 2

Post » Wed Aug 28, 2013 9:25 am

If this is answered somewhere I apologize and please point me in the right direction.

I have created a "floating" control pad that appears whenever the player touches the screen. It also moves the Sprite in the direction you touch, as it should.

The layout is a square 1024 x 1024, with a 512 x 384 Screen Size, this works perfectly on all the test devices on the XDK site.

Where i'm running into trouble is, this is used in a "Scroll To" Ghost Shooter type game. I cannot for the life of me get the controls to "stick" in one spot while the screen scrolls along the layout.

If I set the "Controls" layer (Layer with the controller in it) Parallax to 0,0 the controller will not spawn below the halfway point, ie: Player sprite begins at the bottom of the layout.

Is there a way to keep the Controller Sprite in a relative screen pos w/o fiddling with the parallax settings?

Thanks in advance.
B
12
S
2
Posts: 75
Reputation: 2,126

Post » Wed Aug 28, 2013 12:14 pm

You called too many things 'Controls' or 'Controller' when explaining so my brain collapsed. What is the issue here? Please link to a .capx so I can better understand the issue.
B
46
S
16
G
78
Posts: 2,166
Reputation: 46,349

Post » Wed Aug 28, 2013 12:33 pm



The control pad is on his own layer with parallax to 0,0.
Notice how the dashes act as a representation of the Window size (size of the project) and so you should use them as a marker to know where to place things.

The player sprite is on his own layer with a parallax of 100,100.

To help you visualize, you can set the layer's property "Parallax visible in editor" to Yes.
Kyatric2013-08-28 12:33:34
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,785

Post » Wed Aug 28, 2013 12:38 pm

@Kyatric

Yep, that's how I usually set up the scrolling with parallax stuff for my HUDs. Not sure what the issue is that he needs help with : (
B
46
S
16
G
78
Posts: 2,166
Reputation: 46,349

Post » Wed Aug 28, 2013 12:42 pm

It was where to position the control pad so that it and the player sprite displays both.

Issue should be resolved with the "drawing" in my previous post.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
292
S
115
G
96
Posts: 7,295
Reputation: 70,785

Post » Wed Aug 28, 2013 2:52 pm

@Kyatric

Capx

If you set the "Controls" layer to 0,0 parallax it will not spawn properly in the bottom half of the screen. The conrols need to be able to spawn and scroll no matter where the "Player" is on the screen, and stay in that position until the user stops touching the screen.

This is meant to be a "floating" control pad, so no matter where on the device the Player touches it will show up. I just can't get it to "anchor" in the relative location and "follow" the scroll effect. It either does not move, or with "Every Tick" it seems to "race" the Player sprite.

Thanks in advance.dooley2013-08-28 15:40:17
B
12
S
2
Posts: 75
Reputation: 2,126

Post » Wed Aug 28, 2013 3:41 pm

Use Touch.X("Controls") & Touch.Y("Controls") with parallax set to 0,0.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Wed Aug 28, 2013 4:12 pm

@blackhornet

You are a genius! Thanks so much, I figured it was something small like that.

Thanks again!
B
12
S
2
Posts: 75
Reputation: 2,126


Return to How do I....?

Who is online

Users browsing this forum: beohs, brunopalermo and 11 guests