Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Newbie needs much help in game development with Qt.
QtWS25 Last Chance

Newbie needs much help in game development with Qt.

Scheduled Pinned Locked Moved Game Development
6 Posts 4 Posters 3.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Apprentice23
    wrote on last edited by
    #1

    I need guidance. I have been searching the forum, but being new to C++ and Qt is making it difficult for me. I am working with a group to develop a simple RPG game. I have to design the UI and link it to my code, which I have not been able to figure out. Hopefully I will be able to explain what I am trying to do, and be able to receive ideas on where to start to reach my objective.

    We are trying to build a Pirate game where the pirate fights off other bad pirates while collecting gold. The pirate will have different weapons to choose and certain amount of health. This pirate can be in map mode, traveling from one place to another, and in battle mode. Each mode would trigger a different pause menu. In the map world, the pause menu will allow the player to replenish health, and see the current inventory of weapons. Also, there will be an Exit, Resume button. Additionally, there will be a progress bar and numerical text that will display the player's health.

    In battle mode, another UI will appear that will allow the player to interchange weapons currently on inventory, and use any health available that the player collected on missions, I suppose. Once the player makes a selection, the the game will resume on with either a pressed key or by the press of a button.

    I have created two different UI's with the 'Create a new UI form' that Qt offers. I need help on how to link the UI's to certain classes when the player presses a key. Also, how do I connect my widgets to my classes? For example, as soon as the player pauses the game, my pause menu will show the current health of the player. I can't figure out how to do this.

    I hope I made sense, and would appreciate very much your help on getting me started in right direction.

    Thanks

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      Yes, that made sense. :) But first, please tell us:

      What other programming languages have you used before?

      Do you have previous experience with game programming?

      Secondly, widgets are static components, which are suitable for office applications. However, for fluid components with animations, you'll want to use Qt Quick (http://qt-project.org/doc/qt-5.1/qtdoc/qtquick-applicationdevelopers.html )

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Apprentice23
        wrote on last edited by
        #3

        I have used Java for about two years, but nothing extensive. I am a newbie to programming too. At this moment, I am learning Python, C++, and C.
        I don't have a strong grasp of super classes and inheritance which seem to be prevalent with Qt. I am confused about what the parent pointer does in Qt applications, part of my problem, I guess.

        I do not have any experience with game programming which is adding another layer of confusion. I hope I can make sense of it all.

        Right now I am going over a sample tutorial on building a notepad application hoping it will clear some confusion.

        Thank for the the link, I will look into it and hopefully make use of it.
        I appreciate your help.

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          [quote author="Apprentice23" date="1385253173"]I have used Java for about two years, but nothing extensive. I am a newbie to programming too. At this moment, I am learning Python, C++, and C.
          I don't have a strong grasp of super classes and inheritance which seem to be prevalent with Qt.[/quote]Super classes and inheritances are core concepts in Object-Oriented Programming (OOP). It's not unique to Qt; It is also prevalent in Java, and it is present in Python. I recommend reading a beginner's guide to OOP.

          If you are learning C++, I don't see any benefits in learning C at the same time. You can think of C++ as a superset of C (well, strictly speaking, there are a few small incompatibilities, but that's insignificant for most purposes).

          [quote author="Apprentice23" date="1385253173"]I am confused about what the parent pointer does in Qt applications[/quote]The parent pointer in Qt is for specifying ownership of QObjects. A parent object is said to "own" the child object. A parent is responsible for the memory management of its children. Ownership can be transferred, but each object can only have 1 parent at a time.

          http://qt-project.org/doc/qt-5.1/qtcore/objecttrees.html

          [quote]I do not have any experience with game programming which is adding another layer of confusion. I hope I can make sense of it all.[/quote]The game you've described is far too complex for a beginner. A small team of experienced developers would need several weeks to produce it.

          I encourage you to complete a few small projects first. Once you're familiar with the basics, you can put it all together to create a large project.

          [quote]Right now I am going over a sample tutorial on building a notepad application hoping it will clear some confusion.[/quote]The notepad tutorial will teach you how to use the IDE, as well as an important concept which is central to Qt: "Signals and Slots":http://qt-project.org/doc/qt-5.1/qtcore/signalsandslots.html

          It's definitely worth following that tutorial. However, GUI-wise, it uses widgets. As I said earlier, widgets are not suitable for games. When you've finished the notepad tutorial, see:

          • "Basic Qt Quick tutorial":http://qt-project.org/doc/qt-5.1/qtquick/qml-tutorial.html
          • "Advanced Qt Quick tutorial":http://doc-snapshot.qt-project.org/qt5-stable/qml-advtutorial.html (a simple game)

          [quote]Thank for the the link, I will look into it and hopefully make use of it.
          I appreciate your help. [/quote]You're welcome. :) All the best with learning; feel free to start new posts to ask for help on specific issues you come across!

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • N Offline
            N Offline
            nunu
            wrote on last edited by
            #5

            Hi,

            I was in a similar position some time back. This tutorial helped me a lot to get a good grasp of C++.... www.cplusplus.com/files/tutorial.pdf.

            I would suggest going through it first before taking on Qt.

            Good luck!

            1 Reply Last reply
            0
            • F Offline
              F Offline
              feldifux
              wrote on last edited by
              #6

              Hi,
              we also have some beginner's tutorials on the V-Play website:

              • How to create a "physics game":http://v-play.net/doc/vplay-entity-concept.html
              • How to create a "balloon popping game":http://v-play.net/doc/howto-balloon-game.html
              • How to create "Pong":http://v-play.net/doc/howto-pong-game.html

              These resources are for QML & JavaScript, which are easier to learn and faster to work with than C++..

              Cheers, Chris

              Founder of Felgo SDK - http://felgo.com/qt

              Felgo simplifies

              • Mobile App Dev with Qt esp. iOS & Android
              • Game Development with Qt

              What others say

              Felgo scored #1 in Cross-Platform App Development Tools Report - see why: https://goo.gl/rgp3rq

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved