-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored game logic to matching Phaser 3 design.
Added new player images. Added additional scene variable type. Removed "onRenderer" block and code. Improved variable detection by additional checking the loaded xml code to allow cross references withing function and events. Updated example for new game logic.
- Loading branch information
1 parent
1b5854b
commit 15f4621
Showing
42 changed files
with
578 additions
and
644 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,4 +104,7 @@ | |
"locales", | ||
"node_modules" | ||
], | ||
"[xml]": { | ||
"editor.defaultFormatter": "DotJoshJohnson.xml" | ||
}, | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<xml xmlns="https://developers.google.com/blockly/xml"><block type="phaser_game" x="-390" y="-310"><field name="name">Bouncing cubes</field><field name="width">0</field><field name="height">0</field><next><block type="phaser_game_state"><field name="name">main</field><field name="autostart">true</field><statement name="state"><block type="phaser_preload"><statement name="CODE"><block type="phaser_load_image"><field name="name">50px_red</field><value name="image"><block type="static_image_file"><field name="urlData">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEX/XV2ZAABKhU15AAAAPUlEQVQY02P4DwYHGBoYQMBhlMZBt59nPtEApFsEmjSgtCoDEt08ofkQWH1AEysazdEA0t/PBKRxmg+LBwDPjDxK1kqocgAAAABJRU5ErkJggg==</field><field name="filename"></field><field name="url">/assets/phaser/samples/50px_red.png</field></block></value><next><block type="phaser_load_image"><field name="name">50px_green</field><value name="image"><block type="static_image_file"><field name="urlData">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEXQ/FxgnAAuZaaQAAAAPUlEQVQY02P4DwYHGBoYQMBhlMZBt59nPtEApFsEmjSgtCoDEt08ofkQWH1AEysazdEA0t/PBKRxmg+LBwDPjDxK1kqocgAAAABJRU5ErkJggg==</field><field name="filename"></field><field name="url">/assets/phaser/samples/50px_green.png</field></block></value><next><block type="phaser_load_image"><field name="name">50px_blue</field><value name="image"><block type="static_image_file"><field name="urlData">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEVcvPwAXJwoG/B+AAAAPUlEQVQY02P4DwYHGBoYQMBhlMZBt59nPtEApFsEmjSgtCoDEt08ofkQWH1AEysazdEA0t/PBKRxmg+LBwDPjDxK1kqocgAAAABJRU5ErkJggg==</field><field name="filename"></field><field name="url">/assets/phaser/samples/50px_blue.png</field></block></value></block></next></block></next></block></statement><next><block type="phaser_create"><statement name="CODE"><block type="phaser_stage_background_color"><field name="color">#cccccc</field><next><block type="phaser_physics_arcade_sprite_add"><field name="sprite">50px_red</field><value name="variable"><block type="phaser_variable_set"><field name="VAR">red</field></block></value><value name="x"><block type="math_number"><field name="NUM">100</field></block></value><value name="y"><block type="math_number"><field name="NUM">100</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust"><field name="property">collideWorldBounds</field><value name="variable"><block type="phaser_variable_get"><field name="VAR">red</field></block></value><value name="value"><block type="math_number"><field name="NUM">1</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust"><field name="property">bounce.set</field><value name="variable"><block type="phaser_variable_get"><field name="VAR">red</field></block></value><value name="value"><block type="math_number"><field name="NUM">1</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust"><field name="property">velocity.x</field><value name="variable"><block type="phaser_variable_get"><field name="VAR">red</field></block></value><value name="value"><block type="math_number"><field name="NUM">75</field></block></value><next><block type="phaser_physics_arcade_sprite_add"><field name="sprite">50px_green</field><value name="variable"><block type="phaser_variable_set"><field name="VAR">green</field></block></value><value name="x"><block type="math_number"><field name="NUM">200</field></block></value><value name="y"><block type="math_number"><field name="NUM">100</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust"><field name="property">collideWorldBounds</field><value name="variable"><block type="phaser_variable_get"><field name="VAR">green</field></block></value><value name="value"><block type="math_number"><field name="NUM">1</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust"><field name="property">bounce.set</field><value name="variable"><block type="phaser_variable_get"><field name="VAR">green</field></block></value><value name="value"><block type="math_number"><field name="NUM">1</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust"><field name="property">velocity.y</field><value name="variable"><block type="phaser_variable_get"><field name="VAR">green</field></block></value><value name="value"><block type="math_number"><field name="NUM">75</field></block></value><next><block type="phaser_physics_arcade_sprite_add"><field name="sprite">50px_blue</field><value name="variable"><block type="phaser_variable_set"><field name="VAR">blue</field></block></value><value name="x"><block type="math_number"><field name="NUM">300</field></block></value><value name="y"><block type="math_number"><field name="NUM">100</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust"><field name="property">collideWorldBounds</field><value name="variable"><block type="phaser_variable_get"><field name="VAR">blue</field></block></value><value name="value"><block type="math_number"><field name="NUM">1</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust"><field name="property">bounce.set</field><value name="variable"><block type="phaser_variable_get"><field name="VAR">blue</field></block></value><value name="value"><block type="math_number"><field name="NUM">1</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust"><field name="property">velocity.y</field><value name="variable"><block type="phaser_variable_get"><field name="VAR">blue</field></block></value><value name="value"><block type="math_number"><field name="NUM">75</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust"><field name="property">velocity.x</field><value name="variable"><block type="phaser_variable_get"><field name="VAR">blue</field></block></value><value name="value"><block type="math_number"><field name="NUM">75</field></block></value></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement><next><block type="phaser_input"><next><block type="phaser_update"><next><block type="phaser_render" collapsed="true"></block></next></block></next></block></next></block></next></block></statement></block></next></block></xml> | ||
<xml xmlns="https://developers.google.com/blockly/xml"><block type="phaser_game" x="-250" y="-250"><field name="name">Bouncing cubes</field><field name="width">0</field><field name="height">0</field><field name="debug">FALSE</field><next><block type="phaser_game_state"><value name="variable"><block type="phaser_variable_scene_set"><field name="VAR">main</field></block></value><field name="autostart">true</field><statement name="state"><block type="phaser_preload"><statement name="CODE"><block type="phaser_load_image"><field name="name">50px_red</field><value name="image"><block type="static_image_file"><field name="urlData">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEX/XV2ZAABKhU15AAAAPUlEQVQY02P4DwYHGBoYQMBhlMZBt59nPtEApFsEmjSgtCoDEt08ofkQWH1AEysazdEA0t/PBKRxmg+LBwDPjDxK1kqocgAAAABJRU5ErkJggg==</field><field name="filename">50px_red.png</field><field name="url">/assets/phaser/samples/50px_red.png</field></block></value><next><block type="phaser_load_image"><field name="name">50px_green</field><value name="image"><block type="static_image_file"><field name="urlData">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEXQ/FxgnAAuZaaQAAAAPUlEQVQY02P4DwYHGBoYQMBhlMZBt59nPtEApFsEmjSgtCoDEt08ofkQWH1AEysazdEA0t/PBKRxmg+LBwDPjDxK1kqocgAAAABJRU5ErkJggg==</field><field name="filename">50px_green.png</field><field name="url">/assets/phaser/samples/50px_green.png</field></block></value><next><block type="phaser_load_image"><field name="name">50px_blue</field><value name="image"><block type="static_image_file"><field name="urlData">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAQMAAAAk8RryAAAABlBMVEVcvPwAXJwoG/B+AAAAPUlEQVQY02P4DwYHGBoYQMBhlMZBt59nPtEApFsEmjSgtCoDEt08ofkQWH1AEysazdEA0t/PBKRxmg+LBwDPjDxK1kqocgAAAABJRU5ErkJggg==</field><field name="filename">50px_blue.png</field><field name="url">/assets/phaser/samples/50px_blue.png</field></block></value></block></next></block></next></block></statement><next><block type="phaser_create"><statement name="CODE"><block type="phaser_stage_background_color"><field name="color">#cccccc</field><next><block type="phaser_physics_arcade_sprite_ball_add"><field name="sprite">50px_red</field><value name="variable"><block type="phaser_variable_arcade_sprite_set"><field name="VAR">red_cube</field></block></value><value name="x"><block type="math_number"><field name="NUM">100</field></block></value><value name="y"><block type="math_number"><field name="NUM">100</field></block></value><statement name="CODE"><block type="phaser_physics_arcade_sprite_adjust_custom"><field name="property">velocity.x</field><value name="value"><block type="math_number"><field name="NUM">50</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust_custom"><field name="property">velocity.y</field><value name="value"><block type="math_number"><field name="NUM">100</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust_custom"><field name="property">bounce.set</field><value name="value"><block type="math_number"><field name="NUM">1</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust_custom"><field name="property">collideWorldBounds</field><value name="value"><block type="math_number"><field name="NUM">1</field></block></value></block></next></block></next></block></next></block></statement><next><block type="phaser_physics_arcade_sprite_ball_add"><field name="sprite">50px_green</field><value name="variable"><block type="phaser_variable_arcade_sprite_set"><field name="VAR">green_cube</field></block></value><value name="x"><block type="math_number"><field name="NUM">200</field></block></value><value name="y"><block type="math_number"><field name="NUM">100</field></block></value><statement name="CODE"><block type="phaser_physics_arcade_sprite_adjust_custom"><field name="property">velocity.x</field><value name="value"><block type="math_number"><field name="NUM">100</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust_custom"><field name="property">velocity.y</field><value name="value"><block type="math_number"><field name="NUM">50</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust_custom"><field name="property">bounce.set</field><value name="value"><block type="math_number"><field name="NUM">1</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust_custom"><field name="property">collideWorldBounds</field><value name="value"><block type="math_number"><field name="NUM">1</field></block></value></block></next></block></next></block></next></block></statement><next><block type="phaser_physics_arcade_sprite_ball_add"><field name="sprite">50px_blue</field><value name="variable"><block type="phaser_variable_arcade_sprite_set"><field name="VAR">blue_cube</field></block></value><value name="x"><block type="math_number"><field name="NUM">300</field></block></value><value name="y"><block type="math_number"><field name="NUM">100</field></block></value><statement name="CODE"><block type="phaser_physics_arcade_sprite_adjust_custom"><field name="property">velocity.x</field><value name="value"><block type="math_number"><field name="NUM">75</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust_custom"><field name="property">velocity.y</field><value name="value"><block type="math_number"><field name="NUM">75</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust_custom"><field name="property">bounce.set</field><value name="value"><block type="math_number"><field name="NUM">1</field></block></value><next><block type="phaser_physics_arcade_sprite_adjust_custom"><field name="property">collideWorldBounds</field><value name="value"><block type="math_number"><field name="NUM">1</field></block></value></block></next></block></next></block></next></block></statement></block></next></block></next></block></next></block></statement><next><block type="phaser_input"><next><block type="phaser_event"><next><block type="phaser_update"></block></next></block></next></block></next></block></next></block></statement></block></next></block></xml> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.