moving ball

This is a discussion on moving ball within the C++ Programming forums, part of the General Programming Boards category; i have an assignment for school in which im supposed to draw a ball to the screen so that it ...

  1. #1
    cereal killer dP munky's Avatar
    Join Date
    Nov 2002
    Posts
    655

    moving ball

    i have an assignment for school in which im supposed to draw a ball to the screen so that it reflects off of the window and im running into trouble, mainly, im drawing the ball to the screen but when its so big it wont move....i attached the code

    thanks
    Attached Files Attached Files
    guns dont kill people, abortion clinics kill people.

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Get your DrawNextFrame right. Read the docs on msdn on device contexts and the function SelectObject(). Maybe then you will see what you are doing wrong.Dont forget to DeleteObject() either and do not delete an object that is selected into the dc. delete it after you have deselected it.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    cereal killer dP munky's Avatar
    Join Date
    Nov 2002
    Posts
    655
    thats just the thing though, i cant pinpoint whats wrong w/it, i know im drawing it too big, but are you saying im not deleting it? msdn is awful, is too damn hard to navigate, you type something in and you get .net framework bull..........
    guns dont kill people, abortion clinics kill people.

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    read about SelectObject. If you have it read petzolds GDI chapter. You have to select your pen and brush into the dc then after drawing select them out again then delete them.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  5. #5
    cereal killer dP munky's Avatar
    Join Date
    Nov 2002
    Posts
    655
    is there anyway you can walk me through this, graphics are totally new to me, im reading this stuff, but its not making sense to me? i cant find selectobject() (msdn is gay) i keep getting BeginPath ?
    guns dont kill people, abortion clinics kill people.

  6. #6
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  7. #7
    cereal killer dP munky's Avatar
    Join Date
    Nov 2002
    Posts
    655
    this is officially a lost cause now when i run the prog, an empty window comes up.....forget it, i'm gunna need a literal walkthrough

    hey retard

    dp: what?

    why are you doing this here?

    dp: derrrr

    yeah, you need to do this then write this here ya moron

    dp: oh, er uh........derrrrrr ::drool::

    thanks anyway stonie........im just not on my "A" game tonight
    Last edited by dP munky; 04-10-2003 at 10:13 PM.
    guns dont kill people, abortion clinics kill people.

  8. #8
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    "i have an assignment for school in which im supposed to draw a ball"

    The point is that your supposed to do it, not have someone feed you code. Keep digging and exploring--that's how you learn stuff.

  9. #9
    Registered User
    Join Date
    Mar 2003
    Posts
    17
    maybe you should listen in class or get a book about it.
    Drink Yer Wilk

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to create a bouncing ball?
    By Swerve in forum C++ Programming
    Replies: 7
    Last Post: 09-12-2008, 03:41 AM
  2. Pls repair my basketball program
    By death_messiah12 in forum C++ Programming
    Replies: 10
    Last Post: 12-11-2006, 04:15 AM
  3. Display Lists (OpenGL)
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 06-05-2005, 12:11 PM
  4. Mind-Reading chip for the disabled
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 04-04-2005, 12:44 PM
  5. "Pong" NOTE: In Visual Basics!!! Needed Formula
    By Helpmeplease in forum Game Programming
    Replies: 3
    Last Post: 12-05-2002, 09:36 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21