Discuss Scratch

WO997
Scratcher
64 posts

Lock mouse movement

Actually I'm making a project (tanks in 3D) it has a control wasd/zqsd, arrows and space, it's a little bit hard to do what you want, so there we need mouse control with left mouse button, that would be perfect, but there is a problem - when we are going off-screen we lose control on the tank, could anyone help me? I need a block to lock mouse movement.
stickfiregames
Scratcher
1000+ posts

Lock mouse movement

Not sure whether to support, it would be useful but also really easy to abuse.

If you want to use the mouse to rotate the view, something like this might work:
ifabsofmousex>80thenchangeplayer-directionbymousex-80*mousex/absofmousex/40
It doesn't work exactly how you might want, but it is probably easier than using the keyboard.

Last edited by stickfiregames (April 26, 2015 09:46:20)

WO997
Scratcher
64 posts

Lock mouse movement

stickfiregames wrote:

Not sure whether to support, it would be useful but also really easy to abuse.

If you want to use the mouse to rotate the view, something like this might work:
ifabsofmousex>80thenchangeplayer-directionbymousex-80*mousex/absofmousex/40
It doesn't work exactly how you might want, but it is probably easier than using the keyboard.
Thanks for reply, but I need something different, just like World of Tanks control.
Birdlegs
Scratcher
1000+ posts

Lock mouse movement

I like this. Locking the mouse is a common theme for computer games and such.

lockmouseatx:y:

When the mouse is locked, it could bring up something telling you that you can unlock it with the escape key. We'd just have to have a way to keep forever loops from locking you in ^~^
PrincessPanda_test_
Scratcher
1000+ posts

Lock mouse movement

But…

Some random person wrote:

HEY, I CAN'T MOVE MY MOUSE!!!
Birdlegs
Scratcher
1000+ posts

Lock mouse movement

PrincessPanda_test_ wrote:

But…

Some random person wrote:

HEY, I CAN'T MOVE MY MOUSE!!!
Yeah, but the ESC key message would save everyone from that.
MegaApuTurkUltra
Scratcher
1000+ posts

Lock mouse movement

99999% support!

(Maybe fullscreen mode would make mouse control a bit easier?)
ChocolatePi
Scratcher
1000+ posts

Lock mouse movement

Support, only if there's something that happens like when using the ‘username’ block at the beginning. It warns you and tells you it's possible to press escape to opt out of it.
rollercoasterfan
Scratcher
1000+ posts

Lock mouse movement

ChocolatePi wrote:

Support, only if there's something that happens like when using the ‘username’ block at the beginning. It warns you and tells you it's possible to press escape to opt out of it.

Agreed. Without being able to move the mouse…

Last edited by rollercoasterfan (April 27, 2015 14:19:12)

cwrivera99
Scratcher
500+ posts

Lock mouse movement

rollercoasterfan wrote:

ChocolatePi wrote:

Support, only if there's something that happens like when using the ‘username’ block at the beginning. It warns you and tells you it's possible to press escape to opt out of it.

Agreed. Without being able to move the mouse…
Support for this. However, someone could just keep using this to lock the mouse in-
foreverlockmouseatx0y0
(Or, if you want, the block could look like this-
lockmouseatx0y0
But I prefer the first one better.)
So, instead of the “esc” key unlocking the mouse, perhaps we could add a pause function that freezes the project, and as such, unlocks the mouse. When the project is resumed, the mouse would be re-locked. The “esc” key would be used to pause the project.
griffpatch
Scratcher
100+ posts

Lock mouse movement

