Discuss Scratch
- Discussion Forums
 - » Collaboration
 - » Imagine2D
        
         
- Ancoder
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Imagine2D
https://scratch.mit.edu/projects/557673627/ updated with new functions
                        
                        
                    - historical_supa
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Imagine2D
look: https://scratch.mit.edu/projects/557673627/ <–turbo mode makes it 0 seconds lol
- SuperStickFigures
 - 
                            
						
						
                            Scratcher
                        
						
						 
500+ posts
Imagine2D
lollook: https://scratch.mit.edu/projects/557673627/ <–turbo mode makes it 0 seconds lol
- Ancoder
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Imagine2D
adding keybinds
                        
                            keyevent.bind("a")
print("Key 'a' was pressed")
endLast edited by Ancoder (Aug. 3, 2021 15:47:42)
- 37_Scratch
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Imagine2D
adding keybindsSomething inside me tells that we are making the D programming language…keyevent.bind("a")
print("Key 'a' was pressed")
end
keyevent.bind("a") print("Key 'a' was pressed") end
Last edited by 37_Scratch (Aug. 3, 2021 16:06:25)
- Ancoder
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Imagine2D
keybinds are completed https://scratch.mit.edu/projects/557673627/
                        
                        
                    - Ancoder
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Imagine2D
its more like luaadding keybindsSomething inside me tells that we are making the D programming language…keyevent.bind("a")
print("Key 'a' was pressed")
endkeyevent.bind("a") print("Key 'a' was pressed") end
- Ancoder
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Imagine2D
here is an example of keybinding
keybind has two params key and cooldown
loop is to listen for a key press if you want to end a script after key press do this:
                        
                        
                    keybind has two params key and cooldown
keyevent.bind("a", "1")
print("Key A was pressed")
goto("100", "100")
end
loop()keyevent.bind("a", "1")
return()
end
loop()- SunshineSparkles647
 - 
                            
						
						
                            Scratcher
                        
						
						 
500+ posts
Imagine2D
D programming languague-adding keybindsSomething inside me tells that we are making the D programming language…keyevent.bind("a")
print("Key 'a' was pressed")
endkeyevent.bind("a") print("Key 'a' was pressed") end
XD
- Ancoder
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Imagine2D
here is how to make a function
calling a function:
                        
                        
                    function("goto00")
goto("0", "0")
endcalling a function:
"goto00"()
- Ancoder
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Imagine2D
default “draw a square” program:
                        
                        
                    goto("0", "0")
pen.setcolor("#00FF00")
pen.setsize("10")
eraseall()
print("Press 'n' to draw a square!")
function("drawsquare")
pendown()
goto("100", "0")
goto("100", "100")
goto("0", "100")
goto("0", "0")
penup()
resetruntime()
return()
end
keyevent.bind("n", "1")
"drawsquare"()
end
loop()- 37_Scratch
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Imagine2D
its more like luaadding keybindsSomething inside me tells that we are making the D programming language…keyevent.bind("a")
print("Key 'a' was pressed")
endkeyevent.bind("a") print("Key 'a' was pressed") end
keyevent.bind("a") print("Key 'a' was pressed") end
Last edited by 37_Scratch (Aug. 3, 2021 18:42:40)
- InternetLizard
 - 
                            
						
						
                            Scratcher
                        
						
						 
500+ posts
Imagine2D
we are having once again the EXACT SAME PROBLEM OF TOO MANY PEOPLE DOING THE SAME THING.
                        
                        
                    - WatchAndGame
 - 
                            
						
						
                            Scratcher
                        
						
						 
500+ posts
Imagine2D
its more like luaadding keybindsSomething inside me tells that we are making the D programming language…keyevent.bind("a")
print("Key 'a' was pressed")
endkeyevent.bind("a") print("Key 'a' was pressed") endoh you’re rightkeyevent.bind("a") print("Key 'a' was pressed") end
that actually looks like python + C#
- SuperStickFigures
 - 
                            
						
						
                            Scratcher
                        
						
						 
500+ posts
Imagine2D
What did I miss?
new page pog
                        
                            new page pog
Last edited by SuperStickFigures (Aug. 3, 2021 19:57:22)
- bloctans_4
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Imagine2D
i added vars:good"pencolor" = "#00FF00"
pen.setcolor(<pencolor>)
- Marc92020
 - 
                            
						
						
                            Scratcher
                        
						
						 
1000+ posts
Imagine2D
i added vars:is this lua or js"pencolor" = "#00FF00"
pen.setcolor(<pencolor>)









