Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: Krosad on November 25, 2012, 11:02:13 PM
-
Hi,
here the problem.
i have dynamically created objects
for (var a=1; a<=70; a=a+1)
{
var module = Scene.CreateEntity("module" + a);
}
Then i need to change a sprite of a certain object and need of code like this
module[c].SetSprite("scenes\stcomp\module1.png");
this is wrong. How will be correct?
-
var Ent;
global module;
for (var a=1; a<=70; a=a+1)
{
Ent = Scene.CreateEntity("module" + a);
module[a] = Ent;
}
...
for (var c=1; c<=70; c=c+1)
{
Ent = module[c];
Ent.SetSprite("scenes\stcomp\module1.png");
module[c] = Ent;
}
-
thanx!
One more question
I added a script to each entity of the array.
What should i write in this script to return entity index in array on leftclick?