How do I get an infinite Background for doodle jump?

0 favourites
  • 13 posts
From the Asset Store
Jump on candies, collect candies and earn score!!!
  • Hi,

    I'm working on a doodle-jump clone. I have a seamless Background, which should scroll up and down depending on the players y.

    I managed to get it scrolling with the players y with the help of the "infinite-jumping"-template. But I don't know how to create a new background-instance (at the right position) whenever the Background dissapears at the bottom.

    Can anyone help me out? Thanks!!

    held

  • You can use a Tiled Background instead.. Change Image offset Y.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for your quick reply!

    I made a tiled background. But as the background don't change it's y-value, I still don't get at what point (trigger) I call which action. Can u help a bit more? Thanks!!

  • Sure, can you show me your project?

  • what information do u need? basically it's represented by the infinite-jumper template. With my wish, to implement an infinite background.

  • Ok, using the infinity jumping template I think that is easier to use 2 sprites.

    The first sprite will cover all the layout and the second one is a copy of it but outside the top of the layout, so as it goes down, the second one will cover the layout.

    Create an event to compare if the sprite is on screen and also, compare if it is outside the bottom of the layout. And use an action to move it back to the top of the layout.

    So everytime it goes out the bottom of the screen it will be placed again on top.

    Use event 9 of the template as example.. it have the same comparision, just need a different action.

  • Thanks!

    But I still don't get it :)

    I did it exactly as you described, but the sprite don't appear at the top.

    Where is my mistake?

  • You cannot use a fixed position like 0,-853 because its always changing.

    You need to set it using the Viewport position.

    Make sure that your sprite have origin image position on top to match with this event

  • Tanks for your patience. Didn't use "viewport" by now.

    Now it works ! Almost :)

    Last thing is: I get a border between the repositioned image.

    origin and size of the image seem correct.

    Any idea?

  • Im not sure why but as workaround, use 2 sprites instead of one with 2 instances.

    And try this:

  • Yeah, that's much better!

    As I still see a little white border blinking for a short time and then disappears, maybe the issue is, that it's quite a long event-sheet and it takes time to call the action?

    But I`m happy with the result.

    Thanks a lot for your time and effort! Really appreciate it!!

    held

  • You will not have this problem using Tiled Background but you need to change more things on your project to use it.

  • thanks for the hint. maybe tomorrow with a fresh brain. :)

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