Parallax Problem

Get help using Construct 2

Post » Wed Nov 05, 2014 2:55 pm

It is a side scrolling game where the player has to drag and drop buttons to maneuver the player.

I am using a parallax layer with drag and drop buttons on it.

Whenever the button is dropped i change its layer to another layer so that it does not move with the parallax layer.

Whenever i drop the buttons, they automatically go back inside the main window size, but i want it to stay wherever they are dropped.

My window size is 1920x1080 and the layout size is 6000x1080.

How do i make them stop wherever they are dropped.

Thank You.
B
6
S
1
Posts: 34
Reputation: 695

Post » Thu Nov 06, 2014 3:52 pm

In my opinion you should look for other solutions, don't just stuck to one solution, there may be other ways.
Reason dropped item changes its position is related to layer change of course.

I have never use drag-drop feature but, did you try something like these;

You can try having a global variable for it, like when mouse over item it changes to 1 or when you drag an item it changes to 1 i don't know. And you can drag items only when that variable is 1.

Just don't change layers it will be a problem, if different layers have different parallax, items will change position whenever they change layer, they even get out of the screen, i suggest you find another solution.
B
22
S
5
G
2
Posts: 210
Reputation: 3,377

Post » Thu Nov 06, 2014 4:18 pm

piszozo wrote:In my opinion you should look for other solutions, don't just stuck to one solution, there may be other ways.
Reason dropped item changes its position is related to layer change of course.

I have never use drag-drop feature but, did you try something like these;

You can try having a global variable for it, like when mouse over item it changes to 1 or when you drag an item it changes to 1 i don't know. And you can drag items only when that variable is 1.

Just don't change layers it will be a problem, if different layers have different parallax, items will change position whenever they change layer, they even get out of the screen, i suggest you find another solution.


the reason why i am shifting the layer is because if i make it stay at the same layer it stops at its position but as the screen keeps moving, it also moves ahead because its in a parallax layer.

and the variable option you gave, is something like i am using when icon dropped, disable drag and drop for 5 seconds then destroy it and then enable drag and drop again by spawning it at a location at the parallax layer.

but my main problem is still there, i want the icon to stop dead at a place, if anyone has an idea, please help.

thank you!
Udain Tomar
Game Designer
B
6
S
1
Posts: 34
Reputation: 695

Post » Thu Nov 06, 2014 4:49 pm

When you select the buttons on the properties bar have you set them to global in the operating layer? Probably a given but still may be missed.
B
9
S
1
Posts: 56
Reputation: 576

Post » Thu Nov 06, 2014 5:20 pm

Cybergod wrote:When you select the buttons on the properties bar have you set them to global in the operating layer? Probably a given but still may be missed.


this i did not know, that i have to set it to yes, but after doing so, i still have the problem as the car moves out of the initial window size, the buttons are again teleported inside the window size, instead of stopping at the dropped place on another layer.
Udain Tomar
Game Designer
B
6
S
1
Posts: 34
Reputation: 695

Post » Thu Nov 06, 2014 5:32 pm

now i tried instead of changing the layer when the object is dropped to when the dragging is started then itself i have changed the layer and rest of the commands i have kept at the object drop event, and now it works perfectly.

thank you everyone for helping, i think the change in the global field also helped, thank you.
Udain Tomar
Game Designer
B
6
S
1
Posts: 34
Reputation: 695

Post » Thu Nov 06, 2014 10:05 pm

https://www.scirra.com/tutorials/594/bu ... terface-ui

This one here might be of some help to understand the whole thing about layers and global and such. Glad to heart you fixed the problem.
B
9
S
1
Posts: 56
Reputation: 576


Return to How do I....?

Who is online

Users browsing this forum: BadMario, istero, mr32D, mtnboy22, user5487 and 1 guest