Thread: a simple doubt in graphics

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    11

    a simple doubt in graphics

    to all gentlemen,

    i did a very small program in which i wanted a rectangle(controlled
    by me) to hit a falling circle. but this is not working propely as
    functions are being executed sequentially.
    what i need is that the circle must fall and at the same time i must be able to control the rectangle and the main thing is that i
    do not want to use class or other stuffs just functions
    can you help me
    Last edited by Salem; 02-01-2006 at 07:51 AM. Reason: snip email address

  2. #2
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    Post the problem and some code here if you want help. Most people here don't do 1-1 services.

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    Move each shape a tiny bit at a time:
    Code:
    while(Looping)
    {
      UpdateRectangle();
      UpdateCircle();
    }
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    do not want to use class or other stuffs just functions
    Why not?

  5. #5
    Absent Minded Programmer
    Join Date
    May 2005
    Posts
    968
    Quote Originally Posted by Bubba
    Why not?
    Alot of programming courses cover basics up to functions for instance, they don't want you to use classes, they want you to use what they've taught you, and nothing else..

    I noticed this in my first programming course, but the teacher definately wouldn't complain if I added more features and exceeded expectations.

    But I can't imagine how this could work in graphics programming.


    Of course this might not be the case at all.
    Sometimes I forget what I am doing when I enter a room, actually, quite often.

  6. #6
    Call me AirBronto
    Join Date
    Sep 2004
    Location
    Indianapolis, Indiana
    Posts
    195
    It sounds like you are having problems understanding the concept of a game. Programmers dont do every thing at the same time, the computer just dose every thing so fast that it seems this way. Dose this help?

  7. #7
    Registered User
    Join Date
    Jan 2005
    Posts
    106
    You could multithread it, I guess. Which would be like using a train to crush a fly, but...

    also, you shouldn't need classes for this.

  8. #8
    Call me AirBronto
    Join Date
    Sep 2004
    Location
    Indianapolis, Indiana
    Posts
    195
    That is not what he is talking about, he just dosent understand the idea that a computer dose only one thing at a time, but dose them very very fast.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Turtle Graphics, how does it work?
    By freddyvorhees in forum C++ Programming
    Replies: 15
    Last Post: 08-28-2009, 09:57 AM
  2. simple 2d "putpixel" api for windows?
    By spiky in forum C Programming
    Replies: 2
    Last Post: 10-27-2005, 02:44 PM
  3. Graphics tutorial
    By ssjnamek in forum C++ Programming
    Replies: 1
    Last Post: 08-15-2005, 02:13 AM
  4. a simple Dev-C++ game graphics system
    By shintaro in forum Game Programming
    Replies: 1
    Last Post: 08-11-2005, 05:49 PM
  5. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 03:57 PM