![]() |
![]() |
#1 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,902
|
Displayscroll!
So - how do I use Displayscroll to move a section of the screen right or left. I get that it offsets each time but I can't seem to workout how to undo the offset to make the section move as one. Help!
|
![]() |
![]() |
#2 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,902
|
So I worked this out. Basically, when you run your for next loop to change the values for the display scroll, you need to go to the value before the one you changed and subtract whatever you just added. This must reset the Copper to the correct place?
Code:
For loop.q=50 To 100 xpos.q(loop)+ax1 :xpos.q(loop-1)-ax1 Next So to set up three independent scrolling areas for simple non-overlapping parallax, I do this: Code:
For loop.q=50 To 100 xpos.q(loop)+ax1 :xpos.q(loop-1)-ax1 Next For loop.q=101 To 150 xpos.q(loop)+2*ax1 :xpos.q(loop-1)-2*ax1 Next For loop.q=151 To 255 xpos.q(loop)+3*ax1 :xpos.q(loop-1)-3*ax1 Next And then you just run DisplayScroll 0,&xpos.q(0),&xpos.q(0) Changing the numbers in the Displayscroll creates different effects and I have no idea why yet. I'll put together a small demo and upload it later so you can see all the code in action and play with it yourself. Seems fast! |
![]() |
![]() |
#3 |
Registered User
Join Date: Mar 2012
Location: UK
Posts: 1,902
|
P.S. Looks like I'm on my annual game program!
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Displayscroll | Coagulus | Coders. Language | 20 | 24 December 2020 09:58 |
|
|