Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » multidirectional scroll
- beesbiproduct
- Scratcher
20 posts
multidirectional scroll
I've got a spacecraft that has scrollX,Y and now the “planets” are set to always goto scrollX….. all that works but if the spacecraft's direction is say 50 and keyUp is down, how do i make the “planets” go to the spacecraft's opposit direction?
- OskarnikPL
- Scratcher
100+ posts
multidirectional scroll
Your explanation is very unclear. Either explain your problem carefully and thoroughly or show us the project.
no
- OskarnikPL
- Scratcher
100+ posts
multidirectional scroll
If you have problems with motion towards a direction set on an X - Y map, check out my project - Space Dodge - it contains a movement mechanism that might help you.
no
- beesbiproduct
- Scratcher
20 posts
multidirectional scroll
sprites planning on adding more planets later.
so if im pressing down up arrorw, I want the planets to move the other way.. that's simple, but lets say that the space ship's direction is 40 and im pressing up arrow, i want the planets to move the opposite direction of 40.. the opposite dir of the ship
so if im pressing down up arrorw, I want the planets to move the other way.. that's simple, but lets say that the space ship's direction is 40 and im pressing up arrow, i want the planets to move the opposite direction of 40.. the opposite dir of the ship
Last edited by beesbiproduct (Feb. 14, 2018 12:20:47)
- deck26
- Scratcher
1000+ posts
multidirectional scroll
ScrollX and scrollY work in the same way. They effectively are used to indicate which bit of the ‘real world’ your window is currently showing. If you're saying the planets always go to scrollX it presumably means when you ‘move right’ the planets are actually moving left in the background which means scrollX is decreasing. So for vertical movement when you ‘move up’ the sprite stays in the middle and reduces scrollY so the planets constantly goto scrollY as well.
If that doesn't help you need to share the project.
If that doesn't help you need to share the project.
- Discussion Forums
- » Help with Scripts
- » multidirectional scroll