An oddity regarding Pharalax

Get help using Construct 2

Post » Sat Jul 19, 2014 9:31 pm

Hey!
So I'm making this sidescrolling space shooter, and I have a very weird issue.

See, I want to make the background scroll automatically. I'm having a hard making said background scroll and return to its original position as it is.
But what REALLY makes me scratch my head is the fact that when I add Pharalax to the backgrounds, the bullet objects I added get lost somewhere. If I keep pressing the FIRE button, after like 6 seconds, the bullets will appear from behind the character outside the layout.

It's really strange that this happens, as it was supposed to be a very simple event or two to get this working. For some reason these bullets get disoriented or something because I activated the Pharalax (any value other than 100,100 apparently). And the bullets and the background are not even in the same layer.

Can anyone help me? This is truly bizarre. In the meantime I'll be checking out a past project in which I involved both bullets and Pharalax, but until now, I've done nothing different.

Hope someone sheds a little light on this matter.
Thanks in advance!
B
4
S
1
G
1
Posts: 19
Reputation: 515

Post » Sat Jul 19, 2014 9:57 pm

Are you sure you are not spawning your bullets on the background layer?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jul 19, 2014 10:17 pm

Dead certain. They're like 3 layers apart. :(

The layout is designed to scroll vertically, so the character faces up by default.
The problem seems to be that the bullets spawn WAY below the character when there's background with Pharalax involved.

If I remove Pharalax, then the bullets spawn normally. Clearly the issue is the Pharalax option.

EDIT:
Here's something I just tried.
I turned down Pharalax from 100,100 to 99,99, and now the bullets clearly spawn one "tile" below the character.
-
I now tried spawning it in another layer just for the heck of it, and the bullets now spawn with a 2 second delay.
-
Alright, noticed something. When I go to "Edit Z order", the bullet objects are like in a category of their own, while the rest of the objects appear in an entire different Z order list. Despite both the Bullets and most of the other objects SHARING the same layer.

--
Just gave up on having Pharalax on my sidescrolling shooter. Going to manually move the background graphics now.
B
4
S
1
G
1
Posts: 19
Reputation: 515

Post » Sat Jul 19, 2014 11:13 pm

Just post/attach your capx, there's so much that can be going on, it would be easier to check out.
Also "Parallax". No "h", it might help you in case you decide to search for the specific keyword. ^^
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,795

Post » Sun Jul 20, 2014 1:54 am

Thanks for the correction. :)

Ok, so just for the heck of it.
I'm uploading the file.

I labeled the Layer that's giving me hell as "Parallax broken". If you edit the Parallax properties, it'll screw up the characters' bullet spawning.

For some reason the layer above it somehow now manages to ignore it, but the bottom layer is still giving me trouble. And I needed at least two parallax layers. :P

Anyway, if you find anything interesting that may be conflicting with the projectiles (enemies' included) please tell me.
I'll put this project on hold for a while. And thanks!
You do not have the required permissions to view the files attached to this post.
B
4
S
1
G
1
Posts: 19
Reputation: 515

Post » Sun Jul 20, 2014 2:01 am

What are you trying to do by changing the parallax of the layer the player is on? Parallax is meant to be used to make scenery that is in front or on the back of the action move faster or slower to simulate perspective.
B
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » Sun Jul 20, 2014 2:18 am

7Soul wrote:What are you trying to do by changing the parallax of the layer the player is on? Parallax is meant to be used to make scenery that is in front or on the back of the action move faster or slower to simulate perspective.

I'm pretty sure the characters were on the MAIN layer (simply called "0"), while the parallax were assigned to the bottom layer (named Broken Parallax ).

And I keep sending the characters and the bullets to the "0" layer, while on the other hand I keep sending the backgrounds to the very last layer, to remind the program that they're supposed to be separated.

My intentions are to add in a floor later, and the space background is scrolling automatically, with reduced parallax.
The problem is when I did this, the bullets spawned below the player proportionally to how much parallax I reduced.

I keep checking the project, and "0" is still where the characters are standing, while Broken Parallax is where the Parallax should be added/reduced and it ruins the bullet spawning.
B
4
S
1
G
1
Posts: 19
Reputation: 515

Post » Sun Jul 20, 2014 2:28 am

Then in the field where the layer is aksed, don't put 0 but "0" (with the quotes).
The number alone just refers to the layer number 0, that is to say "broken parallax". Instead of 0 try a more relevant name like "Action" or something of the like and always remember that the name (string) is to be put between quotes.
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,795

Post » Tue Jul 29, 2014 6:27 pm

So I managed to somehow side-step the issue I mentioned in the op.
But now I find myself stuck, as I REALLY need the Parallax to not screw me over by not working. :(

This time I added a layer named HUD, and put it at the top of the other layers.
When the Parallax is set to 100,100, I can see the health indicators.
Say I give them 99,99: Now the health indicators are several pixels below where I put them in the editor.
By 95,95 the health indicator is on the bottom edge of the screen, and anything below 95,95 makes it disappear off thes screen from below when I run the project.

I have no idea why this happens. If I give the HUD layer a property of 0,0 it should show up and stay there.
I had this exact same problem a while back, but I got around it. There is no easy way of getting around this, I need my HUD layer to be completely static, and following the action.

Please someone tell me what I'm doing wrong, or if it's a bug with the program. :(
B
4
S
1
G
1
Posts: 19
Reputation: 515


Return to How do I....?

Who is online

Users browsing this forum: Bobbyneal100, Kin, mickclarke, tinhofiel, TRMG and 50 guests