• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Parallax help! Layer_x & layer_y with instance layer?

B

Ben Ingber

Guest
Hi all

I've got a parallax set up that's working nicely. It's for a top down twin stick arena shooter. The view looks down into the arena so the lowest level is the floor.

My problem is that the floor moves as part of the parallax scroll, and I need the player/enemy objects to move along with the floor. I had hoped that I could reposition their Instance Layer as I reposition the floor Background Layer, but using an Instance Layer the layer_x command doesn't seem to do anything i.e. "layer_x([instance layer],xposition)" doesn't have any effect. The function seems to only work on background layers.

Do any of you clever people know if either -
1) I'm missing something obvious or
2) There's another way I could reposition the player/enemies to keep them in the same place relative to the movement of the floor?

I hope I've been clear, let me know if any clarification would help!

Ben
 

Smiechu

Member
You could do it by adding the scroll value to x and y of every object i.e. using 'with', but I feel it would open a Pandora's box with many unpredicted behaviours of your objects.

I think you should redesign your scrolling/paralax/camera system so the floor is a static reference for everything else.
To be honest this is the main requirement to have a nicely working paralax system - a reference.

Please also post example video / gif of what kind of effect you really talk about.
 
B

Ben Ingber

Guest
Sorry not the best video but it's a prototype that hopefully shows the issue.

I think fixing the floor in position is worth a go - I'll play with that.

 

Smiechu

Member
I think fixing the floor in position is worth a go - I'll play with that.
Yes, in this case it's definitely the best way to go, as the floor/arena level is where the action is taking place in your game, rest is just a "background".
 
B

Ben Ingber

Guest
I appreciate you taking the time to help. I'll explore this and post back if I can get it working properly.

Cheers
Ben
 
Top