Results 1 to 6 of 6

Thread: A floppybird game challenge

  1. #1
    Join Date
    Apr 2024
    Posts
    1
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Windows Android

    Question A floppybird game challenge

    I need help

    Hi, I have made a floppybird game on qt with a graphicseen. I also made a text which show the height base on y(), but it is reversed. How can i fix it ?
    For example, when floppy bird go up, the height number which is based on y(); shows the lower number.

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    518
    Thanks
    13
    Thanked 77 Times in 75 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: A floppybird game challenge

    Hi, in screen coordinates you have zero at the top of your screen, and the max value at the bottom.

    Ginsengelf

  3. #3
    Join Date
    May 2024
    Location
    India
    Posts
    4
    Qt products
    Qt/Embedded
    Platforms
    Windows

    Default Re: A floppybird game challenge

    Hey hi, you need to invert the y coordinate value so that higher values correspond to higher height. You can achieve this by subtracting the y coordinate from the maximum height value.

  4. #4

    Default Re: A floppybird game challenge

    In Qt's QGraphicsScene, the coordinate system has the origin at the top-left corner, with the Y-axis increasing downwards.
    MAYAPOSCH
    This means that as your Flappy Bird character moves upward, its Y-coordinate decreases. Consequently, when you display the Y-coordinate as the height, it appears to decrease as the bird ascends, which is the opposite of the expected behavior.

  5. #5

    Default Re: A floppybird game challenge

    In Qt's QGraphicsScene, the coordinate system has the origin at the top-left corner, with the Y-axis increasing downwards.
    This means that as your Flappy Bird character moves upward, its Y-coordinate decreases. Consequently, when you display the Y-coordinate as the height, it appears to decrease as the bird ascends, which is the opposite of the expected behavior.

  6. #6
    Join Date
    May 2025
    Posts
    1
    Qt products
    PyQt3 PyQt4
    Platforms
    Unix/X11

    Default Re: A floppybird game challenge

    oh. thank you for this answer

Similar Threads

  1. game on qt
    By bibhukalyana in forum Qt Programming
    Replies: 6
    Last Post: 27th March 2011, 22:56
  2. Challenge + confusion while rotating main window with QT?how to do?
    By savaliya_ambani in forum Qt for Embedded and Mobile
    Replies: 28
    Last Post: 5th June 2010, 09:18
  3. Replies: 1
    Last Post: 22nd May 2010, 07:38
  4. Challenge Question
    By Brandybuck in forum The GraphicsView Framework
    Replies: 1
    Last Post: 3rd June 2008, 19:29
  5. Trolltech Developer Challenge
    By lpotter in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 16th April 2007, 19:39

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.