hello
i am working on an project and i am stuck. how do you throw or shoot an object relative to the scrolling? i want the object to go towards where i click on the screen relative to the scrolling sprite?? so if the player sprite moves in the game the projectile will not move slower or faster it will move like in real life. currently i just moves 4 steps in the direction of the mouse and if i move back it goes slower because of the scrolling and forward it goes faster.
Please I am a rookie still in school and it is my passion please help me.
Offline
This assumes you have already made the scrolling scripts aspect.
Take the variable 'scrolling speed' and place it in the last part of the scrolling script where it multiplies 480 x (number). Put that variable into the (number) slot.
If you're trying to scroll a different way then you should probably look at this site it shows you the scrolling script that this works with. Go to http://wiki.scratch.mit.edu/wiki/Scrolling_(sprites)
when i receive [throw v] show go to [character v] repeat until <touching [ground v]?> change [scrolling speed v] by (.01)This script changes the scrollx position of the object by a certain amount so it changes its relative position even if you move. If you lower the number even more you could beat it in a race. Kinda cool I think.
when gf clicked set [gravity v] to (-.4) set [velocity v] to (0) forever if <touching [ground v]?> set [velocity v] to (0) else change [velocity v] by (gravity) change y by (velocity)I believe this should work. See my project that includes characters moving with scrolling if you want more detailed stuff on that.http://scratch.mit.edu/projects/bullelk12/2843982
Last edited by bullelk12 (2012-10-21 15:09:48)
Offline
thanks man this was helpful I however eventually late last night figured the x speed out. Now what I am struggling with Ii want the object to move towards where I click on the screen until it touches the edge or scrolling sprite?
and really thanks for the help I appreciate it!
Offline