Jump to content


Photo

Background Depth


  • Please log in to reply
6 replies to this topic

#1 jerryg7

jerryg7

    GMC Member

  • New Member
  • 11 posts

Posted 08 January 2010 - 05:03 AM

I just have two backgrounds one moves slower then the other to give the illusion of depth but i also want to add some objects in the background that are covered up by the closest background to give the illusion that the object is somewhere between the two backgrounds?
here is my code:

background_hspeed[0]=-.4
background_hspeed[1]=-.8

The object that i want the background to cover up has a depth of 10 I just dont know how to add depth to my background[1].
would appreciate the help thanks.
  • 0

#2 PlasticineGuy

PlasticineGuy

    GMC Member

  • New Member
  • 2384 posts

Posted 08 January 2010 - 05:21 AM

Check the "Foreground" box in the background's settings (in the room editor).
  • 0

#3 jerryg7

jerryg7

    GMC Member

  • New Member
  • 11 posts

Posted 08 January 2010 - 05:47 AM

Check the "Foreground" box in the background's settings (in the room editor).

I did and it puts my ship that i am controlling in between the two backgrounds when i want it in front of them.
I dont want my ship in between the backgrounds only the object that im trying to get between them.
  • 0

#4 Explicit

Explicit

    Destroyer of zeds

  • GMC Member
  • 1647 posts

Posted 08 January 2010 - 05:51 AM

this official tutorial(from yoyogames tutorials page) teaches about 3 dimensionality and parallax scrolling.
  • 0

#5 PlasticineGuy

PlasticineGuy

    GMC Member

  • New Member
  • 2384 posts

Posted 08 January 2010 - 06:00 AM

In that case, what you need is to draw the background in an object, rather than having it in the room.
  • 0

#6 njp

njp

    Panda

  • GMC Member
  • 2340 posts
  • Version:GM8

Posted 08 January 2010 - 06:05 AM

make the background an object, then you can add depth and use the background as the sprite. thats what i did for my mario game
  • 0

#7 PlasticineGuy

PlasticineGuy

    GMC Member

  • New Member
  • 2384 posts

Posted 08 January 2010 - 06:37 AM

No, bad idea. Draw the background with the object (draw_background). Using the background as the sprite will force Game Maker to do lots of unnecessary collision checking.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users