Report a Bug


  • Impact ForumsLatest from the Impact Forums
  • Impact IRC ChatGet help from others on IRC
Visit Forums

Impact Forums

Get Entity by ID?
Posted September 28, 2014, 4:57 am — by madd4mon
Hello there,

I'm fairly new to Impact and I am working on my first game right now. There were a lot of questions at first but thanks to Google and this forum here I could answer most of them. Unfortunately, I am stumped now.

I am looking for a way to get an entity by its ID - and I haven't found a solution yet. Maybe you can help me?

More context: In the game, blocks are continually falling from the upper edge of the playing field. The player has to click on them, answer a question to make them disappear. There are three block sizes which I have defined in three entity files. The game spawns one of those three entities after a certain countdown.

The game checks over which one the player is hovering and executes a function. It's not working properly though. When I click on one block, another one disappears. That's why I want to get a certain element by ID.

Here's some code.

    kommentar: function(objekt) {
     var Animation = function() {
      animated = true;
      var r = $.Deferred();
      var AnimationTimer = new ig.Timer(1);
      if ( < 0) {
       objekt.currentAnim = objekt.anims.kill;
      } else {
      setTimeout(function() {
      return r;
     var Kill = function() {
      animated = false;
    update: function() {
      if (this.inFocus() == true && animated == false) {
       this.currentAnim = this.anims.hover;
        if (ig.input.pressed("leftButton")) {
         startTime = startTime;
         var zufall = Math.floor(Math.random()*;
         box([zufall].frage,[zufall].antwort1,[zufall].antwort2,[zufall].antwort1Wert,[zufall].antwort2Wert,[zufall].antwort3,[zufall].antwort3Wert,[zufall].name); //Hier werden die Parameter für die Box an das äußere JS übergeben
         //inFocus resetten
         ig.input.mouse.x = 0;
         ig.input.mouse.y = 0;
      } else if (animated == false) {
       this.currentAnim = this.anims.idle;
      if (antwortRichtig == true) {
       antwortRichtig = false;

Older Posts

Ready to get to the point?

Your Email will remain private and is only used for good. We promise!

Please use only letters, numbers or underscores.