Need help with scenery

You must understand the Game Editor concepts, before post here.

Need help with scenery

Postby sillydraco » Sat Apr 10, 2010 11:35 pm

okay, so basically i want the background and foreground of the game (its a sidescroller :3) to move while the character walks. Ever played Yoshi's Island? just like that. like the mountains in the background moving slowly past, as well as the leaves and such in the foreground moving past a little faster. ive always loved how games do that, just because it makes it look a lot better than just an animation moving to and fro on a still environment. heres what i mean:

scalesnfuzz.com/yoshi.avi

notice as he runs to the right the mountains move slowly by like they do when you look out the window of your car. also, like when viewed from inside a moving car, the leaves and flowers move by a tad faster than you are. also, i tried setting the View to move-to > draw actor (view to draco) so the view would trail the character. it made the movement look a lot smoother but when the view caught up (as when i stop) the view shakes a lot, moving back and forth. not sure why it does that :(


also heres the zip and such, as well as a .ged file and a .exe ^^
scalesnfuzz.com/Platform.zip
Attachments
Screeny.png
Last edited by sillydraco on Sun Apr 11, 2010 1:04 am, edited 1 time in total.
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: Need help with scenery

Postby Hblade » Sat Apr 10, 2010 11:41 pm

for the background, use this code:
Code: Select all
x = view.x / 2;
y = view.y / 2;

Now the mountians will move slowly both up and down. To get them only to move slowly when going left and right, and not up, simply remove the y = view.y / 2.

For the leaves:
Code: Select all
x = view.x * 1.5;
y = view.y * 1.5;

Asuming that the leaves are stationary.

However if your leaves are moving along with the screen, blowing in the wind, but you still want the same effect, you have to do this:
Code: Select all
int tx;
int ty;
tx = x;
ty = y;
x = view.x*1.5 - tx;
y = view.y*1.5 - ty;

That part's un tested though, so lemme know if it works :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Need help with scenery

Postby sillydraco » Sun Apr 11, 2010 1:07 am

i tried a couple of things with the code, but it didnt seem to work (of course i could be doing something wrong too ^^) and then i realised i hadnt posted a link to the .ged file for the game >.> silly me! its in the first post. the mountains are one image set to infinate x, so its just one infinate row of them. i havent drawn the leaves yet, so i can work on those next.
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: Need help with scenery

Postby Hblade » Sun Apr 11, 2010 1:10 am

Gimme the ged file and I'll help you later on ^.^ But right now I'm recording tutorials on youtube.com/Tutochao :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Need help with scenery

Postby sillydraco » Sun Apr 11, 2010 2:10 am

on youtube? ill have to watch you there :D all my stuff is here ^^

http://www.scalesnfuzz.com/Platform.zip
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: Need help with scenery

Postby Hblade » Sun Apr 11, 2010 2:59 am

I'll fix ya up tomarow ^.^Actually, I'll do it now :D

Edit: I dont know what the heck's up with the "hills" actor my guess would be for you to redo the whole thing because I even made a new hills actor and called it a different name but something is preventing the code from working on the hills actor. It works on the clouds but not the hills it's weird dude I cant figure it out O.o
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Need help with scenery

Postby sillydraco » Sun Apr 11, 2010 3:51 am

aww...wait yay! erm, nope aww, them silly hills! i wonder if its because its set to infinate x? the clouds are good, theyre doin what theyre supposed to :3 ah well, ill poke them hills till they do what theyre supposed to
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: Need help with scenery

Postby Hblade » Sun Apr 11, 2010 12:19 pm

I'll make a demo later on today showing what you need to do :D But as for your hills I've even made a new hills actor called hills2, but it did the same thing O.o
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Need help with scenery

Postby Hblade » Sun Apr 11, 2010 12:38 pm

Here it is ^.^ Use the arrow keys to move the view.
Attachments
3D Effect.zip
(83.39 KiB) Downloaded 149 times
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Need help with scenery

Postby sillydraco » Sun Apr 11, 2010 8:20 pm

i did something similar so whenever i walked the hills would move too, but i ran into the problem of whenever i hit a barrier the hills would keep moving until i lifted the button :3 that looks really cool though huh? :D ive tried everything to make the hills stop when the actor stops, i tried variables, i tried if/thens, not really sure wht else to try.
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: Need help with scenery

Postby Hblade » Sun Apr 11, 2010 8:44 pm

That's easy to fix :3 On collision with the walls - DisableMove = 1; (make the DisableMove variable :3)

On keydown with the hills,
Code: Select all
if (DisableMove == 0)
{
movement code here
}

:D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Need help with scenery

Postby sillydraco » Tue Apr 13, 2010 11:41 pm

aha i got it to work :D i just made the rocks their own actor, made it so that when i collide with the rocks i stop running (and just stand still) and the hills dont do anything if my animindex is standing still (left or right).
Time for sleepy, dream of new things...new life, new reality, new wings.
Image
User avatar
sillydraco
 
Posts: 71
Joined: Fri Apr 03, 2009 7:54 am
Score: 3 Give a positive score

Re: Need help with scenery

Postby Hblade » Wed Apr 14, 2010 12:11 am

Dude exellent idea :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to Advanced Topics

Who is online

Users browsing this forum: No registered users and 1 guest