Forums

OverviewFelgo 2 Support (Qt 5) › Type BoxCollider unavailable

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #16146

    Patricia

    <div>
    <div id=”x_divtagdefaultwrapper” dir=”ltr”>
    <div>

    Hi to everyone,

    I have problems with V-play.
    <div></div>
    <div>I downloaded and intalled it, but the program, that I had developed in qml previously, send an error when I try to run it. that is the error: Type PhysicsWorld unavailable, World is not a type. I dont know how to fix it.</div>
    <div></div>
    <div>I told you, I’m trying to do a kind of Angry Birds game, so in my program I have “boxes” and the “bird” so sometimes the bird are going to collide with the boxes and these have to move.</div>
    <div></div>
    <div>I send you a part of my program maybe you can help me. (I was checking the BoxCollision on the official page) Also, I have to say I can run other Felgo Demos that use PhysicsWorld.</div>
    <div></div>
    <div>

    GameWindow {
    
    
    
    //definición de la pantalla de juego como pantalla completa.
    
        id: window
    
        visible: true
    
        visibility: "FullScreen"
    

    </div>
    <div></div>
    <div></div>
    <div>

       
    
    
    
    
    
    
    
    //fondo del juego
    
        Background{
    
        id: background
    
        height: parent
    
        width: parent
    
        }
    
    
    
    //posición y velocidad inicial del pollito.
    
        Bird{
    
        id: bird
    
        x: 100
    
        y: 550
    
        z: 1
    
        property double vx: move.vi*Math.cos(move.tita)
    
        property double vy: move.vi*Math.sin(-move.tita)
    
    
    
    
    
            Behavior on x{ //el tiempo que va a tardar en moverse en cada iteracción en el eje x
    
                NumberAnimation{
    
                duration: 10
    
    
    
    
    
                }
    
            }
    
    
    
            Behavior on y{ //el tiempo que va a tardar en moverse en cada iteracción en el eje y
    
                NumberAnimation{
    
                    duration:10
    
                }
    
            }
    
    
    
        }
    
    
    
    
    
    
    
    
    
        Box{
    
            id:box
    
            x:1100
    
            y:625
    
       }
    
    
    
    
    
    
    
    PhysicsWorld{
    
            gravity.y: -3
    
        }
    
    
    
        Scene{
    
            EntityBase {
    
                entityId: "box1"
    
                entityType: "box"
    
            }
    
    
    
            Image{
    
                id: boxImage
    
                source: "img/box.png"
    
            }
    
    
    
            BoxCollider{
    
                friction: 0.2
    
                restitution: 0
    
                bodyType: Body.Dynamic
    
                bullet:false
    
                angularDamping: 0
    
                linearDamping: 0
    
                fixedRotation: false
    
    
    
                linearVelocity: Qt.point(100,0)
    
    
    
                anchors.fill:boxImage
    
                fixture.onBeginContact: {
    
                    boxImage.opacity=0.5
    
                }
    
    
    
    
    
    
    
    
    
            }
    
        }
    
    
    
    
    

    </div>
    <div>
    <div>}</div>
    </div>
    </div>
    </div>
    </div>

    #16148

    Günther
    Felgo Team
    #16153

    Patricia

    Hi, Günther

    Now, I can build the program but it send me lots of errors like:

    —->WARNING: Can’t find config.json file

    I have a new file config.json and inside you can read this:

    
    
        "title": "qt_game",
           "identifier": "com.yourcompany.wizardEVP.qt_game",
           "orientation": "auto",
           "versioncode": 1,
           "versionname": "1.0",
           "stage": "test"
    
    
    }
    
    

    I’m not sure if the dates that I put are ok. For example, I don’t know how get the identifier, I copied it from other program and I only changed the name of the project.

    Second error—-> qrc:/main.qml:410:9: QML BoxCollider: Cannot anchor to an item that isn’t a parent or sibling.

    Third error —–> qrc:///qml/VPlay/core/EntityBase.qml:573:3: QML Connections: Cannot assign to non-existent property “onEntityManagerDestroyed”

    libpng warning: iCCP: known incorrect sRGB profile

    ERROR: Invalid license key set for plugin: “VPlay” “2.0”

    qml: WARNING: EntityBase: you did not set an entityType for the entity EntityBase_QMLTYPE_119(0x398d0c80) with entityId – to be able to distinguish your entities set the entityType!

     

    Fourth error—-> qrc:///qml/VPlay/core/EntityBase.qml:530: ReferenceError: entityManager is not defined

    qt.network.ssl: QSslSocket: cannot resolve SSL_set_alpn_protos

    qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_alpn_select_cb

    qt.network.ssl: QSslSocket: cannot resolve SSL_get0_alpn_selected

    QWidget: Cannot create a QWidget without QApplication

    QWaitCondition: Destroyed while threads are still waiting

     

     

    Thank you a lot for your help

     

     

     

     

    #16154

    Günther
    Felgo Team

    Hi!

    The config.json file is automatically found if placed in correct path, did you already have a look at the Example QtQuick Project with a working Felgo Integration? (It was also mentioned in a reply to the above topic)
    When running the example project, the config.json warning should not occur – does the example work for you? If yes, please adjust your project settings to match the example project.

    Regarding BoxCollider, Entities and EntityManager usage, please consider having a look at our getting started tutorials. You are probably missing the

    EntityManager {
      id: entityManager
    }

    Item in your QML and might have an incorrect Parent/Child setup for your items that use EntityBase / BoxCollider.

    Best,
    Günther

     

    #16155

    Patricia

    I don’t know how to fix these Errors:

    —>WARNING: Can’t find config.json file (I put every file in the same way that the QtQuickPlay.pro you said me)

     

    —>ERROR: Invalid license key set for plugin: “VPlay” “2.0” (I paste the code that I found in vplay_license.key but it doesnt work)

    Really I dont know that Im doing wrong…

     

    Sorry, Im new in this kind of program.

     

    thanks

     

     

    #16156

    Patricia

    I forgot to say you that the example works for me.

    #16157

    Patricia

    I could fix the license error, so now the only error that I have is  the first one I wrote.

    #16158

    Günther
    Felgo Team

    I guess you are referring to the config.json issue?

    Please make sure that the config.json file is placed correctly within your project folder structure and that your .qrc resources file references this file. You can compare your project structure and setup with the example project from before (*.pro project configuration, *.qrc resources file setup, initialization in main.cpp, etc …).

    If you are new to Felgo and have troubles with including Felgo in your QML project, you can also try it the other way round:
    Create a new and empty Felgo project (which is correctly set up) or use the example Qt Quick project (which works) and then add your custom project code to this new project.

    Best,
    Günther from Felgo

    #16163

    Patricia

    I fixed it thank you!!!!

Viewing 9 posts - 1 through 9 (of 9 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