Minecraft Programming – Creating Buildings with ScriptCraft Functions on CanaryMod

Standard

Ok after successfully stacking blocks or making buildings using ScriptCraft one-line command, now our kids programming class start to create something like this using functions:

Tangkapan layar 2015-03-10 18.05.11

There are some tricks to make ScriptCraft functions work. First, you have to save it in the right folder: plugins/drone/contrib/ . Second, you have to make sure that there is no errors. CanaryMod server is very helpful at pointing where the problems occur:

Tangkapan layar 2015-03-10 18.46.46

CanaryMod also make it possible to set up everything about the game. To practice with buildings, this is the setting should be set:
Bildschirmfoto 2015-03-11 um 8.29.08 vorm.
This will give you a flat empty world. If you want to start a new empty world, or apply new settings, just delete the world folder. Next time you start up CanaryMod server, it will generate a new world for you like this:

Tangkapan layar 2015-03-10 18.46.32

This is an example of ScriptCraft function to create a skycraper:

 
var Drone = require('../drone').Drone;
var blocks = require('blocks');

function skyscraper( floors )
{
echo(floors);
this.chkpt('skyscraper');
for (var i = 0; i < floors; i++)
{
this.box(blocks.iron,20,1,20).up().box0(blocks.glass_pane,20,3,30).up(3);
}
this.move('skyscraper');
};

Drone.extend(skyscraper);

just type it on the command line:

Tangkapan layar 2015-03-10 20.14.31

and you’ll get this:

Tangkapan layar 2015-03-10 20.15.08

this is another simpler function, just for stacking blocks:


var Drone = require('../drone').Drone;
var blocks = require('blocks');

function tumpuk( tingkat ) {
echo(tingkat);
this.chkpt('tumpuk');
for (var i = 0; i < tingkat; i++){
this.up(1).box0('35:6',1, 1, 1);
}

this.move('tumpuk');
};

Drone.extend(tumpuk);

type it on the command line:

Tangkapan layar 2015-03-10 20.17.44

and you will get this:

Tangkapan layar 2015-03-10 20.18.10

If you modify the code and want to re-run it on Minecraft, just type ‘reload’ or /js refresh() on the command prompt.

Next time we will learn to build awesome buildings like pyramid or maybe rocket launcher! 😉

Advertisements

ProCodeCG codeMeetUp() 9 March 2015 – How to Create Android Apps

Standard

Today, our friends from CyberLabs shared about how to develop Android apps. Founded on June 2014, this start-up run by these young people already have at least 3 great products: Atom, Hydra and Molecule. With total 10 employees they are also already have more or less 50 customers, can afford renting an office and have about 11 apps on GooglePlay.

IMG_6154

IMG_6157

IMG_6160

IMG_6162

Teamwork, persistence, marketing strategy and good management is their key of success 🙂

And this is us, once again, meeting new people with different experiences! We learn from each other, that’s what this codeMeetUp() initiated for! 🙂

IMG_6164

Next week is DyCode‘s turn to share about iOS apps development. We’re planning to gather apps developer in Bandung, and set up an ecosystem to make things work for developer and the stakeholders, so be part of it, you’re invited!