Got an issue with scrolling (capx included)

Just started using Construct 2? Post your questions here

Post » Thu Mar 26, 2015 2:00 pm

This is a top-down game. Tha camera is supposed to center on you as you walk, and it worked just fine for the past few days that I've been working on this. A few days ago I coded in an attack that shoots a beam out in the direction you press, and it worked great! But now -- I don't know what I changed -- it's bugging out. As you walk, the point of origin that the beam starts at gets farther and farther from you, until they appear to be coming in from off-screen.
The only thing I can think of is that yesterday I changed it so that instead of being one sprite, the player character is two objects: feet/shadow and upper body/cloak. So maybe the beam is being created relative to an invisible sprite that is moving faster than me but doesn't have the camera centered on it? But even so, this problem never showed up until just a few hours ago, so that seems unlikely.

You walk with WASD and shoot with the arrow keys. Sorry, but the code is pretty cobbled together; it might be hard to find a solution just by looking at it.

capx: https://www.dropbox.com/s/s685o8d3c1pok ... .capx?dl=0
Last edited by twoshoelaces on Fri Mar 27, 2015 3:42 am, edited 1 time in total.
B
7
S
1
Posts: 15
Reputation: 355

Post » Thu Mar 26, 2015 7:53 pm

that's not a capx. Do Save As single file.
B
70
S
21
G
11
Posts: 1,032
Reputation: 11,921

Post » Fri Mar 27, 2015 3:42 am

B
7
S
1
Posts: 15
Reputation: 355

Post » Fri Mar 27, 2015 9:44 am

You're creating the bullet on the GUI layer.
B
55
S
28
G
18
Posts: 1,520
Reputation: 25,285


Return to Beginner's Questions

Who is online

Users browsing this forum: craigofhannah and 3 guests