hey Scratchers, I'm working on an update to my game, Anaba, which in the new version will use infinite scrolling techniques I've learned from the community. However, I have not found how to make certain sprites scroll along with the scrolling backgrounds. The main character always stays in the same position on the screen, while obstacles are moving towards him as the background is scrolling as well. How do I accomplish this? Here's a few notes you should know:
Main sprite never moves
There is only infinite x-scrolling (background is moving from the right to the left)
>>>Obstacles start from the far right and travel in sync with the background to the left side.
THE ONLY THING I NEED HELP WITH IS THE LAST ONE!
Thanks guys, I appreciate any consideration, help, comment, etc.
Offline
Ok, so you have your scrollx variable, I hope.
For each obstacle or enemy give them a variable called startx.
Startx will be where on the map they are.
Inside the objects forever loop you put:
set x to <(scrollx) - (startx)>This will cause obstacles to scroll with the background. For enemies you would manipulate the startx variable to change their positions.
Offline
When gf clicked Forever Set x to ((xscroll) - [whatever you want]) End When gf clicked Forever If <<(x position) < [240]> and <(x position) > [-240]>> Show Else Hide End End
Offline
itzCal wrote:
Ok thanks a lot, you both helped me out big time
N problem!
Offline