Infinite scrolling help... again!

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello,

    I've just recently revisited a game that I had some help on a while ago.

    We originally got infinite scrolling going thanks to the help of linkman2004 in this post

    I've recreated the game, with a slightly different way of controlling the car.

    But when I added the infinite scrolling code again, something went wrong.

    The wheels disappear now, and don't return. I can't figure out why at all.

    The cap is here:

    To see the scrolling, just press down to drive backwards off the edge of the screen.

    Any help is much appreciated. Keep in mind though, I am still very much a noob when it comes to this type of thing, and may just be mildly retarded


  • I think it's an object picking problem. I fixed it by offloading the object creation to a function. Here's the modified CAP showing the changes:

    Modified Infinite Scrolling

    EDIT: Just incase you've already downloaded this, you'll want to download it again. I accidentally messed something up in the first one.

  • Wow, thanks again dude.

    Very much appreciated.

    I've never used functions before, I'll have to look into how they work for future reference.

    Any clues on how to get rid of the flashing?

    It's not a huge deal, but it would be cool to have it as smooth as possible.

    If this ever actually turns into a playable game, you'll be credited as the guy who keeps saving it from "I don't know how to program" limbo

    Thanks again

  • No prob', man.

    The flashing I can't seem to fix entirely, but I've found that if you uncheck the "Center view on me" attribute for the car, and instead place an always event after the rest of your events where you scroll to the car manually, only the car will flash. I don't understand why this is, but it's less distracting than the whole screen flashing.

  • Squeemish, you should seriously consider cutting that track up into smaller tiles. With a sprite that large you're allocating space in VRAM for a 4096x4096 texture. It's taking up way too much space, especially since you're only using the top portion of it... most of that image is wasted space.

    Sure, it runs fine now, but when you start adding more graphics to your game you're going to choke your graphics card to death. Some people probably won't even be able to run your game, or they'll experience crashing due to running out of VRAM.

    My advice would be to make smaller pieces of track that you can fit together like tiles. Not only will that save a crapload of VRAM, but it'll make things easier if you want to make new levels as well, since you can build new tracks out of the same pieces. It might take some work getting your custom collision masks just right so they line up, but it'll be worth it in the long run.

    Oh, and make sure your tiles are a power of 2 square, and I wouldn't go any higher than, say, a 256x256 sized tile for a game like this.

    Anyway, good luck with your game

  • Hi Deadeye,

    I actually had it all made out of tiles at one point, and someone suggested making it one big one. Can't remember why now.

    So I still have all the tiles, I'll swap them round.

    Thanks for your help.

    And also, thanks again for the help linkman, that works a lot better.

  • I wish I knew who that person was, so I could smack them (jk )

    But really, making such large graphics is generally a bad idea. If you can create the illusion of huge backgrounds by using instances of smaller sprites, then that's the way to go. Making gigantic sprites is wasteful and unnecessary (especially for something like a repeating level design like you have).

    And in case anyone's wondering, no it's not a Construct issue, it a graphics card issue. It's a designer-not-being-smart-about-video-memory-and-performance issue

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • the reason was probably to avoid seams

    (no, wasn't me)

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