Thread: Pressing a key to display a new bmp

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    3

    Pressing a key to display a new bmp

    Hi guys, im a newbie.. and I was wondering if there was a simple routine for pressing a key to display a new bmp in visual c++.

    For example, if i pressed space, and it would show a high scoretable.. or if I pressed the Left cursor and it showed a different animation than if i pressed the Right cursor


    Your help is much appreciated!

    The Dark Knight!

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Heres the code
    Code:
    if(pressed_space)
    {
      displayBitmap(number1);
    }
    if(pressed_right)
    {
      displayBitmap(number2);
    }
    But being serious you are going to have to use some sort of graphic libary
    Woop?

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    3
    thanks.. i got a graphic library... so i just do..

    if(VK_space)
    {
    load(&g_cSpriteImages,1,245,1) // the co ordinates
    }

    to show a change in the sprite? and if i want to change background.. say from the title screen to the credits... i jus do

    if(VK_1)
    {
    if(!background.load("Beach.bmp"))return FALSE;
    background.draw(lpBackground);
    }

    yea?

    ur help is as always much appreciated!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. continuous key pressing technique
    By hdragon in forum Game Programming
    Replies: 3
    Last Post: 06-09-2006, 09:25 PM
  2. need help program crashing
    By tunerfreak in forum C++ Programming
    Replies: 14
    Last Post: 05-22-2006, 11:29 AM
  3. BCB Key press problem
    By Death_Wraith in forum Game Programming
    Replies: 0
    Last Post: 05-30-2004, 03:13 PM
  4. LISP (DrScheme) any one?
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 03-31-2004, 12:52 PM
  5. BST/Red and Black Tree
    By ghettoman in forum C++ Programming
    Replies: 0
    Last Post: 10-24-2001, 10:45 PM