@@ -570,6 +570,298 @@ const navigationTestBlocks = {
570
570
} ,
571
571
} ;
572
572
573
+ const moveTestBlocks = {
574
+ 'blocks' : {
575
+ 'languageVersion' : 0 ,
576
+ 'blocks' : [
577
+ {
578
+ 'type' : 'p5_setup' ,
579
+ 'id' : 'p5_setup_1' ,
580
+ 'x' : 0 ,
581
+ 'y' : 75 ,
582
+ 'deletable' : false ,
583
+ 'inputs' : {
584
+ 'STATEMENTS' : {
585
+ 'block' : {
586
+ 'type' : 'p5_canvas' ,
587
+ 'id' : 'p5_canvas_1' ,
588
+ 'deletable' : false ,
589
+ 'movable' : false ,
590
+ 'fields' : {
591
+ 'WIDTH' : 400 ,
592
+ 'HEIGHT' : 400 ,
593
+ } ,
594
+ } ,
595
+ } ,
596
+ } ,
597
+ } ,
598
+ {
599
+ 'type' : 'p5_draw' ,
600
+ 'id' : 'p5_draw_1' ,
601
+ 'x' : 0 ,
602
+ 'y' : 332 ,
603
+ 'deletable' : false ,
604
+ 'inputs' : {
605
+ 'STATEMENTS' : {
606
+ 'block' : {
607
+ 'type' : 'controls_if' ,
608
+ 'id' : 'statement_1' ,
609
+ 'inputs' : {
610
+ 'IF0' : {
611
+ 'block' : {
612
+ 'type' : 'logic_operation' ,
613
+ 'id' : 'value_1' ,
614
+ 'fields' : {
615
+ 'OP' : 'AND' ,
616
+ } ,
617
+ 'inputs' : {
618
+ 'A' : {
619
+ 'block' : {
620
+ 'type' : 'logic_boolean' ,
621
+ 'id' : 'value_1_1' ,
622
+ 'fields' : {
623
+ 'BOOL' : 'TRUE' ,
624
+ } ,
625
+ } ,
626
+ } ,
627
+ 'B' : {
628
+ 'block' : {
629
+ 'type' : 'logic_boolean' ,
630
+ 'id' : 'value_1_2' ,
631
+ 'fields' : {
632
+ 'BOOL' : 'TRUE' ,
633
+ } ,
634
+ } ,
635
+ } ,
636
+ } ,
637
+ } ,
638
+ } ,
639
+ } ,
640
+ 'next' : {
641
+ 'block' : {
642
+ 'type' : 'controls_if' ,
643
+ 'id' : 'statement_2' ,
644
+ 'inputs' : {
645
+ 'IF0' : {
646
+ 'block' : {
647
+ 'type' : 'logic_negate' ,
648
+ 'id' : 'value_2' ,
649
+ 'inputs' : {
650
+ 'BOOL' : {
651
+ 'block' : {
652
+ 'type' : 'logic_boolean' ,
653
+ 'id' : 'value_2_1' ,
654
+ 'fields' : {
655
+ 'BOOL' : 'TRUE' ,
656
+ } ,
657
+ } ,
658
+ } ,
659
+ } ,
660
+ } ,
661
+ } ,
662
+ } ,
663
+ 'next' : {
664
+ 'block' : {
665
+ 'type' : 'controls_repeat_ext' ,
666
+ 'id' : 'statement_3' ,
667
+ 'inputs' : {
668
+ 'TIMES' : {
669
+ 'shadow' : {
670
+ 'type' : 'math_number' ,
671
+ 'id' : 'shadow_3' ,
672
+ 'fields' : {
673
+ 'NUM' : 10 ,
674
+ } ,
675
+ } ,
676
+ 'block' : {
677
+ 'type' : 'math_arithmetic' ,
678
+ 'id' : 'value_3' ,
679
+ 'fields' : {
680
+ 'OP' : 'ADD' ,
681
+ } ,
682
+ 'inputs' : {
683
+ 'A' : {
684
+ 'shadow' : {
685
+ 'type' : 'math_number' ,
686
+ 'id' : 'shadow_3_1' ,
687
+ 'fields' : {
688
+ 'NUM' : 1 ,
689
+ } ,
690
+ } ,
691
+ 'block' : {
692
+ 'type' : 'math_number' ,
693
+ 'id' : 'value_3_1' ,
694
+ 'fields' : {
695
+ 'NUM' : 0 ,
696
+ } ,
697
+ } ,
698
+ } ,
699
+ 'B' : {
700
+ 'shadow' : {
701
+ 'type' : 'math_number' ,
702
+ 'id' : 'shadow_3_2' ,
703
+ 'fields' : {
704
+ 'NUM' : 1 ,
705
+ } ,
706
+ } ,
707
+ 'block' : {
708
+ 'type' : 'math_number' ,
709
+ 'id' : 'value_3_2' ,
710
+ 'fields' : {
711
+ 'NUM' : 0 ,
712
+ } ,
713
+ } ,
714
+ } ,
715
+ } ,
716
+ } ,
717
+ } ,
718
+ } ,
719
+ 'next' : {
720
+ 'block' : {
721
+ 'type' : 'controls_repeat_ext' ,
722
+ 'id' : 'statement_4' ,
723
+ 'inputs' : {
724
+ 'TIMES' : {
725
+ 'shadow' : {
726
+ 'type' : 'math_number' ,
727
+ 'id' : 'shadow_4' ,
728
+ 'fields' : {
729
+ 'NUM' : 10 ,
730
+ } ,
731
+ } ,
732
+ 'block' : {
733
+ 'type' : 'math_trig' ,
734
+ 'id' : 'value_4' ,
735
+ 'fields' : {
736
+ 'OP' : 'SIN' ,
737
+ } ,
738
+ 'inputs' : {
739
+ 'NUM' : {
740
+ 'shadow' : {
741
+ 'type' : 'math_number' ,
742
+ 'id' : 'shadow_4_1' ,
743
+ 'fields' : {
744
+ 'NUM' : 45 ,
745
+ } ,
746
+ } ,
747
+ 'block' : {
748
+ 'type' : 'math_number' ,
749
+ 'id' : 'value_4_1' ,
750
+ 'fields' : {
751
+ 'NUM' : 180 ,
752
+ } ,
753
+ } ,
754
+ } ,
755
+ } ,
756
+ } ,
757
+ } ,
758
+ } ,
759
+ 'next' : {
760
+ 'block' : {
761
+ 'type' : 'text_print' ,
762
+ 'id' : 'statement_5' ,
763
+ 'inputs' : {
764
+ 'TEXT' : {
765
+ 'shadow' : {
766
+ 'type' : 'text' ,
767
+ 'id' : 'shadow_5' ,
768
+ 'fields' : {
769
+ 'TEXT' : 'abc' ,
770
+ } ,
771
+ } ,
772
+ 'block' : {
773
+ 'type' : 'text_join' ,
774
+ 'id' : 'value_5' ,
775
+ 'extraState' : {
776
+ 'itemCount' : 2 ,
777
+ } ,
778
+ 'inputs' : {
779
+ 'ADD0' : {
780
+ 'block' : {
781
+ 'type' : 'text' ,
782
+ 'id' : 'value_5_1' ,
783
+ 'fields' : {
784
+ 'TEXT' : 'test' ,
785
+ } ,
786
+ } ,
787
+ } ,
788
+ 'ADD1' : {
789
+ 'block' : {
790
+ 'type' : 'text' ,
791
+ 'id' : 'value_5_2' ,
792
+ 'fields' : {
793
+ 'TEXT' : 'test' ,
794
+ } ,
795
+ } ,
796
+ } ,
797
+ } ,
798
+ } ,
799
+ } ,
800
+ } ,
801
+ 'next' : {
802
+ 'block' : {
803
+ 'type' : 'text_print' ,
804
+ 'id' : 'statement_6' ,
805
+ 'inputs' : {
806
+ 'TEXT' : {
807
+ 'shadow' : {
808
+ 'type' : 'text' ,
809
+ 'id' : 'shadow_6' ,
810
+ 'fields' : {
811
+ 'TEXT' : 'abc' ,
812
+ } ,
813
+ } ,
814
+ 'block' : {
815
+ 'type' : 'text_reverse' ,
816
+ 'id' : 'value_6' ,
817
+ 'inputs' : {
818
+ 'TEXT' : {
819
+ 'shadow' : {
820
+ 'type' : 'text' ,
821
+ 'id' : 'shadow_6_1' ,
822
+ 'fields' : {
823
+ 'TEXT' : '' ,
824
+ } ,
825
+ } ,
826
+ 'block' : {
827
+ 'type' : 'text' ,
828
+ 'id' : 'value_6_1' ,
829
+ 'fields' : {
830
+ 'TEXT' : 'test' ,
831
+ } ,
832
+ } ,
833
+ } ,
834
+ } ,
835
+ } ,
836
+ } ,
837
+ } ,
838
+ 'next' : {
839
+ 'block' : {
840
+ 'type' : 'draw_emoji' ,
841
+ 'id' : 'statement_7' ,
842
+ 'fields' : {
843
+ 'emoji' : '❤️' ,
844
+ } ,
845
+ } ,
846
+ } ,
847
+ } ,
848
+ } ,
849
+ } ,
850
+ } ,
851
+ } ,
852
+ } ,
853
+ } ,
854
+ } ,
855
+ } ,
856
+ } ,
857
+ } ,
858
+ } ,
859
+ } ,
860
+ } ,
861
+ ] ,
862
+ } ,
863
+ } ;
864
+
573
865
/**
574
866
* Loads saved state from local storage into the given workspace.
575
867
* @param {Blockly.Workspace } workspace Blockly workspace to load into.
@@ -582,6 +874,7 @@ export const load = function (workspace, scenarioString) {
582
874
'simpleCircle' : simpleCircle ,
583
875
'moreBlocks' : moreBlocks ,
584
876
'navigationTestBlocks' : navigationTestBlocks ,
877
+ 'moveTestBlocks' : moveTestBlocks ,
585
878
} ;
586
879
587
880
const data = JSON . stringify ( scenarioMap [ scenarioString ] ) ;
0 commit comments