Pages: 1
Topic closed
i need to make a scroller where the character points towards the mouse and it scrolls in the direction of the mouse, how can i do that?
Offline
ok, here's how I do it
[blocks]
<when green flag clicked>
<forever>
<set{ old x }to( <x position>
<set{ old y }to( <y position>
<point towards( mouse pointer
<move( 5 )steps>
<change{ scroll x }by( (( <x position> <-> <{ old x }> ))
<change{ scroll y }by( (( <y position> <-> <{ old y }> ))
[/blocks] if the scrolling is going in the opposite direction, try switching the old x and x position around (in the - sign thing equation), same with the y
Last edited by deatheater (2009-10-02 23:50:07)
Offline
it works but the person moves around so much that it doesnt get a chance to scroll
Offline
nvm i fixed it i simply made a sprite that moved the equivalent amount of steps but backwards, therefore it still made it scroll properly but the sprite stayed in teh center.
Offline
oh, lol forgot the move -5 steps at the bottom of the script XD
Offline
Topic closed
Pages: 1