Hopscotch (programming language): Difference between revisions

Content deleted Content added
Summarized previous section
Rewrote section to better represent current states of the app. Merged Drawing section, already present in Code blocks
Tags: references removed Visual edit
Line 25:
 
=== Code blocks ===
Code blocks are individual actions triggered upon the activation of Event blocks, activated in descending order. Code blocks fall into six categories: Abilities, Movement, Looks & Sounds, Drawing, Variables, and Controls. Abilities are containers for Code blocks, creating a function which can be duplicated and reused within a project. Movement blocks control the positioning and rotation of objects. Looks & Sounds blocks control the scale and appearance of objects, text manipulation, sound playback, and transparency of objects. Drawing blocks paint preset colors to the background layer of a project, with additional options for stroke width and [[RGB color model|RGB]]/[[HSL and HSV|HSB]] support for custom colors. Variable blocks handle data storage and modification, with support for [[String (computer science)|strings]] and numerical inputs. Control blocks provide miscellaneous functionality, such as if/else conditionals, message passing, and waiting a set amount of time.
Code blocks are the actions completed when the blocks are triggered, code blocks fall into 6 categories: abilities, movement, drawing, looks & sounds, values, and control flow. These can be dragged into and out of the scripts to modify them. Movement blocks make the character move physically on the screen. Ability blocks let one make subprogram blocks to duplicate code in a Hopscotch project. Drawing blocks make an object draw stuff. There are 2 “draw” blocks, Draw a Trail and Clear. Draw a trail that draws a trail of selected colour and width. There are [[HSB colour space|HSB]] and [[RGB]] options for colour. Width is determined by the number of [[pixels]] in that trail {{citation needed|date=March 2021}}. Looks & sound blocks change the object's looks (such as size, invisibility, and colour). Value blocks set a value to a specific number or change a value by a specific number. Finally, control flow blocks can either repeat a code multiple or infinite times or add a condition which will make the code inside it execute only if the condition is matched. There is 1 exception, the “Create a Clone” block creates a clone of the object. The clone will not execute any of the code programmed for the original object. That's the job of the “When an object is cloned” block.<!--This section needs to be completed.-->
 
=== Drawing blocks ===
Drawing blocks in Hopscotch work similar to the turtle module in [[Python (programming language)|Python]], allowing art to be coded.<ref>{{Cite web|title=Hopscotch - Make your own game. Learn to code.|url=http://www.gethopscotch.com|access-date=2016-06-20|website=Hopscotch}}</ref>
 
== Player ==