OneCompiler

Metherorite

106

Metherorite, a Physic language

Following is sample Metherorite code.

//A var has a position x y in the world, a mass, a density, a height and a Wigth
obj box = (0, 0, 1.0, 3.0, 1.0, 1.0);
esf ball = (0, 0, 1.0, 3.0, 1.0); // A sfere has only radius instead of height or Wigth
Set value = 10; // This is a non-physical variable
Set boxy = get(box, y); //This is a non-physical variable that takes the y of box, that is 0


Physical = Activated {
  Set gravity = 9.8;
  Set delta = 2;
  Set frames = 0;
  while [not[frames = 10]] {
    ball.y - gravity * delta;
    if [colide(ball, floor)] {
      aply.force(ball, 0, 12);
      display("ball has colide with floor"); //Is like console.log()
    }
    frames + 1;
  }
  Phisical = Disabel
}

What is jump function?

jump makes that an object in a certain position jumps in the act to the position you have put.

obj box = (0, 12, 1.0, 3.0, 1.0, 1.0);

Physical = Activated {
  Set gravity = 9.8;
  Set frames = 0;
  Set delta = 2;
  while [not[frames = 10]] {
    box.y - gravity * delta;
    if [box.y < 2] {
      jump(box, 0, 12);
    };
    frames + 1;
  };
  Physical = Disable;
};