Forums

OverviewV-Play 2 Support (Qt 5) › Walls collisions doesnt works

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #7512

    Vlad

    Hi

     

    I’m used Wall entity from previous V-Play version and it works ok in V-Play 1.5.x

    but now in V-Play 2.0 it doesnt works anymore

    Did you changed something in this area?

     

    thanks

     

    #7513

    Christian
    V-Play Team

    Hi Vlad,

    no we didn’t change anything there (on purpose). Can you post the code that shows the issue?

    Cheers, Chris

    #7515

    Vlad

    Hi

     

    it seems, CircleCollider gets broken

    If I’ll change entity to boxcollider, its looks much better

    #7516

    Vlad

    ok, some mystic:

    here is level01.qml

    import QtQuick 2.0
    import "entities"
    
    Item {
        id: _root
        //anchors.fill: parent
        x: 0
        y: 0
        width: parent.width
        height: parent.height
        
        // these entities will be created when the game launches
    
        Wall {
            height: 1
            width: parent.width
            y: 0
            x: 0
            variationType: "ceil"
        }
    
        Wall {
            height: 1
            width: parent.width
            y: parent.height
            x: 0
            variationType: "floor"
        }
        
        Wall {
            width: 1
            height: _root.height
            x: 0
            y: 0
            boxColliderX: 1
            variationType: "left"
            onHeightChanged: console.log("level01 wall h:", height)
        }
        
        Wall {
            width: 1
            height: _root.height
            x: parent.width
            y: 0
            variationType: "right"
            boxColliderX: 1
        }
    
        Component.onCompleted: {
            entityManager.createPooledEntitiesFromUrl(Qt.resolvedUrl("entities/Corn.qml"))
        }
        onWidthChanged: console.log("leel01 w:", width)
        onHeightChanged: console.log("leel01 h:", height)
    }
    
    

    here is Wall.qml

    import QtQuick 2.0
    import VPlay 2.0
    //import Box2D 1.0
    
    
    EntityBase {
        id: entity
        entityType: "wall"
        collidersActive: true
        preventFromRemovalFromEntityManager: true
        property alias boxColliderX: boxCollider.x
        property alias boxColliderY: boxCollider.y
    
        BoxCollider {
            id: boxCollider
            categories: Box.Category1
            //collisionTestingOnlyMode: true
            // the wall shouldnt move
            bodyType: Body.Static
            anchors.fill: rect
        }
    
        
        Rectangle {
            id: rect
            color: "brown"
            anchors.fill: parent
        }
    }
    
    

     

    turning on debug draws in PhysicsWorld I’ve discovered that only one wall (variationType:  “right”) gets correct size of parent.height/width

    there rest elements gets something about 32 pixels

    If I set numbers explicitly, everything works ok

     

    can you explain this?

    #7537

    Vlad

    any thoughts?

     

    #7538

    Alex
    V-Play Team

    Hi vladest,

    sorry for the late response. Can you please send a small project that contains the issues you mentioned to support@v-play.net? Then i can dive into debugging the problems right away.

    Cheers,
    Alex

Viewing 6 posts - 1 through 6 (of 6 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support