0 Favourites

Suggestion for continuous scrolling

  • I know your busy guys, when the time comes that your on top of other more important things - i would appreciate if you would consider implementing a fine tunement to the way that continuos backgrounds are achieved.

    Mostly, i would like to have an object (tilebg) continuously scroll while technically being in the same position. (ie not having to leave the layout and enter again from the other side of the layout).

    I think im bad at explaining this (lack of technical linguo) - but hopefully if im not making sense this post will.

    scirra.com/forum/make-an-object-scroll-on-the-spot_topic48210.html

    Cheers guys and keep up the good work.

  • You can fake it for fullscreen backgrounds:

    http://dl.dropbox.com/u/15217362/scrollingbackground.capx

    Does that do what you need?

  • i may be wrong, but i think GenkiGenga is talking about 'defender' scrolling. where you are in a virtual world that you can loop continuously through, while remaining in the middle of the screen. they usually use minimaps to give the player reference to where they are in the 'world'.

    http://feneroz.com/25_Defender-video-game/

    am i on the right track GenkiGenga?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Wow! Ok, well i definately take back my earlier comment about continuous bg's being "involved", you did it in one small event! (might be a good addition to kyatrics sig).

    The only gripe i have with the example still is that you dont seem to be able to start the process further into the stage (ie it always has to start from the very left hand side of the layout).

    So if i wanted to use this effect on a small patch of water at the end of a long layout i would need to have it scrolling behind the scenes (hidden by layers) until that time where it reaches the water spot.

    (Heres a quick example of what i mean if not clear - I position the bg further into the layout and it still starts from the edge of the left layout). dl.dropbox.com/u/13312935/Scrollexample.capx

    In this case im lucky because the water on my current layout is primarily on the left side - so i think i might be able to make it work with your example this time.

    Thanks for the quick response Ashley! (as always!)

  • GenkiGenga,

    was it different from what i described?

    i have not looked at the capx (i'm at work). but i would be interested in being able to imulate this myself.

  • harrio , great game :) and thanks for the interest.

    I couldnt find a good example of what i meant (i searched for ages!). I am getting really close to the demo of my platformer (so i didnt really wanna post shots of it yet - So instead i put together some scenarios i think will explain what i mean very well.

    Exhibit A. "life is good".

    <img src="http://dl.dropbox.com/u/13312935/Ashleys%20example%20works%20perfectly%20for%20this%20style.png" border="0" />

    Ashleys example is perfect for this style, your bound within the confines of the starter screen. The water covers the whole bottom of the screen and you have yourself a really cheap and nice effect.

    Exhibit B. "Mixing it up".

    <img src="http://dl.dropbox.com/u/13312935/bit%20more%20complex.png" border="0" />

    Now i have an idea for a flotaing island map - i want to use this same water effect for the water on each island. Since the scrolling water has to begin its journey from the left hand side of the layout - i will need to have a layer on top to hide it (so it only shows on the islands and not in the air).

    The light blue lines represent the area that is always scrolling in the background, yet covered by the layer.

    (Keep in mind you can stop the scrolling once it has reached your destination - but always has to enter from the side of the layout). Am i correct on this? (if not then i might have made a fuss for nothing). Assuming I am right - lets continue.

    C. "Getting hectic".

    <img src="http://dl.dropbox.com/u/13312935/starting%20to%20get%20hectic.png" border="0" />

    My stage was tiny, so i expanded on it. What was supposed to be a cheap alternative to a sprite animation is now (i presume) starting to take a toll because of all the background behaviour.

    You can see where its going if i decide to make the level bigger.

    <img src="http://dl.dropbox.com/u/13312935/Small%20waterfall%20at%20end%20of%20stage.png" border="0" />

    The last example is a slight annoyance, but still relevant i feel. Lets say i have a massive stage! it takes 3 minutes to run to the end. At the end - there is a little bit of water and a waterfall. Because the scrolling has to start from the lefthand side of the layout - you catch my drift.

    Thus ends my epic post, hopefully that puts my earlier comments into perspective as well. Maybe i have overlooked something and you can actually position it further into the stage? Being able to set the scroll to up and down as well would be great. (still testing Ashleys example i suspect you are able to).

  • GenkiGenga,

    alright, this is different from what i was thinking, and what i would like to accomplish myself.

    i think mine is a little tricky technically to pull off.

    glad you found a solution for yours though. look forward to seeing the finished product.

  • harrio, Cheers mate - i cant wait myself :)

    I love working with layers, parralax etc, you can achieve some wonderful effects.

  • GenkiGenga or harrio were either of you able to fix this problem yet? It's been 2 1/2 years, so I'm hoping you did. I'm looking to do something similar in my game and this is the most relevant topic I was able to find. ...And of course there's no answer. lmao

    In my game, I have an 8x8 grid in the center of the screen, with UI components around the outside of the board, which makes it smaller than the viewport. I need to be able to wrap the sprites in each grid square as they pass through the edges of the board, to appear as a continuous line, but they can't go completely off the screen before wrapping.

    Any help would be appreciated, or if you could post a .capx of how you accomplished this, that would be awesome too.

  • Hey Name, I was happy with Ashley's solution for my purpose but I'd be happy to help you with yours. Just need to clarify the problem.

    is this the type of thing your trying to achieve? Mario passes through one side and appears on the other.

  • GenkiGenga Mario Bros. is partially what I'm looking for. I have an 8x8 grid full of sprites, which is smaller than the viewport, so, unfortunately, the Wrap behavior doesn't work, which is what Mario Bros. used.

    Right now, I have all the sprites in an entire row/column of the grid moving according to the touch swipe direction. I would like to achieve a "wrap" effect where you can see the sprite on both sides of the grid as it passes through the border of the grid. So the pixels that move off the grid on the right side, appear on the left and vice versa.

    I've tried doing: for each sprite in row swiped -> if sprite.X < grid.X -> sprite.x = sprite.width

    That doesn't work. I mean, technically it does what it says it's doing...it moves the sprite to where the width of the sprite is, but that's not what I want. lol

  • iwontnamemyself I understand now. The easiest way I can think of is to use some masking. When a sprite passes into the masking area an identical sprite is created on the other side of the grid. When completely concealed it is destroyed so it appears to be wrapping when it isn't.

    Here is a quick example.

    Hopefully your current backgrounds can accommodate this technique without too much fuss.

  • GenkiGenga I actually started working on a masked version just yesterday. lol I'm using a few rexrainbow plugins and behaviors though, so I'm not exactly sure how this will affect/alter the board array. It may turn out that I need to ditch the these add-ons and go for a plain old fashioned 2D array and then manually set the new array coordinates after the sprite has moved.

    Thank you so much for this example though!!! It's not exactly what I'm looking for cuz I need to be able to move each row/column back and forth through the grid, but this is a good start. I've have to tinker around with this example a little bit to figure out how I can use it to may advantage.

    Thanks again GenkiGenga

  • it might be possible to use a scrolling background to fool the player into thinking they are constantly moving... you should then pause this and restart once they lose a life, or whatever you want to cause this...

  • No worries. I am sure you'll pick it up quickly but feel free to send me a pm if you get stuck with it. Have fun creating!

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