Not logged inOpenClonk Forum
Up Topic Development / Scenario & Object Development / Bounce off the ground?
- - By Alx [de] Date 2014-10-25 17:12
Hi, I tried to devolp a rule, which is bouncing you from the wall.
But it's just sometimes working, here  is the code:
  for(var obj in FindObjects(Find_OnLine(
  0,
  LandscapeHeight()-2,
  LandscapeWidth(),
  LandscapeHeight()-1))) {
    var ydir = obj->GetYDir();
    obj->SetYDir(-ydir);
  }

With things like loam, or stones it's working the most time, but if I jump with a clonk on the ground, sometimes nothing happens.
Does anybody know, what I'm doing wrong?
Parent - - By Sven2 Date 2014-10-25 17:14
Set a Jump action to avoid attachment.
Parent - By Alx [de] Date 2014-10-25 17:39
Now the clonk often stucks, so he's  in Jump-Action, but he doesn't came out from that.
It looks like, the clonk stucks in the for-loop.
My code is now:
  for(var obj in FindObjects(Find_OnLine(
  0,
  LandscapeHeight()-2,
  LandscapeWidth(),
  LandscapeHeight()-1))) {
    var ydir = obj->GetYDir();
    obj->SetYDir(-ydir);
    obj->SetAction("Jump");
  }
Up Topic Development / Scenario & Object Development / Bounce off the ground?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill