The Daily Click ::. Forums ::. Klik Coding Help ::. Semi-Scrolling Backgrounds?
 

Post Reply  Post Oekaki 
 

Posted By Message

Silverdrake [Draconianware]



Registered
  14/08/2005
Points
  716
8th December, 2005 at 14:51:50 -

Seeing as the search feature is still (or so I think) down, I'm going to ask this. In a few games I saw some backgrounds that scrolled, but not as fast as the character you were playing as. I could use some help with this. Is this possible in TGF? I would also like an example if possible. Thanks.

 
If you must touch the dragon, just be wary. It'll bite your hand off.

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
8th December, 2005 at 14:56:27 -

This effect is called parralax scrolling.

First, make the background active object and make sure that the setting 'scroll with frame' (or something) is turned off. Then make the next events:

If player goes up: move the active object to the current y + 1. (that's one pixel down for the time that the player moves up).
If player goes down: set the y to y - 1.

The same with x. It is this simple.
Of course, the background should be pretty big, so splitting it up in more objects or tiling it would be a good way to go. Also, make sure the 'move this amount of pixels in the opposite direction' has a nice movement value, like 1 or 2 or whatever suits your game.

 
Old member (~2004-2007).

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
8th December, 2005 at 20:53:42 -

i did see an example that allows lots of small objects rather than a giant active object at the back.
It was on the sonic fangames heaquarters site.

Davince didn't mention that in TGF the foreground has to be active objects too so the background stays at the back. This is a problem with the 262 object limit.

 
.

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
9th December, 2005 at 11:51:59 -

Oh, right... This will be a problem with TGF: all backdrops will always be behind the parallax background. In MMF you could fix this by using the background system box, I think.

 
Old member (~2004-2007).

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
10th December, 2005 at 02:10:56 -

One more reason to simply upgrade to MMF I guess.

 
http://www.facebook.com/truediamondgame

Silverdrake [Draconianware]



Registered
  14/08/2005
Points
  716
21st December, 2005 at 11:31:15 -

I just did

 
If you must touch the dragon, just be wary. It'll bite your hand off.

Silveraura

God's God

Registered
  08/08/2002
Points
  6747

Game of the Week WinnerKlikCast StarAlien In Training!VIP Member360 OwnerWii OwnerSonic SpeedThe Cake is a LieComputerChristmas Tree!
I am an April Fool
21st December, 2005 at 11:44:54 -

Why do people insist on bringing up dead topics. Its not just you Silver, but I've seen a load of dead topics being brought back. After about 2 days between the last person who posted, & now... its dead.

 
http://www.facebook.com/truediamondgame

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
21st December, 2005 at 14:18:25 -

I don't have anything to complain to when the post is newer than one month and the question hasn't been answered yet... But the question HAS been answered. Go ventilate your enthousiasm in a news post on your site instead or something.

 
Old member (~2004-2007).

Flava



Registered
  30/07/2002
Points
  684

Has Donated, Thank You!Code MonkeyVIP MemberThe Cake is a LieThe Spinster
22nd December, 2005 at 04:33:15 -

This thread is hardly old :/
An old post I'd consider to be 3-6 months old - not 2 weeks.

 
This is a signature. Have this one on me.
   

Post Reply



 



Advertisement

Worth A Click