Results 1 to 7 of 7

Thread: Collision detect in QGraphicsScene

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Location
    China
    Posts
    127
    Thanks
    30
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Collision detect in QGraphicsScene

    Hello,
    I am using QGraphicsScene , QGraphicsView and QGraphicsPixmapItem to write a game like Tank.
    I have wrote a class Tank inherriting from QGraphicsPixmapItem, and when I press some key, like Space, it's function shoot() is called. And I want to new some bullet in this function, then let the bullet go straight along the current direction.
    The class Bullet is inherriting from QGraphicsPixmapItem too.
    The problem is, I do not know how to detect whether the bullet reaches the border or hit the enemy tank, if it hits some enemy tank, how to destroy that tank.

    I am using Qt4.5
    Thanks in advance!!

  2. The following user says thank you to sophister for this useful post:


Similar Threads

  1. how to connect events with signals in QGraphicsScene?
    By nataly in forum Qt Programming
    Replies: 0
    Last Post: 3rd November 2009, 15:20
  2. Replies: 1
    Last Post: 30th October 2009, 08:52
  3. Replies: 0
    Last Post: 5th March 2009, 06:54
  4. in QGraphicsScene matrix of other QGraphicsScene
    By Noxxik in forum Qt Programming
    Replies: 5
    Last Post: 15th February 2009, 17:27
  5. 2D Race Car collision detection
    By neonnds in forum Qt Programming
    Replies: 0
    Last Post: 6th July 2008, 08:10

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.