A geometry game based on Euclid's Elements.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_includes andersk cheat fix proposal Jul 18, 2014
_layouts ... Jul 7, 2014
_plugins update new website Jun 30, 2014
css some updates Jul 18, 2014
ggb some updates Jul 18, 2014
img added tutorial Jul 1, 2014
javascript some updates Jul 18, 2014
.gitignore update new website Jun 30, 2014
BonusLevel1.html update up to level 10 Jun 30, 2014
BonusLevel2.html Created Level 21-25 Jul 1, 2014
BonusLevel22.html Created Level 21-25 Jul 1, 2014
LICENSE LICENSE Aug 22, 2015
Level1.html ... Jul 7, 2014
Level10.html ... Jul 2, 2014
Level11.html ... Jul 2, 2014
Level12.html ... Jul 2, 2014
Level13.html ... Jul 7, 2014
Level14.html ... Jul 7, 2014
Level15.html ... Jul 2, 2014
Level16.html ... Jul 2, 2014
Level17.html ... Jul 2, 2014
Level18.html ... Jul 2, 2014
Level19.html ... Jul 2, 2014
Level2.html ... Jul 2, 2014
Level20.html ... Jul 7, 2014
Level21.html ... Jul 7, 2014
Level22.html ... Jul 2, 2014
Level23.html some updates Jul 18, 2014
Level24.html ... Jul 7, 2014
Level25.html ... Jul 2, 2014
Level3.html ... Jul 2, 2014
Level4.html locol storoge of levels Jul 2, 2014
Level5.html ... Jul 2, 2014
Level6.html ... Jul 2, 2014
Level7.html ... Jul 2, 2014
Level8.html ... Jul 2, 2014
Level9.html ... Jul 2, 2014
Levelx.html ... Jul 7, 2014
License Geogebra Create License Geogebra Jun 23, 2014
Medal.html ... Jul 7, 2014
README.md Update README.md Aug 22, 2015
_config.yml ... Jul 2, 2014
circlecircletangents.png ... Jun 30, 2014
deployggb.js added old level 17,18,19,20 Jun 30, 2014
enhancedtranslateline.html update new website Jun 30, 2014
footer.html ... Jul 2, 2014
highscore.html ... Jul 7, 2014
highscore.txt ... Jul 7, 2014
index.html ... Jul 7, 2014
newtools.html update new website Jun 30, 2014
nojekyll update new website Jun 30, 2014
sendscore.html ... Jul 7, 2014
stylesheet.css added old level 17,18,19,20 Jun 30, 2014
submitscore.php ... Jul 7, 2014
tutorial.html some updates Jul 18, 2014

README.md

Euclid The Game

The goal of this project is to gamify geometric challanges. We use the geogebra software for this. This game is MIT licensed, see the LICENSE file.

See the facebook group for updates about the iOS game: https://www.facebook.com/euclidthegame

Message July 2014

A year ago I posted the idea for this game at stackexchange: http://math.stackexchange.com/questions/373672/about-euclids-elements-and-modern-video-games

I hoped that I could inspire game developers to make such a game. Well, I failed ! But I did inspire myself to learn a little bit about html/javascript and geogebra, and in this way, I was able to make this game.

If you have worked with geogebra, it may be not so hard to contribute to new levels. I've written a couple of function that make it easy to test if objects/lines/circles are drawn:

function ggbOnInit() {
  ggbApplet.debug("ggbOnInit");
  ggbApplet.registerAddListener("newObjectListener");
}

function newObjectListener(obj) {
  // this functions can check all general objects
  function checkobject(target, step) {
    if (obj != "finished") {
      var cmd = "finished = (" + obj + "== " + target + ")";
      ggbApplet.debug(cmd);
      ggbApplet.evalCommand(cmd);
      finished = ggbApplet.getValueString("finished");
      if (finished.indexOf("true") > -1) {
        ggbApplet.setVisible(step, true);
      }
    }
  }
  // this functions check line segments
  function checksegment(target, step) {
    if (ggbApplet.getObjectType(obj) == "segment") {
      //gives beginpoint and enpoint of object
      var objectcmd = ggbApplet.getCommandString(obj);
	  var openbracket = objectcmd.indexOf('[') + 1;
	  var comma = objectcmd.indexOf(',');
	  var closebracket = objectcmd.indexOf(']');
	  var beginpointobject = objectcmd.substring(openbracket, comma);
	  var endpointobject = objectcmd.substring(comma + 1, closebracket);
      //gives beginpoint and endpoint of target
      var targetcmd = ggbApplet.getCommandString(target); 
	  var openbracket = targetcmd.indexOf('[') + 1;
	  var comma = targetcmd.indexOf(',');
	  var closebracket = targetcmd.indexOf(']');
	  var beginpointtarget = targetcmd.substring(openbracket, comma);
	  var endpointtarget = targetcmd.substring(comma + 1, closebracket);
      //here it checks if endpoints of line segment are equal
      if (obj != "finished") {
        var cmd = "finished =((("+beginpointobject+"=="+beginpointtarget+")||("+beginpointobject+"=="+endpointtarget+"))&&(("+endpointobject+"=="+beginpointtarget+")||("+endpointobject+"=="+endpointtarget+")))";
        ggbApplet.debug(cmd);
        ggbApplet.evalCommand(cmd);
        finished = ggbApplet.getValueString("finished");
        if (finished.indexOf("true") > -1) {
          ggbApplet.setVisible(step, true);
        }
      }
    }
  }
   // this functions can check if line segment has right direction
  function checksegmentdirection(target, step) {
    if (ggbApplet.getObjectType(obj) == "segment" || ggbApplet.getObjectType(obj) == "line") {
    if (obj != "finished") {
      var cmd = "finished = (("+obj+"(1)=="+target+"(1))&&("+obj+"(-1)=="+target+"(-1)))";
      ggbApplet.debug(cmd);
      ggbApplet.evalCommand(cmd);
      finished = ggbApplet.getValueString("finished");
      if (finished.indexOf("true") > -1) {
        ggbApplet.setVisible(step, true);
      }
    }
  }
  }
  // this functions check if the new point is on the targetline
  function checkpointontarget(target, step) {
    if (ggbApplet.getObjectType(obj) == "point") {
    if (obj != "finished") {
      var cmd = "finished = ("+target+"(x("+obj+"))==y("+obj+"))";
      ggbApplet.debug(cmd);
      ggbApplet.evalCommand(cmd);
      finished = ggbApplet.getValueString("finished");
      if (finished.indexOf("true") > -1) {
        ggbApplet.setVisible(step, true);
      }
    }
  }
  }
  //here you can check all objects 


  //which step are neccesary to complete level
  if (ggbApplet.getVisible("step1") ) {
    ggbApplet.setVisible("complete", true);
	document.getElementById("level").style.visibility="visible";
  }
}