Discuss Scratch

Sup2point0
Scratcher
32 posts

New Variable Display Type: Progress Bar

Wouldn't it be cool if you could display a variable as a progress bar, rather than a number?

So far to get a good progress bar I've had to make 50 or 100 costumes, which is extremely time consuming.

All you'd have to do is set the maximum value like the slider mode, then Scratch would automatically calculate the fraction and fill up the bar.

So, for example, if you set the max. value to 100, then you set the variable to 50, it would fill up half of the bar!

This would be so useful for many different things:

-Level Progress
-Batteries?
-Timers
-Upgrades (as in xp/xp required)
-Loading Screens

And it also shouldn't be too laggy.

The only con I can think of is that it wouldn't fit in that well with Scratch.

Last edited by Sup2point0 (May 17, 2020 09:59:22)

-InsanityPlays-
Scratcher
1000+ posts

New Variable Display Type: Progress Bar

Sup2point0 wrote:

Wouldn't it be cool if you could display a variable as a progress bar, rather than a number?

So far to get a good progress bar I've had to make 50 or 100 costumes, which is extremely time consuming.

All you'd have to do is set the maximum value like the slider mode, then Scratch would automatically calculate the fraction and fill up the bar.

So, for example, if you set the max. value to 100, then you set the variable to 50, it would fill up half of the bar!

This would be so useful for many different things:

-Level Progress
And it also shouldn't be too laggy.

The only con I can think of is that it wouldn't fit in that well with Scratch.
Okay, so here's my opinion. I think this would be a good idea to add to Scratch, but not in the variables bar. Maybe there could be another block series in the Data section called Bars. Here are some ideas:
set [health v] to (100)::#f5428d
change [health v] by (-10)::#f5428d
show bar [health v]::#f5428d
hide bar [health v]::#f5428d
when bar [energy v] [< v] (10)::hat #f5428d
when bar [power v] [> v] (10)::hat #f5428d
when bar [health v] [= v] (0)::hat #f5428d
Hope this helped ya! And btw, I dunno if this is a duplicate, the Scratch Team need a better way to search for duplicates.
HighFlyer222
Scratcher
100+ posts

New Variable Display Type: Progress Bar

I think this doesn’t have a duplicate, I searched but couldn’t find anything.

I support this idea. It would be really useful for most projects, and yes, making a progress bar with 100 costumes is hard.

Addition to the post above me: a change color block as well.

If strech effect existed right now, we wouldn’t have needed this actually lol
kitten769
Scratcher
1000+ posts

New Variable Display Type: Progress Bar

No support. You can just use a variable and pen for this.

