noahcoolboy / block-hill

block coding for brick hill

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Block-hill

This repository contains the source code of block-hill
With block-hill, you can code your brick-hill games with coding blocks (scratch)
This was created for the people that don't have any coding experience and don't have the time to learn JS
Want to test it out? Here! https://noah.ovh/blockhill Happy coding!

Contributing

If you would like to give me a helping hand by making/designing new blocks, here is how you can

Step 1 - designing the block

You'll need to explain to blockly what the block looks like, for that you'll have to use a tool which you can find here
https://blockly-demo.appspot.com/static/demos/blockfactory/index.html
There is a video explaining how you can use the blockfactory

Blocks have to be exported in json, and be added to the array in definitions.js
Make sure it has a correct name such as bot_new, brick_collision, player_get

Step 2 - coding the block

Blockly needs to know how the blocks is code to then convert it back to javascript
To do this, in the block factory, you'll have "Generator stub"
Use the Generator stub as a template for your code
You'll see var code = "...\n";
Put the code in the ... using the variables given
You'll probably find Blockly.JavaScript.ORDER_NONE or Blockly.JavaScript.ORDER_ATOMIC
If you don't then you can go to step 3
You'll have to replace it with a correct value
Here is a page explaining why and how https://developers.google.com/blockly/guides/create-custom-blocks/operator-precedence

Step 3 - Commiting it

Done? Great!
Make a pull request on the github explaining all the blocks you added
I'll merge it and the blocks will be added!
If you contributed, thanks!

About

block coding for brick hill


Languages

Language:JavaScript 91.6%Language:HTML 3.5%Language:Python 1.7%Language:PHP 1.0%Language:Dart 0.8%Language:Lua 0.8%Language:CSS 0.2%Language:Shell 0.2%Language:Closure Templates 0.1%Language:Java 0.1%Language:Swift 0.1%