Bouncing ball

This is a discussion on Bouncing ball within the Game Programming forums, part of the General Programming Boards category; Does any body has the code to make a bouncing ball in a c++ windows application. And If it's possible, ...

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    8

    Bouncing ball

    Does any body has the code to make a bouncing ball in a c++ windows application. And If it's possible, I would like a easy way of making it without using graphics.h

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Since you said you're using Windows I'd say the easiest way would be with GDI, all you'd need is a few variables to hold the current left and top coords, a bitmap of the ball and mask, an hDC and BitBlt().

    Look up BitBlt on MSDN.

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    or u can use allegro

    -its easy to learn!

  4. #4
    napKINfolk.com napkin111's Avatar
    Join Date
    Apr 2002
    Posts
    310
    I would recommend SDL. I learned it (the basics) and made a breakout game - all in about 9-10 hours total.

    //napKIN
    "The best way to get answers is to just keep working the problem, recognizing when you are stalled, and directing the search pattern.....Donít just wait for The Right Thing to strike you Ė try everything you think might even be in the right direction, so you can collect clues about the nature of the problem."
    -John Carmack

  5. #5
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    To do it very easy and look pleasing to our eye, meaning its not physically correct, just inverse the direction you are moving the bitmap in when you want it to "bounce". post what you have so far

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. bouncing ball
    By planet_abhi in forum Game Programming
    Replies: 2
    Last Post: 11-10-2003, 06:18 AM
  3. The Old Bouncing Ball
    By bartybasher in forum Game Programming
    Replies: 3
    Last Post: 08-19-2003, 03:06 AM
  4. Simple bouncing ball program
    By funkydude9 in forum Game Programming
    Replies: 3
    Last Post: 08-18-2003, 10:00 PM
  5. Bouncing ball - help ??
    By Gugge in forum C Programming
    Replies: 7
    Last Post: 04-13-2002, 02:34 PM

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