Discuss Scratch

nikhilscratch2008
Scratcher
37 posts

Battery detector

i think a battery detector could be a good block for scratch. Lets say we are making an os on scratch. the battery block could be used to determine if the user has to plug in their device.

any feedback? thanks

Last edited by nikhilscratch2008 (Jan. 14, 2021 20:52:23)

portalpower
Scratcher
1000+ posts

Battery detector

when green flag clicked
if <(battery::sensing) = [haha funny number]> then

broadcast [start v]

else
say [>:(]
stop [all v]
end
nikhilscratch2008
Scratcher
37 posts

Battery detector

the code you wrote above could be an example of how the battery block is used
dertermenter
Scratcher
1000+ posts

Battery detector

No support, do not think this is worth it.
nikhilscratch2008
Scratcher
37 posts

Battery detector

its ok if you do not support the idea
dertermenter
Scratcher
1000+ posts

Battery detector

nikhilscratch2008 wrote:

its ok if you do not support the idea
Sorry, cool idea but don't think it will be used.

Pro tip: Use the ‘quotes’ when replying to someone!
JackK211424
Scratcher
500+ posts

Battery detector

according to this battery detection isn't really an internet standard to have and therefore some browsers may not support it.

it is shown with this image that some odd 20% of the most common browsers dont support it. And the browsers that do have limited support (due to security n stuffs)

Last edited by JackK211424 (Jan. 14, 2021 21:54:21)

Ihatr
Scratcher
1000+ posts

Battery detector

I can't think of a valid use for battery detection
ShyGamer16
Scratcher
500+ posts

Battery detector

Ihatr wrote:

I can't think of a valid use for battery detection
Same.
thisaccountisameme
Scratcher
100+ posts

Battery detector

Ok- let me say how this could potentially be good.

So, let’s say a scratcher made a project- let’s say a platformer, they would have the ability to automatically switch to a less intensive version of the game if the device has low battery. I suppose this could work in theory, and a lot of apps use that but… is it necessary? Compbsidering most scratchers use PC, the block would not be functional, and such a small percentage of yusers (considering most “popular” stuff gets about 10k views), Such a small percentage of scratchers will be able to use such a hard to code function, it doesn’t seem worth it.

Last edited by thisaccountisameme (Jan. 14, 2021 23:15:03)

dertermenter
Scratcher
1000+ posts

Battery detector

thisaccountisameme wrote:

Ok- let me say how this could potentially be good.

So, let’s say a scratcher made a project- let’s say a platformer, they would have the ability to automatically switch to a less intensive version of the game if the device has low battery. I suppose this could work in theory, and a lot of apps use that but… is it necessary? Compbsidering most scratchers use PC, the block would not be functional, and such a small percentage of yusers (considering most “popular” stuff gets about 10k views), Such a small percentage of scratchers will be able to use such a hard to code function, it doesn’t seem worth it.

That is a good post. I agree, that, Although it could be useful, it is not worth it, and Some major platforms Don’t even have battery detection yet, meaning this block won’t even work, right?
JackK211424
Scratcher
500+ posts

Battery detector

dertermenter wrote:

thisaccountisameme wrote:

Ok- let me say how this could potentially be good.

So, let’s say a scratcher made a project- let’s say a platformer, they would have the ability to automatically switch to a less intensive version of the game if the device has low battery. I suppose this could work in theory, and a lot of apps use that but… is it necessary? Compbsidering most scratchers use PC, the block would not be functional, and such a small percentage of yusers (considering most “popular” stuff gets about 10k views), Such a small percentage of scratchers will be able to use such a hard to code function, it doesn’t seem worth it.

That is a good post. I agree, that, Although it could be useful, it is not worth it, and Some major platforms Don’t even have battery detection yet, meaning this block won’t even work, right?
two out of five of the most common browsers dont support this, and It also may be removed from more.

Though, it could be implemented into scratch link.

Last edited by JackK211424 (Jan. 15, 2021 13:55:44)

nikhilscratch2008
Scratcher
37 posts

Battery detector

agreed that the fetch battery support might drop and the block will be useless over time. Great opinions guys
IndianRuby718
Scratcher
100+ posts

Battery detector

(battery level :: sensing) 
I think this is a cool idea, and I can see this being used for OS's, but as some major browsers don't support it, it probably wouldn't work… If not for this I'd support it..

This suggestion also made me think of this:
<device charging? :: sensing> 
This would be pretty cool too in mostly the same way as a battery detector, and they would go together. I would support both of these, but neither of them are recommended or entirely supported, and could be removed from support at any time..
NotDucki_
Scratcher
1000+ posts

Battery detector

This can be easily replicated with variables, however.
if <(batterylevel) < [25]> then
broadcast [showchargedevice v]//Then, in the sprite named "AlertBattery" it would say "You might want to charge your device"
end
then for plugging it in, there would be a button that says: Charge
heres the conditions for it to show
In the battery icon
when this sprite clicked
broadcast [check v]
for the “Charge” button
when I receive [check v]
if <(batterylevel) < [25]> then
broadcast [charge v]
end
Battery Script:
repeat until <(batterylevel) < [25]>
wait (10) secs
change [batterylevel v] by (-1)
end
and
when I receive [charge v]
repeat until <(batterylevel) = [100]>
wait (10) secs
change [batterylevel v] by (1)

Last edited by NotDucki_ (Jan. 21, 2021 00:50:06)

GoogleInScratch
Scratcher
1000+ posts

Battery detector

Semi-Support for reasons in other posts
IndianRuby718
Scratcher
100+ posts

Battery detector

NotDucki_ wrote:

This can be easily replicated with variables, however.
-snip- :: sensing 
This suggestion is for detecting the device's actual battery level, not as a simulator :P
the2000
Scratcher
1000+ posts

Battery detector

No support just because I see no practical use for it (no one actually uses Scratch OSes, so I see no real reason to give them battery displays). Also yeah, compatibility and stuff.
JackK211424
Scratcher
500+ posts

Battery detector

The only way I could see this working would be connecting the battery level blocks to scratch link, that way compatibility issues are solved (mostly) and some browser blocking issues.

I dont think its worth implementing, though.
Oh also here is the compatibility chart, Not sure why I didnt post it before
Nevermind I did post it?

Im tired and confused lol

Last edited by JackK211424 (Jan. 21, 2021 02:21:36)

NotDucki_
Scratcher
1000+ posts

Battery detector

IndianRuby718 wrote:

NotDucki_ wrote:

This can be easily replicated with variables, however.
-snip- :: sensing 
This suggestion is for detecting the device's actual battery level, not as a simulator :P

nikhilscratch2008 wrote:

i think a battery detector could be a good block for scratch. Lets say we are making an os on scratch. the battery block could be used to determine if the user has to plug in their device.

any feedback? thanks
It states not about real devices, it just says device.

Powered by DjangoBB