The Daily Click ::. Forums ::. Klik Coding Help ::. Scrolling Backgrounds
 

Post Reply  Post Oekaki 
 

Posted By Message

DakaSha



Registered
  21/10/2008
Points
  32
6th November, 2008 at 05:38:31 -

Is there a way to make a scrolling background without:

a) using slow ass active objects
b) making a game area (much ) larger than the window.

like if i have a background of stars that are supposed to scroll. cant i just somehow make the layer scroll the backdrop without using elaborate (and slow) tricks?

maybe make the backdrop just a tad larger than the window and make it repeat.
i could combine backdrops to give it a more 3d feeling.

like i said speed is an issue so creating 400 vector objects just wont cut it

i must be missing something here

Image Edited by the Author.

 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
6th November, 2008 at 06:23:01 -

http://www.create-games.com/download.asp?id=5595

Doesn't slow down the game. Also, the speed is modifyable.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

DakaSha



Registered
  21/10/2008
Points
  32
6th November, 2008 at 06:34:16 -

again thanks alot ^^

 
n/a

DakaSha



Registered
  21/10/2008
Points
  32
6th November, 2008 at 07:50:40 -

uhm i cant get that engine to work
i mean it doesnt work from the get go (im using mmf2 btw)

i guess i can try to figure out what the prob is but thats to much for my brain right now ^^

 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
6th November, 2008 at 10:43:18 -

Hmm.. it worked great with MMF1.5. Something must've broken when imported into MMF. I'll see if I could fix it.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
6th November, 2008 at 10:55:54 -

There ya go:
http://smuzani.googlepages.com/parallax.zip

Apparently converting it to MMF2 destroyed the stars after they were created, but didn't destroy the stars in the last loop for whatever reason. This example uses 140 objects or so for the stars, but it should be OK if you use less, just a bit uglier. Seems to run perfectly fine when I crank it up to 400 objects too.

Also, remember one thing. If you divide numbers, like (A/5), make it ((A+0.0)/5). Otherwise, MMF2 will handle it like an integer, so if you get 0.3, it'll be 0. That's just how it works. Knowing that will save you a few days of frustration

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

nim



Registered
  17/05/2002
Points
  7233
6th November, 2008 at 12:55:55 -


Originally Posted by Muz
((A+0.0)/5)



I've never thought of doing it that way before. I just write A/5.001 and it usually makes no difference. Thanks, though ^^

 
//

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2955

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
6th November, 2008 at 13:40:23 -

Why don't you use a backdrop layer and fiddle with the X/Y-offset thingie. I know it's the simplest task in MMF2 to make that star background without actives, but I don't have a copy so I don't remember how you did it.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
7th November, 2008 at 06:00:53 -


Originally Posted by Nim

Originally Posted by Muz
((A+0.0)/5)



I've never thought of doing it that way before. I just write A/5.001 and it usually makes no difference. Thanks, though ^^


Yeah, that works just as well most of the time. But the problem is it usually checks the first number if it's an integer. A/5.0 should be fine, since divisions use both numbers and it's going to convert one to the other. But there's the tiny possibility of a bug, and I don't want to spend 3 hours looking for the bug if that happens

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

DakaSha



Registered
  21/10/2008
Points
  32
7th November, 2008 at 08:06:18 -

well... i didnt use ur method but a much simpler one for testing (just 100 random stars and make them moce tot he left then reset the coordinates when they reach the end of the screen) and my frame rate went from 100 to 40

and about using the xy offset: that only seems to work if i have a large background that scrolls with an active object (like the player). thats what i mean.

cant i just have a backdrop that scrolls and wraps? i mean come on how basic is that

 
n/a
   

Post Reply



 



Advertisement

Worth A Click