Forums

OverviewV-Play 2 Support (Qt 5) › CircleCollider's bouding box didn't wrap the entity.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13674

    Vi

    I’m following the tutorial FlappyBird. When creating the Player.qml:

    import VPlay 2.0
    import QtQuick 2.0
    
    EntityBase {
        id: player
        entityType: "player"
    
        SpriteSequenceVPlay {
            id: bird
            anchors.centerIn: parent
    
            SpriteVPlay {
                frameCount: 3
                frameRate: 10
                frameWidth: 34
                frameHeight: 24
                source: "../assets/bird.png"
            }
        }
        CircleCollider {
            id: collider
            radius: 13
        }
    }
    

    I tried to run the game. But the bounding box result was not same as the tutorial: Tutorial_Image vs My result

    The bounding box didn’t wrap up the image. What is my wrong? Thank you very much!

     

    #13675

    Alex
    V-Play Team

    Hi Vi,

    please add the following code to the CircleCollider:

    x: -radius
    y: -radius

    There have been minor changes to the physics engine. The point of origin of the CircleCollider is now the upper left corner and not the center, thus we have to move it a little to position it in the center in this case.

    We will update the tutorial accordingly, thank you very much for noticing this issue!

    Cheers,
    Alex

    #13676

    Vi

    Correct! Thank you so much Alex!

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