Execute script then laser stops hitting geom

About advanced scenes, and the Thyme scripting language used in Algodoo.

Execute script then laser stops hitting geom

Postby Kilinich » Thu Dec 04, 2014 12:46 pm

Knowing excecution order I manage to extend standard events with this:

Code: Select all
_onStopHitByLaser := (e) => {e.this.color = [1,1,1,1]};

_clear := true; _hitting := false; _updated := false;
onHitByLaser = (e) => {e.geom._clear = false};
postStep = (e) => {e.this._updated = false};
update = (e) =>{
  sim.running && ! e.this._updated ? {
    e.this._clear && e.this._hitting ? {e.this._onStopHitByLaser(e)} : {};
    e.this -> {_hitting = ! _clear; _clear = true; _updated = true}
  } : {};
};


Now you could do something then laser blocked, turned off or just moved away. :thumbup:

Rating: rated 5.6
Filesize: 32.05 kB
Comments: 1
Ratings: 2
download
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 11 guests

cron