Z offset

Talk about making games.

Z offset

Postby Game A Gogo » Sun Jan 08, 2006 3:02 pm

How do you make an object move slower then the screen when the screen move, just like the background in super mario bros 2??

its ot make it look more 3-D??
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Novice » Sun Jan 08, 2006 3:08 pm

Type in parallax scroling in the forum search. BeyondTheTech made a small demo.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby Game A Gogo » Sun Jan 08, 2006 3:13 pm

thx
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Game A Gogo » Sun Jan 08, 2006 3:15 pm

I cant download it
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Game A Gogo » Sun Jan 08, 2006 3:16 pm

do you know the script to do it?? if so, please tell me
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Novice » Sun Jan 08, 2006 3:31 pm

I dont know the exact script but it goes something like
Code: Select all
bkg.x=view.x/50;

that should make the background slide slowly while you move the view, play around with it.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby Game A Gogo » Sun Jan 08, 2006 5:09 pm

thx a LOT!!!
ill try it when ill do my game
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Novice » Sun Jan 08, 2006 6:56 pm

I just tried it out and it works well. The leser number you use to divide, the slower the background seems to move.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score

Postby Game A Gogo » Sun Jan 08, 2006 7:16 pm

thx again!!
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby robin.deman » Mon Jan 09, 2006 7:34 am

What i did was make a background and make it parent to the center view.
Than i made used sprites to make a background without collision.

Doesn't really look like scrolling but might give more depth to it.
Most games on mobile phones use it to fake it a little and keep the preformance up.
User avatar
robin.deman
 
Posts: 70
Joined: Sat Nov 12, 2005 9:50 am
Location: Netherlands
Score: 0 Give a positive score

Postby Game A Gogo » Fri Jan 13, 2006 10:19 pm

that dos not seems to work, why??
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Game A Gogo » Fri Jan 13, 2006 11:36 pm

I made it work, for the code, you needed to replace "view" by:"(the name of the main actor )".
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest