1 decade ago by fulvio
I am developing a main menu for my game.
The kind of parallax scrolling functionality I'm after occurs on the following title screen and level select screen for the following game:
https://www.youtube.com/watch?v=AVWXUb5SMvc
Notice how the background layer is parallax scrolling while you're on the main menu and the level select screen? I was wondering whether someone has had experience developing something like this with Impact?
The only way I can think of at the moment is spawning an entity with a
The only problem is that once the level reaches the end it'll stop scrolling as far as I know. I haven't tried to implement as I was hoping to give this a shot when I'm at home. It's just something that's been in my mind for a while now.
I would have to figure out a way to repeat the background once it reaches the end of the map.
Any help would be greatly appreciated in regards to implementing this the proper way.
UPDATE:
Now that I think of it, I might give something like this a go in my
UPDATE 2:
Okay, this didn't seem to yield any results. I think I may be missing some further code to get this working.
The kind of parallax scrolling functionality I'm after occurs on the following title screen and level select screen for the following game:
https://www.youtube.com/watch?v=AVWXUb5SMvc
Notice how the background layer is parallax scrolling while you're on the main menu and the level select screen? I was wondering whether someone has had experience developing something like this with Impact?
The only way I can think of at the moment is spawning an entity with a
gravityFactor
of 0
that has an acceleration on the x-axis within the init()
method?The only problem is that once the level reaches the end it'll stop scrolling as far as I know. I haven't tried to implement as I was hoping to give this a shot when I'm at home. It's just something that's been in my mind for a while now.
I would have to figure out a way to repeat the background once it reaches the end of the map.
Any help would be greatly appreciated in regards to implementing this the proper way.
UPDATE:
Now that I think of it, I might give something like this a go in my
main.js
/ update()
method:update: function () { if (this.mainmenu) { this.backgroundMaps[0].scroll.x -= 200 * ig.system.tick; } this.update(); }
UPDATE 2:
Okay, this didn't seem to yield any results. I think I may be missing some further code to get this working.