Jump to content


Photo

Parallax background


  • Please log in to reply
4 replies to this topic

#1 lakko

lakko

    GMC Member

  • GMC Member
  • 74 posts
  • Version:GM:Studio

Posted 18 February 2016 - 02:32 PM

Hi, in my game i want to make a parallax background with more than 8 background, so i'm trying to make it using sprite object as background and hspeed... this is my code:

---------- obj_bkg_control ----------
CREATE

x = 0;
y = 0;
instance_create(0, 0, obj_bkg1);
.
.
.
.
instance_create(0, 0, obj_bkg9);


---------- obj_bkg1 ----------

CREATE

x = 0;
y = 0;
a = 0;
if room_index == rm_home
{hspeed = -4;}


STEP

if (a == 0) && (x >= 1)
{
instance_create(room_width, 0, instance_index);
a = 1;
}
if (x < 0-room_width)
{
instance_destroy();
}


there is a better way to made it?
  • 0

#2 galladhan

galladhan

    GMC Member

  • GMC Member
  • 64 posts
  • Version:GM:Studio

Posted 18 February 2016 - 03:08 PM

You might want to have a look at this example: http://gmc.yoyogames...howtopic=531761

 

I think it's very neat. 


  • 0

#3 lakko

lakko

    GMC Member

  • GMC Member
  • 74 posts
  • Version:GM:Studio

Posted 19 February 2016 - 05:10 PM

The download link in the tutorial is broken...someone can help me?
Thanks you
  • 0

#4 iMilchshake

iMilchshake

    GMC Member

  • GMC Member
  • 135 posts
  • Version:GM:Studio

Posted 20 February 2016 - 11:47 AM

What kind of backgrounds are you using? I got a finished parralax background with 100-Layers of stars i could share you.

 

-Tobi


  • 0

ad2e5cf943724799dd60d3970d49be19.jpg


#5 lakko

lakko

    GMC Member

  • GMC Member
  • 74 posts
  • Version:GM:Studio

Posted 29 March 2016 - 08:32 AM

Hi!
i've a parallax background with more than the 8 default background image but i don't know how to made it using sprite instead the default system.

  • 0