Discuss Scratch

Dragaroth
New to Scratch
6 posts

Mouse-tracking and changing scenes

Just for a little ‘spare time’ project, I've been trying to make a kind of bare-bones shell of a game. My biggest problem at the moment, is that the script I have written to change the background based on the x-value of the controlled object will not function if there is anything to do with turning – I have had it so that left and right arrow control turning, and so that it tracks the mouse; both of these have led to the script being unresponsive – without any sort of turning script, the background change works fine, however.

I'm sure its something incredibly simple that I'm missing, but I am just perplexed, anyone got a tip? I'll happily answer any questions, if it'll help.

image link here, since site doesn't like it directly: http://i.imgur.com/hPtFwvD.jpg
ErnieParke
Scratcher
1000+ posts

Mouse-tracking and changing scenes

You can still link with this piece of code:

[url=link]What Text You Want To Show[/url]

For example:

The Scratch Website

Anyway, I think I might see the issue. Whenever you're turning, and move, you're moving odd amounts left/right, not whole amounts. So, (x position) is most likely never going to equal -220. There is a simple fix to this though. Instead of looking at the x position, try this:

(round (x position))

If the problem persists, though, just tell me. ;)

Also, hello Dragaroth and welcome to Scratch! I wish you a wonderfully good time here!

Warm welcomes,

ErnieParke

Last edited by ErnieParke (Oct. 8, 2013 22:25:49)


scubajerry
Scratcher
1000+ posts

Mouse-tracking and changing scenes

There is also a possibility that your costume is not centered, which is causing you issues when you turn. Scratch won't let the costume go totally off the screen.
Dragaroth
New to Scratch
6 posts

Mouse-tracking and changing scenes

alright, thank you both very much, soon as its not midnight and I'm not slothing up, I'll try it out (it helps if I have access to the file, as well) and report back!

and thanks for the warm welcome Ernie, I've dabbled before, but just didn't have a reason to post on the forums, hope I continue to!
Dragaroth
New to Scratch
6 posts

Mouse-tracking and changing scenes

alright, reporting in, the fix is perfect, (fairly) smooth transition to other screens, thank you VERY much Ernie!

Powered by DjangoBB