MFGG Forums
  • Home
  • Members
  • Help
  • Search
MFGG Main Site MFGG Forums MFGG Developer Discussion v
« Previous 1 2 3 4 5 6 … 16 Next »
I found a tutorial for parallax scrolling, and i have code, but i have a new problem.
MFGG Forums MFGG Developer Discussion v
« Previous 1 2 3 4 5 6 … 16 Next »
I found a tutorial for parallax scrolling, and i have code, but i have a new problem.
MFGG Forums MFGG Developer Discussion v
« Previous 1 2 3 4 5 6 … 16 Next »
I found a tutorial for parallax scrolling, and i have code, but i have a new problem.
Mark All Posts Read Today's Posts

I found a tutorial for parallax scrolling, and i have code, but i have a new problem.
Videogamejunkie443
Hammer Bro
Members
#1
05-24-2021, 10:29 PM (This post was last modified: 05-24-2021, 10:49 PM by Videogamejunkie443.)
I got code for parallax scrolling from this youtube video: Game Maker Controlled Parallax Scrolling Tutorial - YouTube, but I want the backgrounds to scroll at the same speed as in SMB1 in Super Mario All-Stars. I would like somebody to modify the code to meet these conditions. here's the code:

background_x[0] = view_xview[0] * 0.6
background_x[1] = view_xview[0] * 0.4

Thank you.

(05-24-2021, 10:29 PM)dreemurr555 Wrote: I got code for parallax scrolling from this youtube video: Game Maker Controlled Parallax Scrolling Tutorial - YouTube, but I want the backgrounds to scroll at the same speed as in SMB1 in Super Mario All-Stars. I would like somebody to modify the code to meet these conditions. here's the code:

background_x[0] = view_xview[0] * 0.6
background_x[1] = view_xview[0] * 0.4

Thank you.

I think the above code is it, but I don't know.

  ↳
Simpson55
Koopa
Members
Iso Collab Contributor Sprite Comp Top 5 Minigame Comp Winner MFGG 18th Anniversary Ye Olde MFGGe Retro Game Jam Participant
#2
05-25-2021, 12:41 AM
You have to give more information about your code.
Did you define background[0] and background[1] in the room editor or in the code?
You should also make sure that both backgrounds are set to "repeated".
As for the speed, you can tweak the 0.4 and 0.6 constants until it looks about right. The lower the constant is, the faster the scrolling will be.

  ↳
Videogamejunkie443
Hammer Bro
Members
#3
05-25-2021, 10:25 AM
(05-25-2021, 12:41 AM)Simpson55 Wrote: You have to give more information about your code.
Did you define background[0] and background[1] in the room editor or in the code?
You should also make sure that both backgrounds are set to "repeated".
As for the speed, you can tweak the 0.4 and 0.6 constants until it looks about right. The lower the constant is, the faster the scrolling will be.

Okay, first things first, I'm using Hello Mario Engine for Game Maker Studio & Hello Engine 6 Fan-Made for Game Maker 8/8.1. The All-Stars Rooms have 3 backgrounds. Background 0 is the sky, Background 1 is the clouds, and Background 2 is the hills. The object I created was made to be placed in a room. This would make backgrounds 1 and 2 move. So far, everything looks good. Also, I don't think I need to worry about the backgrounds repeating, but if you still want to know, they do repeat.

  ↳
Simpson55
Koopa
Members
#4
05-25-2021, 12:04 PM
They do need to repeat!
[Image: khxp.png]
See, the background position is view_xview[0] * C, where C is a constant between 0 and 1. Thus the background's position is always to the left of the view. So if you don't enable the repetion, the background won't be visible.
By the way, I'm not familiar with Hello Engine but isn't there already an option for parallax scrolling?

  ↳
Videogamejunkie443
Hammer Bro
Members
#5
05-25-2021, 12:31 PM
(05-25-2021, 12:04 PM)Simpson55 Wrote: They do need to repeat!
[Image: khxp.png]
See, the background position is view_xview[0] * C, where C is a constant between 0 and 1. Thus the background's position is always to the left of the view. So if you don't enable the repetion, the background won't be visible.
By the way, I'm not familiar with Hello Engine but isn't there already an option for parallax scrolling?

