Forums

OverviewFelgo 2 Support (Qt 5) › Flappy Bird Tutorial Cannot assign to non-existent property "player"

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #16908

    Scott

    I’ve been doing the flappy bird tutorial and once I added the Player.qml. I first got a message file case mismatch so I changed the code link to player { } and the file to player.qml. Now I am getting the message Cannot assign to non-existent property “player”. I can’t seem to get this right. Everything seems to look like the tutorial. Here is the code for main qml (player.qml is in the same directory as main.qml:

     

    import Felgo 3.0
    import QtQuick 2.0
    
    GameWindow {
          id: gameWindow
          
          activeScene: scene
          screenWidth: 320
          screenHeight: 480
        
          EntityManager {
            id: entityManager
            }
    
          Scene {
            id: scene
            
                player {
                    id: player
                    x: 147
                    y: 167
                }
          }
    }
    

    Any idea how to go forward. I am using Mac OS Yosemite.

    #16909

    Kool

    This may be a relevant snippet from the Qt documentation: http://doc.qt.io/qt-5/qtqml-documents-definetypes.html#defining-an-object-type-with-a-qml-file

    Note: the letter case of the file name is significant on some (notably UNIX) filesystems. It is recommended the file name case matches the case of the desired QML type name exactly - for example, Box.qml and not BoX.qml - regardless of the platform to which the QML type will be deployed.

    Try renaming the ‘player.qml’ file to ‘Player.qml’ and matching the filename case in your QML code.

    #16918

    Alex
    Felgo Team

    Hi,

    thanks Kool for jumping in here. That is correct, please start your qml files with an uppercase letter and use the same spelling in your code.

    For your example, use Player.qml and

    Player {
    
    }

    Cheers,
    Alex

    #16920

    Scott

    I had thought that was the case too.

    I tried:

    Player {
    }

    with Player.qml

    Then I tried player.qml with

    player{
    }

    Neither seems to work. I so I tried keeping deleting the debug folder and them renaming it back to Player.qml and use Player{.

    I completely restarted qt and it seemed to work. So I’m not sure exactly what’s going on since I tried those already.

    Thanks for clearing that up though.

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