If scratch was to implement a mouse lock, then we don't actually need to lock the mouse at a specific position. What you want to do is simply use ‘lock mouse’ and then Scratch would hide the mouse pointer (who actually wants to see it after all once it's locked?). A call to ‘unlock mouse’ then brings it back (or escape - I agree that a message would need to be displayed on the screen, probably at all times while it's locked…?)

After this, the mouse x and mouse y would move with the mouse, but could go way out of bounds in any direction (until unlocked and then it pops back to where it was to begin with?)

That's what I would expect anyhow!
Critic2100
Scratcher
1000+ posts

Lock mouse movement

ChocolatePi wrote:

Support, only if there's something that happens like when using the ‘username’ block at the beginning. It warns you and tells you it's possible to press escape to opt out of it.
Support for this.
dude341
Scratcher
1000+ posts

Lock mouse movement

griffpatch wrote:

If scratch was to implement a mouse lock, then we don't actually need to lock the mouse at a specific position. What you want to do is simply use ‘lock mouse’ and then Scratch would hide the mouse pointer (who actually wants to see it after all once it's locked?). A call to ‘unlock mouse’ then brings it back (or escape - I agree that a message would need to be displayed on the screen, probably at all times while it's locked…?)

After this, the mouse x and mouse y would move with the mouse, but could go way out of bounds in any direction (until unlocked and then it pops back to where it was to begin with?)

That's what I would expect anyhow!
I agree. Also, hi griffpatch!
JamesOuO
Scratcher
500+ posts

Lock mouse movement

yep, variables for mouse locking would be useless.
also, if this were implemented I would like a hide mouse button.
as for the forever loop problem, it would only be able to lock the mouse when the scratch player is selected (press esc to exit, then click on player to enable mouse locking + hiding again)
PrincessPanda_test_
Scratcher
1000+ posts

Lock mouse movement

griffpatch wrote:

If scratch was to implement a mouse lock, then we don't actually need to lock the mouse at a specific position. What you want to do is simply use ‘lock mouse’ and then Scratch would hide the mouse pointer (who actually wants to see it after all once it's locked?). A call to ‘unlock mouse’ then brings it back (or escape - I agree that a message would need to be displayed on the screen, probably at all times while it's locked…?)

After this, the mouse x and mouse y would move with the mouse, but could go way out of bounds in any direction (until unlocked and then it pops back to where it was to begin with?)

That's what I would expect anyhow!
ACHIEVEMENT - Meeting a famous Scratcher on the forums.

Anyway, I agree with that.

Last edited by PrincessPanda_test_ (April 27, 2015 22:06:57)

picklehazard
Scratcher
500+ posts

Lock mouse movement

PrincessPanda_test_ wrote:

griffpatch wrote:

If scratch was to implement a mouse lock, then we don't actually need to lock the mouse at a specific position. What you want to do is simply use ‘lock mouse’ and then Scratch would hide the mouse pointer (who actually wants to see it after all once it's locked?). A call to ‘unlock mouse’ then brings it back (or escape - I agree that a message would need to be displayed on the screen, probably at all times while it's locked…?)

After this, the mouse x and mouse y would move with the mouse, but could go way out of bounds in any direction (until unlocked and then it pops back to where it was to begin with?)

That's what I would expect anyhow!
ACHIEVEMENT - Meeting a famous Scratcher on the forums.

Anyway, I agree with that.
Eh, I've Seen Him On The Forums Before. I Also Like To Randomly Search Up Forums In Which A Famous Scratcher Posting, And About Searching: That Is The Second Time In Which I Don't Talk Like This. The First Is When I Invite A Curator To A Studio.
Birdlegs
Scratcher
1000+ posts

Lock mouse movement

picklehazard wrote:

PrincessPanda_test_ wrote:

griffpatch wrote:

If scratch was to implement a mouse lock, then we don't actually need to lock the mouse at a specific position. What you want to do is simply use ‘lock mouse’ and then Scratch would hide the mouse pointer (who actually wants to see it after all once it's locked?). A call to ‘unlock mouse’ then brings it back (or escape - I agree that a message would need to be displayed on the screen, probably at all times while it's locked…?)

After this, the mouse x and mouse y would move with the mouse, but could go way out of bounds in any direction (until unlocked and then it pops back to where it was to begin with?)

That's what I would expect anyhow!
ACHIEVEMENT - Meeting a famous Scratcher on the forums.

Anyway, I agree with that.
Eh, I've Seen Him On The Forums Before. I Also Like To Randomly Search Up Forums In Which A Famous Scratcher Posting, And About Searching: That Is The Second Time In Which I Don't Talk Like This. The First Is When I Invite A Curator To A Studio.
Picklehazard, you and your lovable capitals :3
picklehazard
Scratcher
500+ posts

Lock mouse movement

JoeyTheChicken wrote:

picklehazard wrote:

PrincessPanda_test_ wrote:

griffpatch wrote:

If scratch was to implement a mouse lock, then we don't actually need to lock the mouse at a specific position. What you want to do is simply use ‘lock mouse’ and then Scratch would hide the mouse pointer (who actually wants to see it after all once it's locked?). A call to ‘unlock mouse’ then brings it back (or escape - I agree that a message would need to be displayed on the screen, probably at all times while it's locked…?)

After this, the mouse x and mouse y would move with the mouse, but could go way out of bounds in any direction (until unlocked and then it pops back to where it was to begin with?)

That's what I would expect anyhow!
ACHIEVEMENT - Meeting a famous Scratcher on the forums.

Anyway, I agree with that.
Eh, I've Seen Him On The Forums Before. I Also Like To Randomly Search Up Forums In Which A Famous Scratcher Posting, And About Searching: That Is The Second Time In Which I Don't Talk Like This. The First Is When I Invite A Curator To A Studio.
Picklehazard, you and your lovable capitals :3
Yup
MegaApuTurkUltra
Scratcher
1000+ posts

Lock mouse movement

griffpatch wrote:

If scratch was to implement a mouse lock, then we don't actually need to lock the mouse at a specific position. What you want to do is simply use ‘lock mouse’ and then Scratch would hide the mouse pointer (who actually wants to see it after all once it's locked?). A call to ‘unlock mouse’ then brings it back (or escape - I agree that a message would need to be displayed on the screen, probably at all times while it's locked…?)

After this, the mouse x and mouse y would move with the mouse, but could go way out of bounds in any direction (until unlocked and then it pops back to where it was to begin with?)

That's what I would expect anyhow!
That's actually a good idea.
WO997
Scratcher
64 posts

Lock mouse movement

griffpatch wrote:

If scratch was to implement a mouse lock, then we don't actually need to lock the mouse at a specific position. What you want to do is simply use ‘lock mouse’ and then Scratch would hide the mouse pointer (who actually wants to see it after all once it's locked?). A call to ‘unlock mouse’ then brings it back (or escape - I agree that a message would need to be displayed on the screen, probably at all times while it's locked…?)

After this, the mouse x and mouse y would move with the mouse, but could go way out of bounds in any direction (until unlocked and then it pops back to where it was to begin with?)

That's what I would expect anyhow!
That's what I need! But how could we show that Scratch Team? I am not sure if they saw this suggestion… or maybe there is a way to hack these blocks?

Powered by DjangoBB