As I said, the backgrounds repeat, so I don't need to worry. And if the engine already has a way to make the background scroll like that, I couldn't find the code that let's me do it, so I made a custom object that does just that.

  ↳
Simpson55
Koopa
Members
#6
05-25-2021, 05:09 PM
Then I guess you should take a look at the objects that control the camera and/or the background, assuming they do exist.

  ↳
Videogamejunkie443
Hammer Bro
Members
#7
05-25-2021, 06:15 PM
(05-25-2021, 05:09 PM)Simpson55 Wrote: Then I guess you should take a look at the objects that control the camera and/or the background, assuming they do exist.

GateteVerde might know what to do. And he might even know where to find the original scrolling object. I'm sorry to bring you into this, but I know you've made a Super Mario All-Stars SMB1 engine for both Game Maker 8/8.1 and Game Maker Studio 1.4 and I thought you would be able to help.

  ↳
OssieTheOstrich Away
"Gone fishing", as they say
Members
Submitter Iso Collab Contributor (2) Sprite Comp Runner-Up Sprite Comp Top 5 Drawing Comp Runner-Up Secret Santa (2) MFGG 17th Anniversary MFGG 18th Anniversary MFGG 19th Anniversary Joke Game Contest Runner Up MFGG Awards 2020 Winner
#8
05-26-2021, 03:41 AM (This post was last modified: 05-26-2021, 03:43 AM by OssieTheOstrich.)
@dreemurr555 I don't wanna sound rude, but I think you should probably ask this in the MFGG discord (if you are old enough to make a discord account though) instead of making multiple threads for your game dev issues. Since discord is real time, you'll probably get help quicker, and probably from more people.
Other socials:
Sonic Retro
NCFC
YouTube

List of projects I eventually plan to finish after the indefinite hiatus is over, assuming I don't abruptly cancel them:
[+]Spoiler
Mario's Rather Unusual Trilogy (Mario's slightly unusual Boss Rush (Completed), Mario vs. Some Unusual Foes (In development), Mario's VERY Unusual Final Frontier (In development))
Sonic's Foray into Random/Unusual Zones (spin-off of Unusual Trilogy, in development)
Angry Birds Slingshot Frenzy (In development)
Super Mario Flashback: Really Good Edition (In development)
Super Hilda DX (In only conceptual phase)

Yes, I am aware that I have about 6 or so fangame projects currently in development at the same time. And yes, I am also aware that all of this is very ambitious.
+ List of projects I'm helping out with in some small capacity during my hiatus:
[+]Spoiler
Super Mario Bros Dimensions 2 (as a spriter, only for Mario's sprites)
MFGG Community Fangame Project 3 (as a spriter)
WordGirl ReWired (as a artist)

  ↳
Spain Gate
Your local demolitionist cat!
Main Site Admin
Global Moderator Forum Admin Forum Moderator Main Site Admin Main Site Moderator Submitter Iso Collab Contributor (2) Sprite Comp Runner-Up Minigame Comp Winner (2) Minigame Comp Top 5 (3) Special Comp Winner Egg Hunter NCFC Contributor (3) Secret Santa Holiday Tree MFGG 17th Anniversary MFGG 18th Anniversary MFGG 19th Anniversary MFGG Awards 2012 Winner MFGG Awards 2013 Winner MFGG Awards 2017 Winner MFGG Awards 2018 Winner MFGG Awards 2019 Winner MFGG Awards 2023 Winner (3) MFGG Awards 2024 Winner
#9
05-26-2021, 03:59 AM
@dreemurr555 If you are still using Hello's Engine, the parallax codes should be somewhere on obj_levelmanager End Step event.
[Image: Vb8vjwW.png][Image: uIrDfRP.png][Image: Jd3PZ8y.png][Image: BvmA5Pf.png][Image: 6L4ceD0.png][Image: LAKfOPp.png][Image: 10CGjip.png][Image: gEIdmj2.png]

[Image: 8GCySLU.png]

"shy guys are wall plugs confirmed" - Vitiman on Club Saturn Ex

  ↳
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • View a Printable Version
Forum Jump:

Mario Fan Games Galaxy - Powered by MyBB | MFGG Staff | Contact Us

Linear Mode
Threaded Mode