How do I scrolling

Just started using Construct 2? Post your questions here

Post » Mon Jun 09, 2014 3:58 pm

my sprite walk to sud at nord but a backgruound is bloched.. how i do to scrolling a background?

i want move a backgrond like a movement of my sprite... if i go up a background move down...

my odea is very simple... is supermario bros game but in vertical...

some one can help me??
B
5
Posts: 32
Reputation: 289

Post » Mon Jun 09, 2014 11:57 pm

You can apply the scrollTo behaviour and it will follow your sprite.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Tue Jun 10, 2014 8:00 am

i apply scroll to at background?? and sorry.. how to follow my sprite?? in event sheet??
B
5
Posts: 32
Reputation: 289

Post » Tue Jun 10, 2014 11:55 am

You can increase the height of the background so it as big as you want your map to be. Then you add a check to your sprite that if its Sprite.Y < Windowheight / 2 for instant, then you move everything down Y by a certain amount otherwise your sprite will jump out of the screen.

So if Sprite.Y < WindowHeight / 2 (Which would mean if the sprite move above the middle of the screen)
Set Sprite.Y = Sprite.Y + <Some value>
Set background.Y = Background.Y + <Same value as above>

It would probably be easiest to just add all the objects that needs to scroll to a family. And just use that instead.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Tue Jun 10, 2014 12:08 pm

i need increase the height at infinite... isi possible?? my sprite go up.. up up.. whe lose 1 life restart to zero..
B
5
Posts: 32
Reputation: 289


Post » Fri Jun 13, 2014 9:57 am

yes this is ok but no is infinite.. i need in vertical and infinite...
B
5
Posts: 32
Reputation: 289

Post » Fri Jun 13, 2014 4:25 pm

uff i go in the tutorial but is impossible??? no have found nothing.. i think no is awesome.....
B
5
Posts: 32
Reputation: 289

Post » Mon Jun 16, 2014 8:30 am

Add 'Scroll to' behaviour in behaviours of the sprite you want to be a player character. When you do this, the player character will be always in the centre when you move it.
B
4
Posts: 21
Reputation: 242

Post » Mon Jun 16, 2014 10:05 am

ahhh ok ok i have try.. but my spryte is a ball go up and down.. and this solution mve me all screen up and down but a backgroud no is infinite..
B
5
Posts: 32
Reputation: 289

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests