Problem with side scrolling ship

0 favourites
From the Asset Store
Build your own spaceship for your side scroller space shooter games with various components.
  • 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: [attachment=0:1id5avrt][/attachment:1id5avrt]

    Any help would be appreciated. Thanks!


  • Which tutorial are following? Try this tutorial and it might help you ... -scrolling

  • 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.

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • I forgot to mention, adding the Scroll To behavior completely overrides my backgrounds scrolling.

  • martinDrew Which tutorial are you following? I don't understand your question. Please explain

  • Please share your .capx file if you can, it will allow easier assistance rather than us trying to guess, .

  • This is the tutorial I was following, and my capx. Hope it helps

  • ok so it won't let me post the url. How can I post a url without it being a "plain text" one?

  • You need a certain level of reputation points amongst other things, see the URL posting limitations forum thread. I'll take a look at your .capx now.

  • The ship isn't flying off the screen when I test it in both Chrome and Firefox, it works fine. Which browser/platform are you previewing with, it loaded Firefox first rather than Chrome (which is my default) so I'm assuming that? Try clearing the browser cache (Ctrl + Shift + Delete) and closing the browser fully, then debugging again. I have caching issues sometimes as well.

  • martinDrew Give me little time and I will sort it for you. Okey

  • I flushed my cache, but I'm still having the same problem. Here's the updated capx with the code I was referring to. Supposedlly it's supposed to make the ship stay on screen somehow but it doesn't, so I'm basically looking for another solution to the problem, since Bound to Layout doesn't work in this instance for some reason.

    Also thanks shiva for taking a look at it. I appreciate all the help I can get.

  • Note: Deleted my post as it introduced more issues, ha ha. Will work on it a bit more. Sorry, that's what I get debugging near 1am, .

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)