define Draw Progress Bar (length) (variable) // This script draws it
go to x: (-50) y: (0)
set pen color to [#a00000]
pen down
change x by (length)
go to x: (-50) y: (0)
set pen color to [#b6c0f4]
change x by (variable)


when green flag clicked
forever
erase all :: pen
Draw Progress Bar (length) (variable) :: custom
end
pavcato
Scratcher
1000+ posts

New Variable Display Type: Progress Bar

Semi-Support. This would make it easier to make them, but why does Scratch need them in the first place? Most waiting times are instantaneous.
Sup2point0
Scratcher
32 posts

New Variable Display Type: Progress Bar

kitten769 wrote:

No support. You can just use a variable and pen for this.

define Draw Progress Bar (length) (variable) // This script draws it
go to x: (-50) y: (0)
set pen color to [#a00000]
pen down
change x by (length)
go to x: (-50) y: (0)
set pen color to [#b6c0f4]
change x by (variable)


when green flag clicked
forever
erase all :: pen
Draw Progress Bar (length) (variable) :: custom
end

Cool script - the only problem I have with pen is, the pen is rounded at the edges, which causes some complications, and it also contributes to the clone limit (which I always struggle with in my games)
Sup2point0
Scratcher
32 posts

New Variable Display Type: Progress Bar

pavcato wrote:

Semi-Support. This would make it easier to make them, but why does Scratch need them in the first place? Most waiting times are instantaneous.

As for the loading screen, it's just a feature which I've seen loads of Scratchers use for some reason.
--Explosion--
Scratcher
1000+ posts

New Variable Display Type: Progress Bar

Support but what would the color be? Also would it show the percentage? Would it change color? How big would it be? Anyways, just a few questions to think about!
xXRedTheCoderXx
Scratcher
1000+ posts

New Variable Display Type: Progress Bar

kitten769 wrote:

No support. You can just use a variable and pen for this.

define Draw Progress Bar (length) (variable) // This script draws it
go to x: (-50) y: (0)
set pen color to [#a00000]
pen down
change x by (length)
go to x: (-50) y: (0)
set pen color to [#b6c0f4]
change x by (variable)


when green flag clicked
forever
erase all :: pen
Draw Progress Bar (length) (variable) :: custom
end
I've always tried to avoid pen in my projects, which is why I never use it when making bars. Why? Because pen is always at the last layer! I hate that!

So, that work around doesn't work for many projects.

Edit: Forgot to mention that I really like this idea. It should be added!

Last edited by xXRedTheCoderXx (May 17, 2020 16:49:35)

kitten769
Scratcher
1000+ posts

New Variable Display Type: Progress Bar

xXRedTheCoderXx wrote:

kitten769 wrote:

No support. You can just use a variable and pen for this.

define Draw Progress Bar (length) (variable) // This script draws it
go to x: (-50) y: (0)
set pen color to [#a00000]
pen down
change x by (length)
go to x: (-50) y: (0)
set pen color to [#b6c0f4]
change x by (variable)


when green flag clicked
forever
erase all :: pen
Draw Progress Bar (length) (variable) :: custom
end
I've always tried to avoid pen in my projects, which is why I never use it when making bars. Why? Because pen is always at the last layer! I hate that!

So, that work around doesn't work for many projects.

Edit: Forgot to mention that I really like this idea. It should be added!
It is still much easier.
xXRedTheCoderXx
Scratcher
1000+ posts

New Variable Display Type: Progress Bar

kitten769 wrote:

xXRedTheCoderXx wrote:

kitten769 wrote:

No support. You can just use a variable and pen for this.

define Draw Progress Bar (length) (variable) // This script draws it
go to x: (-50) y: (0)
set pen color to [#a00000]
pen down
change x by (length)
go to x: (-50) y: (0)
set pen color to [#b6c0f4]
change x by (variable)


when green flag clicked
forever
erase all :: pen
Draw Progress Bar (length) (variable) :: custom
end
I've always tried to avoid pen in my projects, which is why I never use it when making bars. Why? Because pen is always at the last layer! I hate that!

So, that work around doesn't work for many projects.

Edit: Forgot to mention that I really like this idea. It should be added!
It is still much easier.
But like I said, it doesn't work for most projects.
IlyaMiheevilia
Scratcher
4 posts

New Variable Display Type: Progress Bar

Full support! I think native progressbars will look more fancy than the pen ones.
oO0sansolo0Oo
Scratcher
5 posts

New Variable Display Type: Progress Bar

percentage mased maybe?

kitten769 wrote:

No support. You can just use a variable and pen for this.

define Draw Progress Bar (length) (variable) // This script draws it
go to x: (-50) y: (0)
set pen color to [#a00000]
pen down
change x by (length)
go to x: (-50) y: (0)
set pen color to [#b6c0f4]
change x by (variable)


when green flag clicked
forever
erase all :: pen
Draw Progress Bar (length) (variable) :: custom
end
how would you add a cap to the lengthand make the display show a percentage, im trying to make a percentage based exp system ive tried quite a few times on chnging this display ive also checked to see if i had he code right and forme it still doesnt work as you intended it

Last edited by oO0sansolo0Oo (April 16, 2021 13:50:27)

Sup2point0
Scratcher
32 posts

New Variable Display Type: Progress Bar

oO0sansolo0Oo wrote:

percentage mased maybe?

how would you add a cap to the lengthand make the display show a percentage, im trying to make a percentage based exp system ive tried quite a few times on chnging this display ive also checked to see if i had he code right and forme it still doesnt work as you intended it

set x to ((x when empty)+(((x when full) - (x when empty))*((current xp)/(xp required))))

should work
reallysoftuser
Scratcher
1000+ posts

New Variable Display Type: Progress Bar

kitten769 wrote:

No support. You can just use a variable and pen for this.

define Draw Progress Bar (length) (variable) // This script draws it
go to x: (-50) y: (0)
set pen color to [#a00000]
pen down
change x by (length)
go to x: (-50) y: (0)
set pen color to [#b6c0f4]
change x by (variable)


when green flag clicked
forever
erase all :: pen
Draw Progress Bar (length) (variable) :: custom
end
See my signature
Bacteria999
Scratcher
1000+ posts

New Variable Display Type: Progress Bar

Support, seems interesting.
oO0sansolo0Oo
Scratcher
5 posts

New Variable Display Type: Progress Bar

Sup2point0 wrote:

oO0sansolo0Oo wrote:

percentage mased maybe?

how would you add a cap to the lengthand make the display show a percentage, im trying to make a percentage based exp system ive tried quite a few times on chnging this display ive also checked to see if i had he code right and forme it still doesnt work as you intended it

set x to ((x when empty)+(((x when full) - (x when empty))*((current xp)/(xp required))))

should work
ty! ill try it out
oO0sansolo0Oo
Scratcher
5 posts

New Variable Display Type: Progress Bar

Sup2point0 wrote:

oO0sansolo0Oo wrote:

percentage mased maybe?

how would you add a cap to the lengthand make the display show a percentage, im trying to make a percentage based exp system ive tried quite a few times on chnging this display ive also checked to see if i had he code right and forme it still doesnt work as you intended it

set x to ((x when empty)+(((x when full) - (x when empty))*((current xp)/(xp required))))

should work
lol didnt work
lm1996
Scratcher
1000+ posts

New Variable Display Type: Progress Bar

kitten769 wrote:

No support. You can just use a variable and pen for this.

define Draw Progress Bar (length) (variable) // This script draws it
go to x: (-50) y: (0)
set pen color to [#a00000]
pen down
change x by (length)
go to x: (-50) y: (0)
set pen color to [#b6c0f4]
change x by (variable)


when green flag clicked
forever
erase all :: pen
Draw Progress Bar (length) (variable) :: custom
end
Tbh that's extremely complicated.
bluedragon8633
Scratcher
1000+ posts

New Variable Display Type: Progress Bar

Support! I think it should just be a display type, only you can set the color. It should be an option rather like a slider, but one that the user can't change.

Powered by DjangoBB