Discuss Scratch

-yeldarbnivot-
Scratcher
25 posts

Mobile or PC detecting block in Scratch 3

SuperMarioHome wrote:

Wahsp wrote:

Some projects have mobile compatibility already. The controls are just set manually

when this sprite clicked
set [mobile? v] to [yes]

or

ask [are you using a mobile device] and wait
if <(answer)=[yes]> then
set [mobile? v] to [yes]
else
set [mobile? v] to [no]
end
...

The workaround is simple, but it would be nice to automatically tell. I guess I'm undecided on this one
mobile users can't type (does the ask block show an on-screen keyboard?)

Yes, it brings up the devise's native keyboard
anthoney1
Scratcher
2 posts

Mobile or PC detecting block in Scratch 3

when green flag clicked
if <user on mobile> then
say [mobile]
end
if <user on desktop> then
say [desktop]
end

Last edited by anthoney1 (Oct. 14, 2022 02:00:29)

BoomBlox2214
Scratcher
3 posts

Mobile or PC detecting block in Scratch 3

when green flag clicked
if <mobile?> then


broadcast [ mobiletrue v]
set [ mobile? v] to [true]

else
broadcast [ mobilefalse v]
set [ mobile? v] to [false]
end
-ErrorPurpl_157
Scratcher
100+ posts

Mobile or PC detecting block in Scratch 3

PkmnQ wrote:

DylanSearch wrote:

I think the below blocks should be included in Scratch as part of the sensing section.
<user on [mobile v]::sensing>
<user on [desktop v]::sensing>
I think these blocks could help on scratch so it is possible to create mobile friendly games that only activate certain “if” statements when on mobile.
Does anyone support it?
Semi-support. Someone could do:
if <user on [mobile v]? :: sensing> then 
say [no mobile players allowed]
else
. . .
end
But on the other hand,
if <user on [mobile v]? :: sensing> then 
mobile controls :: custom
else
normal controls :: custom
end

Everything can be abused
-ErrorPurpl_157
Scratcher
100+ posts

Mobile or PC detecting block in Scratch 3


Bring
Up
Someone’s
Post

BUSP
~what the~
man-o-valor
Scratcher
94 posts

Mobile or PC detecting block in Scratch 3

SUPPORT! it would clear up the HUD for my games SO MUCH for computer players
jlnilocalsip
New Scratcher
100+ posts

Mobile or PC detecting block in Scratch 3

support. Would make life easier for people who make these kinds of projects
sonic__fan
Scratcher
1000+ posts

Mobile or PC detecting block in Scratch 3

Semi-support, it would be useful to detect it automatically, but how would it detect it? What program would it use?
This workaround just seems better as there is no fault but the player's:

ask [Are you on mobile?] and wait
if <(answer) = [yes]> then
set [mobile v] to [yes]


else
set [mobile v] to [no]
end
48kxzh0tzz_____
Scratcher
100+ posts

Mobile or PC detecting block in Scratch 3

Tynker has this feature,and it was very useful. Support
dominic305
Scratcher
500+ posts

Mobile or PC detecting block in Scratch 3

sonic__fan wrote:

Semi-support, it would be useful to detect it automatically, but how would it detect it?
When you visit a page, your browser reports its version. For example, it would report “Google Chrome 105” or “Mobile Safari 16.1”. (It's more complex than this, but this is in simpler terms.) So the functionality is already available in all browsers that can access Scratch.
Scratchcat12562
Scratcher
100+ posts

Mobile or PC detecting block in Scratch 3

bump
DOGGYPLAYSDOORS
Scratcher
70 posts

Mobile or PC detecting block in Scratch 3

DaEpikDude wrote:

Given that 3.0 is going to support mobile fully, I don't see a reason why something like this shouldn't exist.
Some of the blocks only work with computers.
Same with some game controls.
Remember, It’s not the coding/website navagation part, It’s the controls part.
-sorry for posting old forum posts
Support for Mobile block!
+1

Last edited by DOGGYPLAYSDOORS (Oct. 20, 2023 19:09:13)

54387a
Scratcher
1000+ posts

Mobile or PC detecting block in Scratch 3

Support because Scratch won't let you detect the userAgent, thus preventing us from detecting it without this block, which doesn't exist yet. This block could help make my project less laggy by making only the mobile script or the computer script run, but not both.
cookieclickerer33
Scratcher
1000+ posts

Mobile or PC detecting block in Scratch 3

Semi support

I think it should be

<keybord available?::sensing>

Because you might have a tablet that has a built in keybord attachment (I do) or you could plug a keybord into your device via the charging port and an adapter

Similarly you could I guess have a pc that doesn’t have a keybord plugged in

Last edited by cookieclickerer33 (Oct. 20, 2023 12:47:30)

nooob1423
Scratcher
3 posts

Mobile or PC detecting block in Scratch 3

Support but a few more blocks!
“if keyboard attached?” block
<keyboard attached?>
As that would be helpful in a platformer game. It would be better because an iPad would have a keyboard sometimes. It's unlikely the scratch team will ever make this so anyone got a workaround?
These as well:
(OS)
(User Agent)
<Computer?>

Last edited by nooob1423 (April 14, 2024 16:51:36)

starlightsparker
Scratcher
1000+ posts

Mobile or PC detecting block in Scratch 3

This is a good idea but I’m conflicted on one thing. An iPad is detected as a MacBook as far as I know, so wouldn’t mistake iPad to not be mobile?
starlightsparker
Scratcher
1000+ posts

Mobile or PC detecting block in Scratch 3

nooob1423 wrote:

It's unlikely the scratch team will ever make this so anyone got a workaround?
Yes, you can do this:
ask [Are you on mobile or PC] and wait
if <(answer) = [mobile]> then
set [device v] to [mobile]
end
if <(answer) = [pc]> then
set [device v] to [PC]
end
gdfsgdfsgdfg
Scratcher
1000+ posts

Mobile or PC detecting block in Scratch 3

starlightsparker wrote:

Yes, you can do this:
ask [Are you on mobile or PC] and wait
if <(answer) = [mobile]> then
set [device v] to [mobile]
end
if <(answer) = [pc]> then
set [device v] to [PC]
end
Lying exists
starlightsparker
Scratcher
1000+ posts

Mobile or PC detecting block in Scratch 3

gdfsgdfsgdfg wrote:

starlightsparker wrote:

Yes, you can do this:
ask [Are you on mobile or PC] and wait
if <(answer) = [mobile]> then
set [device v] to [mobile]
end
if <(answer) = [pc]> then
set [device v] to [PC]
end
Lying exists
I mean that’s kind of their problem, because they’re the ones who don’t want the game to work for them lol
Blocktron12
Scratcher
6 posts

Mobile or PC detecting block in Scratch 3

I believe that adding the “mobile?” Block would prove beneficial as I myself would enjoy this new mini feature that could make one’s time on scratch far less time consuming when you have to always toggle a value.
(mobile)

Last edited by Blocktron12 (Dec. 13, 2024 22:53:14)

Powered by DjangoBB