new block ideas
-
I have some new block ideas:
- Name of widget last clicked
This will return the name of the widget that you last clicked. This would be useful for like if(name of widget last clicked = coinsBtn) then increase coins by 5, for say, a clicker game or something. - Weather blocks. The Scratch weather extension located here: https://khanning.github.io/scratch-weather-extension/ might be useful, and easy to add. It allows you to get the temperature, humidity, etc. of certain places.
- Changing the cursor appearance. While widgets already gives you the pointer cursor when you hover over a button so you know it’s a button, it would also be useful to have this feature for sprites, so when you hover over a sprite that is (supposed to be) a button, your cursor will change to the pointer ().
- Getting device battery information. It is actually possible I believe to get the user’s device battery percentage because there is a Battery object or something in JavaScript that you could just make a block retrieve, and would return something like 85%.
getting battery is easy, here’s some code that will get your current battery percent and output it to the console:
navigator.getBattery().then(function(battery) { var level = battery.level; console.log(level); });
This would be useful if say, you want to try to check if the battery is 10% or under and then preserve the user’s battery by limiting or outright disabling a feature in your project.
- play sound from URL.
this would play a horse noise - Make costume from URL:
that URL is the Creaticode logo, and it will make it a costume named “costume1”
- Name of widget last clicked
-
@lillian159174-255f4598 Amen, brother. Amen.
-
Thank you for these interesting suggestions. Please see our comments below:
@jeffreyrb03-gmail said in new block ideas:
I have some new block ideas:
- Name of widget last clicked
This will return the name of the widget that you last clicked. This would be useful for like if(name of widget last clicked = coinsBtn) then increase coins by 5, for say, a clicker game or something.
This is already supported using the following code:
- Weather blocks. The Scratch weather extension located here: https://khanning.github.io/scratch-weather-extension/ might be useful, and easy to add. It allows you to get the temperature, humidity, etc. of certain places.
We can add blocks for getting weather data.
- Changing the cursor appearance. While widgets already gives you the pointer cursor when you hover over a button so you know it’s a button, it would also be useful to have this feature for sprites, so when you hover over a sprite that is (supposed to be) a button, your cursor will change to the pointer ().
This needs to be discussed further. How do we tell the system whether a sprite is meant to be a button? Maybe a new block like this: set cursor type [default/pointer/text/wait/not-allowed]
- Getting device battery information. It is actually possible I believe to get the user’s device battery percentage because there is a Battery object or something in JavaScript that you could just make a block retrieve, and would return something like 85%.
getting battery is easy, here’s some code that will get your current battery percent and output it to the console:
navigator.getBattery().then(function(battery) { var level = battery.level; console.log(level); });
This would be useful if say, you want to try to check if the battery is 10% or under and then preserve the user’s battery by limiting or outright disabling a feature in your project.
We can look into adding blocks to get device info.
- play sound from URL.
this would play a horse noise
Yes we can add a block like this.
- Make costume from URL:
that URL is the Creaticode logo, and it will make it a costume named “costume1”
Do you mean adding a new costume dynamically in the program? Usually costumes are added manually before the program runs. What would be a good use case for this new block?
- Name of widget last clicked
-
@info-creaticode I am actually not sure how the last one would be useful, but I thought it would be possible because of how there’s stuff like the AI DallE thing that makes a costume.
For the cursor, I mean like a block that will just change the cursor, and it could be used to add more interactivity/clarity. Ex how it would be used:
when green flag clicked,
forever {
if(mouse pointer is touching sprite1) {
change cursor to (pointer)
}
else {
change cursor to (normal)
}}
edit: the cursor block would also need to support these:
edit2: implementing custom cursor functionality doesn't require super complicated JavaScript, just some CSS rules that you could also implement with JavaScript. Example:Hover over mewhen you hover over those you get a loading cursor
Hover over me
Hover over me -
We will add these requests to our queue since they are not urgent.
-
@info-creaticode Thank you
-
@info-creaticode Also, how would I be able to become a developer for CreatiCode or sort of work for CreatiCode? I have become more familiar with the values of CreatiCode recently and have improved, like how I struggled with understanding how the site is K-12 (and things have to be sort of kept G-PG rated) a month or two ago, but now I’m better with that.
I’m 14 and I don’t want any money I just want to help the platform and add more blocks. Are there any requirements?
-
Thanks for the kind offer. It is not easy to open up our code base for external contribution at this point. If you are looking for something challenging to do, it would be very helpful to us and to our user community if you can create more interesting projects that demonstrate the potential of our rich set of blocks, especially the AI, 3D, widgets, 2D physics engine and cloud blocks.
-
@info-creaticode Got it, I have some big ideas that I plan on doing, thank you!
-
@info-creaticode
Tbh I think I’d be a great moderator of the forums lol
Not asking to be one, just saying -
We can look into adding blocks to get device info.
don’t allow It to get things like device name, storage, and even passwords, as they can be abused.
-
@luna dont worry, browsers dont allow js to access your personal files without asking you, and there isnt any vulnerabilities in using web APIs to retrieve some device info like battery percentage or something.
I doubt they are going to add blocks and features for cookies and/or local storage (small website data like logins) access tho because that can actually take your CreatiCode password, unless they put measures in place to prevent reading certain keys/cookies.
-
@luna
-
With regard to the “play sound from URL” block, you can actually use the youtube block instead. You just need to set its width and height to 0.
You can find almost every possible sound or background music you want on Youtube. For example, there are at least 50 videos for horse noise.
-
@info-creaticode
Could you make this work for non-3D projects, too? Downloading audio from another website is sketchy enough, but for YouTube? It’s too malicious.Best regards,
Luna.
i forgot I had a signature. -
@luna
The widget blocks work in both 2D and 3D projects. There are good and bad videos on Youtube. If anyone uses bad content from Youtube, we will delete the project and ban the author.
-
@info-creaticode
Oh I didn’t realize it was a widget. Whoops, sorry! -
@info-creaticode I like the solution! Thanks! Also, for the YouTube widget, are songs with curse words allowed? Could I make a disclaimer that the project’s music contains curse words? What exactly is the limit for the number of or severity, because for instance, Mockingbird by Eminem contains just one bad word but the song is beautiful so it’d be a shame if it couldn’t be used. I also am not a fan of song censorship so I don’t really feel like or want to put radio edit versions.
-
@jeffreyrb03-gmail
No.
That’s why I download them, so I can easily censor rather than get banned. -
Please, no bad words. If you are in doubt, then don’t do it. Be creative and find an appropriate alternative.
-
@info-creaticode Got it
-
For convenience and consistency could there be a say text with color effects but no time limit? Instead of just
Say/think () for () seconds text size () background () edge
There could also be
Say/think () text size () background () edge ()
-
We don’t want to add too many blocks, which can be daunting for new learners. In this case, you can set the number of seconds to a large number, right?
-
@info-creaticode the one time I wanted to do it was when I had a lot of clones that were moving around (basically battling) and I wanted to see some stats, but the say/think bubbles were a bit big and blocked other ones, I tried the timed ones but ended up begrudgingly not displaying it since I didn’t think about using a second forever loop, it could be fine not existing since it’s a minor thing but I thought I would mention it