hedyorg / hedy

Hedy is a gradual programming language to teach children programming. Gradual languages use different language levels, where each level adds new concepts and syntactic complexity. At the end of the Hedy level sequence, kids master a subset of syntactically valid Python.
https://www.hedy.org
European Union Public License 1.2
1.27k stars 282 forks source link

[UI idea] Adding interface button for pressed feature #3680

Open RikvanSchaick opened 1 year ago

RikvanSchaick commented 1 year ago

Adding button in interface (linked with #3678) The idea is to add a new keyword and syntax to enable the Hedy users to dynamically add buttons to the screen. The functionality of these buttons can then be programmed by the Hedy users themselves using the if a is pressed syntax that is already available for normal keypresses on the keyboard from level 5 onwards.

The new syntax will look like this:

foo is button
if foo is pressed print "Hello"

This will create an onscreen button and a variable in Hedy in which it is stored. Upon pressing it, the program will print "Hello" to the screen. Only one new keyword is necessary, namely 'button' and the syntax for variables and if statement will be reused to keep it intuitive.

This issue is for adding a button in the interface of Hedy, if a user runs a program with this syntax.

RikvanSchaick commented 1 year ago

commit https://github.com/hedyorg/hedy/commit/0c1875866dcf5831bdd1dc7285a38dfb5dee9773 in branch of https://github.com/hedyorg/hedy/issues/3678 already fixed this issue.