Paralax Scrolling

For questions about using Classic.

Post » Fri Sep 12, 2008 12:44 pm

Hi guys :)

Been working hard over the last few days on a project that I came up with while simply experimenting with some stuff... and it became a little more than an experiment in the end...

Something so simple is frustrating me though... paralax scrolling.

So far I have made a few layers and adjusted the "scroll x rate" and "scroll y rate" and it seems to work fine on layers that are "above" my character, however if I change "scroll x/y rate" on layers which are "below" my characters layer, it... messes with my character.

Understand? No neither do I...

Example of the anomolae, in a practical situation:

- We have 3 layers, Layer 1,2,and 3.

- Player character is on layer 2, and can shoot bullets from a gun.

- Layer 3 is "on top" or "above" layer 2, and has some laterns in the "foreground" which scroll past the player as they walk along, moving in front of the charater. The scroll rate is adjusted to say, 150%.

- Layer 1 is behind layer 2 and has some trees and buildings which are supposed to move behind the player. The scroll rate is 80%

- The effect works perfectly fine (visually), until the player starts shooting his gun. When the characters X coordinate and/or Y coordinate are close to 0, everything seems fine, but as the player walks further along to the right (increasing X coordinate), the bullets seem to fire from a point in front of the player instead of from the players gun... the longer you walk along the further the point moves away from the player. I am using an "action point" on my character at the end of the gun.

- As soon as the scroll rate is set back to 100% on layer 1, the problem goes away but I loose the paralax on the "back" layer

Anyone else come across this? Am I doing something wrong (I think I am!) to make this happen? I would really like to have a paralaxed background... I could handle it if the foreground stuff wasn't working right, I just wouldn't use it... but having a nice background is more important to me.

Thanks in advance guys!

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Fri Sep 12, 2008 12:56 pm

ok wow idiot... I have been trying to fix this for over an hour before I posted the question, and I figured out what was happeneing...

The "bullets" were being created on the wrong layer... DUH :oops:

OK all good, this can be locked, mocked, or lol'd at.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Fri Sep 12, 2008 12:57 pm

Try specifying which layer you're creating your bullet objects on. That sounds like the problem to me.

Edit:
Erp, how did I not see your second post? :P
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Fri Sep 12, 2008 1:35 pm

Lol posting at the same time for the win?

Cheers though, if I hadn't figured it out myself that would have done it for me ;)
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Fri Sep 12, 2008 2:16 pm

LOL'D :wink:
B
13
S
3
G
5
Posts: 286
Reputation: 3,193

Post » Thu Oct 28, 2010 4:00 am

How did you solve this? I have the same problem. I`m making a platform shooter and my bullets start spawning away of the character while it moves in X.
Please help!
B
11
S
1
G
2
Posts: 57
Reputation: 1,690


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests