Problem with side scrolling ship

Just started using Construct 2? Post your questions here

Post » Fri Sep 05, 2014 2:17 am

Message: martinDrew is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
Hello,

I'm following the tutorial here I'm on the Player Ship step. According to the tutorial, my ship should no longer slide off the screen once the code is entered. The issue I'm having, is that when I follow the code, the ship still slides off the screen, so I don't know if I'm perhaps doing my code wrong or not.

Here's a shot of my code:
screen.png


Any help would be appreciated. Thanks!

Andrew
You do not have the required permissions to view the files attached to this post.
B
10
S
2
Posts: 26
Reputation: 694

Post » Fri Sep 05, 2014 9:49 am

Which tutorial are following? Try this tutorial and it might help you
https://www.scirra.com/tutorials/1027/p ... -scrolling
B
255
S
39
G
15
Posts: 1,975
Reputation: 40,989

Post » Sun Sep 07, 2014 12:26 am

Hey,

Thank you for the response. sorry it took me so long to reply. I was following the "Build a Shoot-'Em-Up in Construct 2" tutorial series on gamedevs.tutsplus website. It's also on youtube. I found out after the fact that the code I posted only works if the fullscreen is set to off. I still wasn't able to get it working though. I did check out your tutorial. It's not so much setting the backgrounds to parallax that I'm having trouble with. In that tutorial I mentioned, the screens move automatically, which I was able to get working. The ship drifts out of the screen eventually, and that snippet of code I posted was supposed to fix it. It doesn't anymore, however. I need a fix that will work regardless of screen size, anyway. I don't want my game to be reliant on screen size in order to work. If anyone has a fix, or could point me in the right direction, I would appreciate it. Thank you.
B
10
S
2
Posts: 26
Reputation: 694

Post » Sun Sep 07, 2014 12:53 pm

Are you saying you don't want the Player object to fly off the screen? If so, give the Player object the ScrollTo (so the camera follows the ship) and Bound to layout behaviours. If it's another object you're just moving in the background that you want to stay on the screen at the end, you just need the Bound to layout behaviour. Apologies if I misunderstood your explanation above.
Founder of Jadelight Studio, Developer of Libertas Aedifex, regular C2 Help contributor and fan of ambient music and Star Wars.
B
12
S
4
Posts: 255
Reputation: 2,008

Post » Sun Sep 07, 2014 1:45 pm

Thanks for responding. The first part of the code I used makes my 2 backgrounds scroll, and apparently my ship as well. I already have bound to layout set, and my ship still floats off the screen if I'm not moving it. I have tried a couple tricks, but my ship keeps floating off the screen. The second half of the code (according to the tutorial) was supposed to prevent that from happening, but due to screen sizing issues no longer works.
B
10
S
2
Posts: 26
Reputation: 694

Post » Sun Sep 07, 2014 1:46 pm

I forgot to mention, adding the Scroll To behavior completely overrides my backgrounds scrolling.
B
10
S
2
Posts: 26
Reputation: 694

Post » Sun Sep 07, 2014 1:51 pm

martinDrew Which tutorial are you following? I don't understand your question. Please explain
B
255
S
39
G
15
Posts: 1,975
Reputation: 40,989

Post » Sun Sep 07, 2014 1:57 pm

Please share your .capx file if you can, it will allow easier assistance rather than us trying to guess, ;).
Founder of Jadelight Studio, Developer of Libertas Aedifex, regular C2 Help contributor and fan of ambient music and Star Wars.
B
12
S
4
Posts: 255
Reputation: 2,008

Post » Sun Sep 07, 2014 2:06 pm

Message: martinDrew is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
This is the tutorial I was following, and my capx. Hope it helps :D
You do not have the required permissions to view the files attached to this post.
B
10
S
2
Posts: 26
Reputation: 694

Post » Sun Sep 07, 2014 2:06 pm

ok so it won't let me post the url. How can I post a url without it being a "plain text" one?
B
10
S
2
Posts: 26
Reputation: 694

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest