Skip to content

Commit

Permalink
Add more examples
Browse files Browse the repository at this point in the history
Merge pull request #131 from haroldo-ok/more-examples

- Add example on how to create a simple platformer movement;
- Improve the diagonal ball bouncing example.

See #84
  • Loading branch information
haroldo-ok authored Oct 31, 2024
2 parents 705a3bd + 4ae0134 commit c9a943c
Show file tree
Hide file tree
Showing 3 changed files with 344 additions and 64 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vcs-game-maker",
"version": "0.28.0",
"version": "0.29.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
76 changes: 13 additions & 63 deletions src/components/blockly-toolbox-ball-movement.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
</category>

<category name="Diagonally bouncing ball" colour="#ff8800">
<block type="controls_if" y="-62">
<block type="controls_if">
<value name="IF0">
<block type="logic_negate">
<value name="BOOL">
Expand Down Expand Up @@ -234,43 +234,18 @@
<field name="DURATION">5</field>
<field name="CHANNEL">0</field>
<next>
<block type="controls_if">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_set">
<field name="VAR">Ball Y Speed</field>
<value name="VALUE">
<block type="math_single">
<field name="OP">NEG</field>
<value name="NUM">
<block type="variables_get">
<field name="VAR">Ball Y Speed</field>
</block>
</value>
<value name="B">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set">
<field name="VAR">Ball Y Speed</field>
<value name="VALUE">
<block type="math_number">
<field name="NUM">255</field>
</block>
</value>
</block>
</statement>
<statement name="ELSE">
<block type="variables_set">
<field name="VAR">Ball Y Speed</field>
<value name="VALUE">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
</block>
</statement>
<next>
<block type="sprite_ball_change">
<field name="VAR">bally</field>
Expand Down Expand Up @@ -319,43 +294,18 @@
<field name="DURATION">5</field>
<field name="CHANNEL">0</field>
<next>
<block type="controls_if">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_set">
<field name="VAR">Ball X Speed</field>
<value name="VALUE">
<block type="math_single">
<field name="OP">NEG</field>
<value name="NUM">
<block type="variables_get">
<field name="VAR">Ball X Speed</field>
</block>
</value>
<value name="B">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set">
<field name="VAR">Ball X Speed</field>
<value name="VALUE">
<block type="math_number">
<field name="NUM">255</field>
</block>
</value>
</block>
</statement>
<statement name="ELSE">
<block type="variables_set">
<field name="VAR">Ball X Speed</field>
<value name="VALUE">
<block type="math_number">
<field name="NUM">1</field>
</block>
</value>
</block>
</statement>
<next>
<block type="sprite_ball_change">
<field name="VAR">ballx</field>
Expand Down
Loading

0 comments on commit c9a943c

Please sign in to comment.