Package com.sertaogames.cactus2d.components

Examples of com.sertaogames.cactus2d.components.PhysicsComponent


  }


  private static void addDinamicPhysicBySprite(GameObject gameObject) {
   
    PhysicsComponent p = new PhysicsComponent(1, BodyType.KinematicBody, false);
    gameObject.AddComponent(p);

    Vector2 offset = new Vector2(
        gameObject.spriteRenderer.spriteRegion.getRegionWidth()/2,
        gameObject.spriteRenderer.spriteRegion.getRegionHeight()/2);
View Full Code Here


  }

  private static void addStaticPolignPhysic(GameObject go, Vector2 dimensions, Vector2 location) {
    GameObject side = new GameObject("side");

    PhysicsComponent p = new PhysicsComponent(1, false, false);
    side.AddComponent(p);
   
    side.transform.getLocalPosition().set(location);
    Vector2 offset = new Vector2(dimensions).mul(0.5f);
    BoxCollider coll = new BoxCollider(dimensions, offset);
View Full Code Here

TOP

Related Classes of com.sertaogames.cactus2d.components.PhysicsComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.