Page 1 of 1

Spawner spawnig ob. w. script

PostPosted: Sat Oct 31, 2009 1:25 pm
by Jackyy
How to spawn ob. w. script in onCollide?
Code: Select all
(e)=>{
    scene.addcircle({         pos = e.pos;         radius := 0.02002001;         density := 20.5;         color := [0.0, 0.0, 0.0, 1.0];         collideset := 1;         restitution := 0.5;         heterocollide := true;         drawBorder := true;         drawcirclecace := false;         attraction := 0; onCollide = (e)=>{ scene.addpen({         pos = e.pos;         color := [1.0, 1.0, 0.0, 1.0];         size := 0.02002001;         fadeTime := 0.0     }) }}  })


^This dont work...

Re: Spawner spawnig ob. w. script

PostPosted: Sat Oct 31, 2009 3:05 pm
by niffirg1
Won't work it needs ti be oncollide := (e)=>{BLA} you missed the colon and i saw some other little errors

Re: Spawner spawnig ob. w. script

PostPosted: Sat Oct 31, 2009 3:19 pm
by Jackyy
Still bad

Re: Spawner spawnig ob. w. script

PostPosted: Sat Oct 31, 2009 5:51 pm
by KarateBrot
niffirg1 wrote:i saw some other little errors


Jackyy wrote:Still bad


Of course it still doesn't work until you corrected the other little errors. it's nothing special but you need a } bracket somewhere. i don't know if there are more errors but be sure you correctly typed in every single character

Re: Spawner spawnig ob. w. script

PostPosted: Sat Oct 31, 2009 6:01 pm
by standardtoaster
Code: Select all
(e)=>{Scene.addCircle({pos := e.pos; radius := 0.02002001; density := 20.5; color := [0,0,0,1]; collideSet := 1; restitution := 0.5; heteroCollide := true; drawBorder := true; drawCake := false; attraction := 0; onCollide := (e)=>{scene.addPen({pos := e.pos; color := [1, 1 ,0, 0]; size := 0.02002001; fadeTime := 0})}})}

Fixed the errors for you. BTW it's drawCake not drawCircleCace. ;)

Re: Spawner spawnig ob. w. script

PostPosted: Sat Oct 31, 2009 6:45 pm
by Jackyy
Thanks. !!! :clap: :clap: :clap: :clap: