Skip to content
Snippets Groups Projects

Dinosaurus törmäyksenkäsittelijät

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by tailkauh
    Edited
    Snippet.cs 385 B
     // Lisätään/vähennetään pisteitä kun hahmo osuu dinoon
    AddCollisionHandler(hahmo, "dino", (_,_) =>
    {
        int muutos = 0;
        if (tagi == "miinus") muutos = -3;
        else if (tagi == "plus") muutos = 1;
        
        _pelaajanPisteet.Value += muutos;
        hahmo.Destroy();
    });
    
    // Tuhotaan hahmo kun se osuu alareunaan
    AddCollisionHandler(hahmo, "alareuna", (_, _) => hahmo.Destroy());
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment