On-screen controls moving...?

Get help using Construct 2

Post » Wed Aug 07, 2013 9:53 pm

Hi all, first time I've tried to make a game without explicitly following a tutorial, so bear with me...

Okay, I'm making a game where the player sprite can roam a large(ish) map, and the screen moves along with it. I'm trying to place an on-screen controller in the bottom right corner, and can get it to stay put by placing it on a "Hud" layer, but my problem is this: when I hit the extreme edge of the layout, the sprite stops, the background stops, but the controller sprite decides to move across the screen in the opposite direction.

Any ideas??
B
11
S
1
Posts: 40
Reputation: 485

Post » Wed Aug 07, 2013 9:56 pm

sound strange.. are you sure it is your sprite and background that stops? arnt they just moving away from your HUD?

Can you post a .capx file. would make it easier to help.

If you are doing a HUD make sure to set the parallax to 0,0 of the HUD layer
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Wed Aug 07, 2013 10:01 pm

Yeah I know, it's weird... it scrolls fine with the background UNTIL I reach the edge, and then it moves away.

Anyways, here's the capx: https://dl.dropboxusercontent.com/u/28499111/spacegame.capx
ReanimtedNerd2013-08-07 22:02:08
B
11
S
1
Posts: 40
Reputation: 485

Post » Wed Aug 07, 2013 10:20 pm

I had to delete some stuff in your capx to find out what was wrong etc. (i couldnt find the sprites you used for up down etc in the layout :-)

But this should work now.

You forgot to pin the sprites you use for controls. And you only have to pin it once, not every tick.

.capx
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Wed Aug 07, 2013 10:26 pm

Thanks! Would you mind running me through how you did it? I want to gain a bit of understanding behind the problem and fix :)
B
11
S
1
Posts: 40
Reputation: 485

Post » Wed Aug 07, 2013 10:30 pm

There is not that much to go through. Take a look at the .capx file, then you can see what i have changed compared to your .capx file.

As i said you just didnt pin your sprites for movement to your "movement" sprite background.

So you could see your nice "movement" background sprite, but the control that you have made to click on, would be in a different place on the map entirely.

Dont know if that made it more clear.
B
20
S
6
G
4
Posts: 347
Reputation: 4,451


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, MaxxMunnn, richcoz81 and 33 guests