playMaker

Author Topic: 2d platformer background  (Read 2522 times)

Seiryu33

  • Full Member
  • ***
  • Posts: 133
2d platformer background
« on: July 29, 2017, 08:27:17 AM »
Hi! So I've seen a lot of threads about scrolling backgrounds but those seem to be the process for auto-scrolling like for infinite runner games or space shooter games. What process would be best to use for 2d platformers that moves the camera with the player? Would parallax scrolling work?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: 2d platformer background
« Reply #1 on: July 29, 2017, 03:30:48 PM »
Hi,
Many infinite runner are actually moving the background/object instead of the player.
parallax scrolling can work on both ways with a finite level just move the layer(s) that you want to go faster depending on the camera movement.

Seiryu33

  • Full Member
  • ***
  • Posts: 133
Re: 2d platformer background
« Reply #2 on: July 30, 2017, 12:50:06 AM »
The basic setup seems simple enough, but how would I handle side-scrollers with multiple levels with different backgrounds (Inside, Freedom Planet, etc)? Would I have to employ destroying the previous backgrounds?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: 2d platformer background
« Reply #3 on: July 30, 2017, 03:35:54 AM »
Hi.

You can use Scenes for each level.

You can look into using Load Scene and unload scene, using Additive.

Seiryu33

  • Full Member
  • ***
  • Posts: 133
Re: 2d platformer background
« Reply #4 on: July 30, 2017, 09:42:41 PM »
Any way to change textures in-game? Like when the player gets to the end of the level and changes the background texture?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: 2d platformer background
« Reply #5 on: July 30, 2017, 10:34:09 PM »
Hi,
if you use Sprite, you can use "swap Sprite" you can find the action on the EcoSystem

else you can use "Set Material Texture"

Seiryu33

  • Full Member
  • ***
  • Posts: 133
Re: 2d platformer background
« Reply #6 on: September 07, 2017, 10:10:45 PM »
So I had the chance to work with it and it doesn't seem to be working. My backgrounds aren't scrolling. So are there any tutorials I can use? Think I need to start at the beginning. I tried offset texture but it stays static. Any pointers or advice? I guess I should add that I want it to scroll with the player's movement.
« Last Edit: September 07, 2017, 10:15:08 PM by Seiryu33 »

Seiryu33

  • Full Member
  • ***
  • Posts: 133
Re: 2d platformer background
« Reply #7 on: September 09, 2017, 01:02:50 AM »
Think I have the basic gist of it. Not sure why it only works when applied to a mesh (only way I got it to work). Got it to scroll one direction but how do I get it scroll backwards? I don't think flipping the plane it's attached to will work. Really lost on what else to do. Any suggestions?