Results 1 to 2 of 2

Thread: a simple game, much trouble

  1. #1
    Join Date
    Jul 2010
    Posts
    18
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default a simple game, much trouble

    I've been trying for the life of me to get started making a simple game using the QGraphicsView and going off of what I can see from the Mouse example included in the package, but I just can't do it.

    So far, this is how it goes. The code that I'm trying to include is fledgling; it has no capability to compile at all, and even if it did, it wouldn't do anything but display some meaningless circle (if that) because I haven't even connected the spinboxes to the necessary functions and what not...

    ok ok, so here's what I had planned.
    on the large scale, I've been trying to make a simple game. I got caught up when I was trying to add an item (Human class) to the QGraphicsScene.
    1: I couldn't figure out how the painter.drawEllipse(x,x,x,x) or painter.drawRect(x,x,x,x) functions worked. every time i would set new values, the object would be draw in a very different manner, as in, so different i couldn't figure out what values i wanted to use in there.
    2: setting the coordinates for each object, like a head, then a body, then legs and then going into each object and resetting them and recompiling every time was just stupid and slow...

    so I decided that I would put spinboxes in there and make the object redraw itself each time it was clicked, and take the coordinates from the spinboxes and use them to draw first the ellipse, then the rectangle, then the... whatever. Each time I wanted to add something to the character, i would go in and put painter.drawEllipse/Rect and then use the spinbox values. after I got the shape and positions I wanted, I would go back and hard code those values in there. get what I mean?

    Then while I was going down that side track, I got caught up with a compile error. Something about the Human class is making it hang! I included the project folder in this post, you can grab it and build it for yourself to see what's wrong.

    the compiler says: undefined reference to `vtable for Human'

    Thanks in advance. This has been very frustrating.
    Attached Files Attached Files
    Last edited by kennethadammiller; 9th July 2010 at 04:16.

  2. #2
    Join Date
    Jul 2010
    Posts
    18
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: a simple game, much trouble

    I actually found the answer to this question right after posting it. I wanted to be able to pass arguments to the advance function of an overloaded QGraphicsItem. Can't do that. hahaha

Similar Threads

  1. Replies: 1
    Last Post: 18th June 2010, 16:34
  2. Replies: 1
    Last Post: 22nd May 2010, 08:38
  3. IQ Game
    By qtgears in forum Qt-based Software
    Replies: 0
    Last Post: 6th October 2009, 09:24
  4. trouble making simple DOM model example editable
    By Mamra in forum Qt Programming
    Replies: 6
    Last Post: 1st October 2009, 15:40
  5. Trouble parsing using simple QRegExp
    By johnny_sparx in forum Qt Programming
    Replies: 4
    Last Post: 24th February 2006, 01:42

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.